
// import.meta.url shim for CJS
const __import_meta_url__ = require('url').pathToFileURL(__filename).href;

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

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js
var require_constants = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js"(exports2, module2) {
    "use strict";
    var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
    var hasBlob = typeof Blob !== "undefined";
    if (hasBlob) BINARY_TYPES.push("blob");
    module2.exports = {
      BINARY_TYPES,
      CLOSE_TIMEOUT: 3e4,
      EMPTY_BUFFER: Buffer.alloc(0),
      GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
      hasBlob,
      kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
      kListener: Symbol("kListener"),
      kStatusCode: Symbol("status-code"),
      kWebSocket: Symbol("websocket"),
      NOOP: () => {
      }
    };
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js
var require_buffer_util = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
    "use strict";
    var { EMPTY_BUFFER } = require_constants();
    var FastBuffer = Buffer[Symbol.species];
    function concat(list, totalLength) {
      if (list.length === 0) return EMPTY_BUFFER;
      if (list.length === 1) return list[0];
      const target = Buffer.allocUnsafe(totalLength);
      let offset = 0;
      for (let i3 = 0; i3 < list.length; i3++) {
        const buf = list[i3];
        target.set(buf, offset);
        offset += buf.length;
      }
      if (offset < totalLength) {
        return new FastBuffer(target.buffer, target.byteOffset, offset);
      }
      return target;
    }
    function _mask(source, mask, output, offset, length) {
      for (let i3 = 0; i3 < length; i3++) {
        output[offset + i3] = source[i3] ^ mask[i3 & 3];
      }
    }
    function _unmask(buffer, mask) {
      for (let i3 = 0; i3 < buffer.length; i3++) {
        buffer[i3] ^= mask[i3 & 3];
      }
    }
    function toArrayBuffer(buf) {
      if (buf.length === buf.buffer.byteLength) {
        return buf.buffer;
      }
      return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
    }
    function toBuffer(data) {
      toBuffer.readOnly = true;
      if (Buffer.isBuffer(data)) return data;
      let buf;
      if (data instanceof ArrayBuffer) {
        buf = new FastBuffer(data);
      } else if (ArrayBuffer.isView(data)) {
        buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);
      } else {
        buf = Buffer.from(data);
        toBuffer.readOnly = false;
      }
      return buf;
    }
    module2.exports = {
      concat,
      mask: _mask,
      toArrayBuffer,
      toBuffer,
      unmask: _unmask
    };
    if (!process.env.WS_NO_BUFFER_UTIL) {
      try {
        const bufferUtil = require("bufferutil");
        module2.exports.mask = function(source, mask, output, offset, length) {
          if (length < 48) _mask(source, mask, output, offset, length);
          else bufferUtil.mask(source, mask, output, offset, length);
        };
        module2.exports.unmask = function(buffer, mask) {
          if (buffer.length < 32) _unmask(buffer, mask);
          else bufferUtil.unmask(buffer, mask);
        };
      } catch (e3) {
      }
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js
var require_limiter = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js"(exports2, module2) {
    "use strict";
    var kDone = Symbol("kDone");
    var kRun = Symbol("kRun");
    var Limiter = class {
      /**
       * Creates a new `Limiter`.
       *
       * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
       *     to run concurrently
       */
      constructor(concurrency) {
        this[kDone] = () => {
          this.pending--;
          this[kRun]();
        };
        this.concurrency = concurrency || Infinity;
        this.jobs = [];
        this.pending = 0;
      }
      /**
       * Adds a job to the queue.
       *
       * @param {Function} job The job to run
       * @public
       */
      add(job) {
        this.jobs.push(job);
        this[kRun]();
      }
      /**
       * Removes a job from the queue and runs it if possible.
       *
       * @private
       */
      [kRun]() {
        if (this.pending === this.concurrency) return;
        if (this.jobs.length) {
          const job = this.jobs.shift();
          this.pending++;
          job(this[kDone]);
        }
      }
    };
    module2.exports = Limiter;
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js
var require_permessage_deflate = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
    "use strict";
    var zlib = require("zlib");
    var bufferUtil = require_buffer_util();
    var Limiter = require_limiter();
    var { kStatusCode } = require_constants();
    var FastBuffer = Buffer[Symbol.species];
    var TRAILER = Buffer.from([0, 0, 255, 255]);
    var kPerMessageDeflate = Symbol("permessage-deflate");
    var kTotalLength = Symbol("total-length");
    var kCallback = Symbol("callback");
    var kBuffers = Symbol("buffers");
    var kError = Symbol("error");
    var zlibLimiter;
    var PerMessageDeflate = class {
      /**
       * Creates a PerMessageDeflate instance.
       *
       * @param {Object} [options] Configuration options
       * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
       *     for, or request, a custom client window size
       * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
       *     acknowledge disabling of client context takeover
       * @param {Number} [options.concurrencyLimit=10] The number of concurrent
       *     calls to zlib
       * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
       *     use of a custom server window size
       * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
       *     disabling of server context takeover
       * @param {Number} [options.threshold=1024] Size (in bytes) below which
       *     messages should not be compressed if context takeover is disabled
       * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
       *     deflate
       * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
       *     inflate
       * @param {Boolean} [isServer=false] Create the instance in either server or
       *     client mode
       * @param {Number} [maxPayload=0] The maximum allowed message length
       */
      constructor(options, isServer, maxPayload) {
        this._maxPayload = maxPayload | 0;
        this._options = options || {};
        this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024;
        this._isServer = !!isServer;
        this._deflate = null;
        this._inflate = null;
        this.params = null;
        if (!zlibLimiter) {
          const concurrency = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;
          zlibLimiter = new Limiter(concurrency);
        }
      }
      /**
       * @type {String}
       */
      static get extensionName() {
        return "permessage-deflate";
      }
      /**
       * Create an extension negotiation offer.
       *
       * @return {Object} Extension parameters
       * @public
       */
      offer() {
        const params = {};
        if (this._options.serverNoContextTakeover) {
          params.server_no_context_takeover = true;
        }
        if (this._options.clientNoContextTakeover) {
          params.client_no_context_takeover = true;
        }
        if (this._options.serverMaxWindowBits) {
          params.server_max_window_bits = this._options.serverMaxWindowBits;
        }
        if (this._options.clientMaxWindowBits) {
          params.client_max_window_bits = this._options.clientMaxWindowBits;
        } else if (this._options.clientMaxWindowBits == null) {
          params.client_max_window_bits = true;
        }
        return params;
      }
      /**
       * Accept an extension negotiation offer/response.
       *
       * @param {Array} configurations The extension negotiation offers/reponse
       * @return {Object} Accepted configuration
       * @public
       */
      accept(configurations) {
        configurations = this.normalizeParams(configurations);
        this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations);
        return this.params;
      }
      /**
       * Releases all resources used by the extension.
       *
       * @public
       */
      cleanup() {
        if (this._inflate) {
          this._inflate.close();
          this._inflate = null;
        }
        if (this._deflate) {
          const callback = this._deflate[kCallback];
          this._deflate.close();
          this._deflate = null;
          if (callback) {
            callback(
              new Error(
                "The deflate stream was closed while data was being processed"
              )
            );
          }
        }
      }
      /**
       *  Accept an extension negotiation offer.
       *
       * @param {Array} offers The extension negotiation offers
       * @return {Object} Accepted configuration
       * @private
       */
      acceptAsServer(offers) {
        const opts = this._options;
        const accepted = offers.find((params) => {
          if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
            return false;
          }
          return true;
        });
        if (!accepted) {
          throw new Error("None of the extension offers can be accepted");
        }
        if (opts.serverNoContextTakeover) {
          accepted.server_no_context_takeover = true;
        }
        if (opts.clientNoContextTakeover) {
          accepted.client_no_context_takeover = true;
        }
        if (typeof opts.serverMaxWindowBits === "number") {
          accepted.server_max_window_bits = opts.serverMaxWindowBits;
        }
        if (typeof opts.clientMaxWindowBits === "number") {
          accepted.client_max_window_bits = opts.clientMaxWindowBits;
        } else if (accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false) {
          delete accepted.client_max_window_bits;
        }
        return accepted;
      }
      /**
       * Accept the extension negotiation response.
       *
       * @param {Array} response The extension negotiation response
       * @return {Object} Accepted configuration
       * @private
       */
      acceptAsClient(response) {
        const params = response[0];
        if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) {
          throw new Error('Unexpected parameter "client_no_context_takeover"');
        }
        if (!params.client_max_window_bits) {
          if (typeof this._options.clientMaxWindowBits === "number") {
            params.client_max_window_bits = this._options.clientMaxWindowBits;
          }
        } else if (this._options.clientMaxWindowBits === false || typeof this._options.clientMaxWindowBits === "number" && params.client_max_window_bits > this._options.clientMaxWindowBits) {
          throw new Error(
            'Unexpected or invalid parameter "client_max_window_bits"'
          );
        }
        return params;
      }
      /**
       * Normalize parameters.
       *
       * @param {Array} configurations The extension negotiation offers/reponse
       * @return {Array} The offers/response with normalized parameters
       * @private
       */
      normalizeParams(configurations) {
        configurations.forEach((params) => {
          Object.keys(params).forEach((key) => {
            let value = params[key];
            if (value.length > 1) {
              throw new Error(`Parameter "${key}" must have only a single value`);
            }
            value = value[0];
            if (key === "client_max_window_bits") {
              if (value !== true) {
                const num = +value;
                if (!Number.isInteger(num) || num < 8 || num > 15) {
                  throw new TypeError(
                    `Invalid value for parameter "${key}": ${value}`
                  );
                }
                value = num;
              } else if (!this._isServer) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
            } else if (key === "server_max_window_bits") {
              const num = +value;
              if (!Number.isInteger(num) || num < 8 || num > 15) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
              value = num;
            } else if (key === "client_no_context_takeover" || key === "server_no_context_takeover") {
              if (value !== true) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
            } else {
              throw new Error(`Unknown parameter "${key}"`);
            }
            params[key] = value;
          });
        });
        return configurations;
      }
      /**
       * Decompress data. Concurrency limited.
       *
       * @param {Buffer} data Compressed data
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @public
       */
      decompress(data, fin, callback) {
        zlibLimiter.add((done) => {
          this._decompress(data, fin, (err, result) => {
            done();
            callback(err, result);
          });
        });
      }
      /**
       * Compress data. Concurrency limited.
       *
       * @param {(Buffer|String)} data Data to compress
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @public
       */
      compress(data, fin, callback) {
        zlibLimiter.add((done) => {
          this._compress(data, fin, (err, result) => {
            done();
            callback(err, result);
          });
        });
      }
      /**
       * Decompress data.
       *
       * @param {Buffer} data Compressed data
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @private
       */
      _decompress(data, fin, callback) {
        const endpoint = this._isServer ? "client" : "server";
        if (!this._inflate) {
          const key = `${endpoint}_max_window_bits`;
          const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._inflate = zlib.createInflateRaw({
            ...this._options.zlibInflateOptions,
            windowBits
          });
          this._inflate[kPerMessageDeflate] = this;
          this._inflate[kTotalLength] = 0;
          this._inflate[kBuffers] = [];
          this._inflate.on("error", inflateOnError);
          this._inflate.on("data", inflateOnData);
        }
        this._inflate[kCallback] = callback;
        this._inflate.write(data);
        if (fin) this._inflate.write(TRAILER);
        this._inflate.flush(() => {
          const err = this._inflate[kError];
          if (err) {
            this._inflate.close();
            this._inflate = null;
            callback(err);
            return;
          }
          const data2 = bufferUtil.concat(
            this._inflate[kBuffers],
            this._inflate[kTotalLength]
          );
          if (this._inflate._readableState.endEmitted) {
            this._inflate.close();
            this._inflate = null;
          } else {
            this._inflate[kTotalLength] = 0;
            this._inflate[kBuffers] = [];
            if (fin && this.params[`${endpoint}_no_context_takeover`]) {
              this._inflate.reset();
            }
          }
          callback(null, data2);
        });
      }
      /**
       * Compress data.
       *
       * @param {(Buffer|String)} data Data to compress
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @private
       */
      _compress(data, fin, callback) {
        const endpoint = this._isServer ? "server" : "client";
        if (!this._deflate) {
          const key = `${endpoint}_max_window_bits`;
          const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._deflate = zlib.createDeflateRaw({
            ...this._options.zlibDeflateOptions,
            windowBits
          });
          this._deflate[kTotalLength] = 0;
          this._deflate[kBuffers] = [];
          this._deflate.on("data", deflateOnData);
        }
        this._deflate[kCallback] = callback;
        this._deflate.write(data);
        this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
          if (!this._deflate) {
            return;
          }
          let data2 = bufferUtil.concat(
            this._deflate[kBuffers],
            this._deflate[kTotalLength]
          );
          if (fin) {
            data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4);
          }
          this._deflate[kCallback] = null;
          this._deflate[kTotalLength] = 0;
          this._deflate[kBuffers] = [];
          if (fin && this.params[`${endpoint}_no_context_takeover`]) {
            this._deflate.reset();
          }
          callback(null, data2);
        });
      }
    };
    module2.exports = PerMessageDeflate;
    function deflateOnData(chunk) {
      this[kBuffers].push(chunk);
      this[kTotalLength] += chunk.length;
    }
    function inflateOnData(chunk) {
      this[kTotalLength] += chunk.length;
      if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) {
        this[kBuffers].push(chunk);
        return;
      }
      this[kError] = new RangeError("Max payload size exceeded");
      this[kError].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";
      this[kError][kStatusCode] = 1009;
      this.removeListener("data", inflateOnData);
      this.reset();
    }
    function inflateOnError(err) {
      this[kPerMessageDeflate]._inflate = null;
      if (this[kError]) {
        this[kCallback](this[kError]);
        return;
      }
      err[kStatusCode] = 1007;
      this[kCallback](err);
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js
var require_validation = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js"(exports2, module2) {
    "use strict";
    var { isUtf8 } = require("buffer");
    var { hasBlob } = require_constants();
    var tokenChars = [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 0 - 15
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 16 - 31
      0,
      1,
      0,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      1,
      1,
      0,
      1,
      1,
      0,
      // 32 - 47
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      // 48 - 63
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 64 - 79
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      1,
      1,
      // 80 - 95
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 96 - 111
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      1,
      0,
      1,
      0
      // 112 - 127
    ];
    function isValidStatusCode(code) {
      return code >= 1e3 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3e3 && code <= 4999;
    }
    function _isValidUTF8(buf) {
      const len = buf.length;
      let i3 = 0;
      while (i3 < len) {
        if ((buf[i3] & 128) === 0) {
          i3++;
        } else if ((buf[i3] & 224) === 192) {
          if (i3 + 1 === len || (buf[i3 + 1] & 192) !== 128 || (buf[i3] & 254) === 192) {
            return false;
          }
          i3 += 2;
        } else if ((buf[i3] & 240) === 224) {
          if (i3 + 2 >= len || (buf[i3 + 1] & 192) !== 128 || (buf[i3 + 2] & 192) !== 128 || buf[i3] === 224 && (buf[i3 + 1] & 224) === 128 || // Overlong
          buf[i3] === 237 && (buf[i3 + 1] & 224) === 160) {
            return false;
          }
          i3 += 3;
        } else if ((buf[i3] & 248) === 240) {
          if (i3 + 3 >= len || (buf[i3 + 1] & 192) !== 128 || (buf[i3 + 2] & 192) !== 128 || (buf[i3 + 3] & 192) !== 128 || buf[i3] === 240 && (buf[i3 + 1] & 240) === 128 || // Overlong
          buf[i3] === 244 && buf[i3 + 1] > 143 || buf[i3] > 244) {
            return false;
          }
          i3 += 4;
        } else {
          return false;
        }
      }
      return true;
    }
    function isBlob(value) {
      return hasBlob && typeof value === "object" && typeof value.arrayBuffer === "function" && typeof value.type === "string" && typeof value.stream === "function" && (value[Symbol.toStringTag] === "Blob" || value[Symbol.toStringTag] === "File");
    }
    module2.exports = {
      isBlob,
      isValidStatusCode,
      isValidUTF8: _isValidUTF8,
      tokenChars
    };
    if (isUtf8) {
      module2.exports.isValidUTF8 = function(buf) {
        return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
      };
    } else if (!process.env.WS_NO_UTF_8_VALIDATE) {
      try {
        const isValidUTF8 = require("utf-8-validate");
        module2.exports.isValidUTF8 = function(buf) {
          return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
        };
      } catch (e3) {
      }
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js
var require_receiver = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js"(exports2, module2) {
    "use strict";
    var { Writable } = require("stream");
    var PerMessageDeflate = require_permessage_deflate();
    var {
      BINARY_TYPES,
      EMPTY_BUFFER,
      kStatusCode,
      kWebSocket
    } = require_constants();
    var { concat, toArrayBuffer, unmask } = require_buffer_util();
    var { isValidStatusCode, isValidUTF8 } = require_validation();
    var FastBuffer = Buffer[Symbol.species];
    var GET_INFO = 0;
    var GET_PAYLOAD_LENGTH_16 = 1;
    var GET_PAYLOAD_LENGTH_64 = 2;
    var GET_MASK = 3;
    var GET_DATA = 4;
    var INFLATING = 5;
    var DEFER_EVENT = 6;
    var Receiver2 = class extends Writable {
      /**
       * Creates a Receiver instance.
       *
       * @param {Object} [options] Options object
       * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {String} [options.binaryType=nodebuffer] The type for binary data
       * @param {Object} [options.extensions] An object containing the negotiated
       *     extensions
       * @param {Boolean} [options.isServer=false] Specifies whether to operate in
       *     client or server mode
       * @param {Number} [options.maxPayload=0] The maximum allowed message length
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       */
      constructor(options = {}) {
        super();
        this._allowSynchronousEvents = options.allowSynchronousEvents !== void 0 ? options.allowSynchronousEvents : true;
        this._binaryType = options.binaryType || BINARY_TYPES[0];
        this._extensions = options.extensions || {};
        this._isServer = !!options.isServer;
        this._maxPayload = options.maxPayload | 0;
        this._skipUTF8Validation = !!options.skipUTF8Validation;
        this[kWebSocket] = void 0;
        this._bufferedBytes = 0;
        this._buffers = [];
        this._compressed = false;
        this._payloadLength = 0;
        this._mask = void 0;
        this._fragmented = 0;
        this._masked = false;
        this._fin = false;
        this._opcode = 0;
        this._totalPayloadLength = 0;
        this._messageLength = 0;
        this._fragments = [];
        this._errored = false;
        this._loop = false;
        this._state = GET_INFO;
      }
      /**
       * Implements `Writable.prototype._write()`.
       *
       * @param {Buffer} chunk The chunk of data to write
       * @param {String} encoding The character encoding of `chunk`
       * @param {Function} cb Callback
       * @private
       */
      _write(chunk, encoding, cb) {
        if (this._opcode === 8 && this._state == GET_INFO) return cb();
        this._bufferedBytes += chunk.length;
        this._buffers.push(chunk);
        this.startLoop(cb);
      }
      /**
       * Consumes `n` bytes from the buffered data.
       *
       * @param {Number} n The number of bytes to consume
       * @return {Buffer} The consumed bytes
       * @private
       */
      consume(n3) {
        this._bufferedBytes -= n3;
        if (n3 === this._buffers[0].length) return this._buffers.shift();
        if (n3 < this._buffers[0].length) {
          const buf = this._buffers[0];
          this._buffers[0] = new FastBuffer(
            buf.buffer,
            buf.byteOffset + n3,
            buf.length - n3
          );
          return new FastBuffer(buf.buffer, buf.byteOffset, n3);
        }
        const dst = Buffer.allocUnsafe(n3);
        do {
          const buf = this._buffers[0];
          const offset = dst.length - n3;
          if (n3 >= buf.length) {
            dst.set(this._buffers.shift(), offset);
          } else {
            dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n3), offset);
            this._buffers[0] = new FastBuffer(
              buf.buffer,
              buf.byteOffset + n3,
              buf.length - n3
            );
          }
          n3 -= buf.length;
        } while (n3 > 0);
        return dst;
      }
      /**
       * Starts the parsing loop.
       *
       * @param {Function} cb Callback
       * @private
       */
      startLoop(cb) {
        this._loop = true;
        do {
          switch (this._state) {
            case GET_INFO:
              this.getInfo(cb);
              break;
            case GET_PAYLOAD_LENGTH_16:
              this.getPayloadLength16(cb);
              break;
            case GET_PAYLOAD_LENGTH_64:
              this.getPayloadLength64(cb);
              break;
            case GET_MASK:
              this.getMask();
              break;
            case GET_DATA:
              this.getData(cb);
              break;
            case INFLATING:
            case DEFER_EVENT:
              this._loop = false;
              return;
          }
        } while (this._loop);
        if (!this._errored) cb();
      }
      /**
       * Reads the first two bytes of a frame.
       *
       * @param {Function} cb Callback
       * @private
       */
      getInfo(cb) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        const buf = this.consume(2);
        if ((buf[0] & 48) !== 0) {
          const error = this.createError(
            RangeError,
            "RSV2 and RSV3 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_2_3"
          );
          cb(error);
          return;
        }
        const compressed = (buf[0] & 64) === 64;
        if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
          const error = this.createError(
            RangeError,
            "RSV1 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_1"
          );
          cb(error);
          return;
        }
        this._fin = (buf[0] & 128) === 128;
        this._opcode = buf[0] & 15;
        this._payloadLength = buf[1] & 127;
        if (this._opcode === 0) {
          if (compressed) {
            const error = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb(error);
            return;
          }
          if (!this._fragmented) {
            const error = this.createError(
              RangeError,
              "invalid opcode 0",
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb(error);
            return;
          }
          this._opcode = this._fragmented;
        } else if (this._opcode === 1 || this._opcode === 2) {
          if (this._fragmented) {
            const error = this.createError(
              RangeError,
              `invalid opcode ${this._opcode}`,
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb(error);
            return;
          }
          this._compressed = compressed;
        } else if (this._opcode > 7 && this._opcode < 11) {
          if (!this._fin) {
            const error = this.createError(
              RangeError,
              "FIN must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_FIN"
            );
            cb(error);
            return;
          }
          if (compressed) {
            const error = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb(error);
            return;
          }
          if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) {
            const error = this.createError(
              RangeError,
              `invalid payload length ${this._payloadLength}`,
              true,
              1002,
              "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"
            );
            cb(error);
            return;
          }
        } else {
          const error = this.createError(
            RangeError,
            `invalid opcode ${this._opcode}`,
            true,
            1002,
            "WS_ERR_INVALID_OPCODE"
          );
          cb(error);
          return;
        }
        if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
        this._masked = (buf[1] & 128) === 128;
        if (this._isServer) {
          if (!this._masked) {
            const error = this.createError(
              RangeError,
              "MASK must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_MASK"
            );
            cb(error);
            return;
          }
        } else if (this._masked) {
          const error = this.createError(
            RangeError,
            "MASK must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_MASK"
          );
          cb(error);
          return;
        }
        if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
        else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
        else this.haveLength(cb);
      }
      /**
       * Gets extended payload length (7+16).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength16(cb) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        this._payloadLength = this.consume(2).readUInt16BE(0);
        this.haveLength(cb);
      }
      /**
       * Gets extended payload length (7+64).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength64(cb) {
        if (this._bufferedBytes < 8) {
          this._loop = false;
          return;
        }
        const buf = this.consume(8);
        const num = buf.readUInt32BE(0);
        if (num > Math.pow(2, 53 - 32) - 1) {
          const error = this.createError(
            RangeError,
            "Unsupported WebSocket frame: payload length > 2^53 - 1",
            false,
            1009,
            "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"
          );
          cb(error);
          return;
        }
        this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
        this.haveLength(cb);
      }
      /**
       * Payload length has been read.
       *
       * @param {Function} cb Callback
       * @private
       */
      haveLength(cb) {
        if (this._payloadLength && this._opcode < 8) {
          this._totalPayloadLength += this._payloadLength;
          if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
            const error = this.createError(
              RangeError,
              "Max payload size exceeded",
              false,
              1009,
              "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
            );
            cb(error);
            return;
          }
        }
        if (this._masked) this._state = GET_MASK;
        else this._state = GET_DATA;
      }
      /**
       * Reads mask bytes.
       *
       * @private
       */
      getMask() {
        if (this._bufferedBytes < 4) {
          this._loop = false;
          return;
        }
        this._mask = this.consume(4);
        this._state = GET_DATA;
      }
      /**
       * Reads data bytes.
       *
       * @param {Function} cb Callback
       * @private
       */
      getData(cb) {
        let data = EMPTY_BUFFER;
        if (this._payloadLength) {
          if (this._bufferedBytes < this._payloadLength) {
            this._loop = false;
            return;
          }
          data = this.consume(this._payloadLength);
          if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) {
            unmask(data, this._mask);
          }
        }
        if (this._opcode > 7) {
          this.controlMessage(data, cb);
          return;
        }
        if (this._compressed) {
          this._state = INFLATING;
          this.decompress(data, cb);
          return;
        }
        if (data.length) {
          this._messageLength = this._totalPayloadLength;
          this._fragments.push(data);
        }
        this.dataMessage(cb);
      }
      /**
       * Decompresses data.
       *
       * @param {Buffer} data Compressed data
       * @param {Function} cb Callback
       * @private
       */
      decompress(data, cb) {
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        perMessageDeflate.decompress(data, this._fin, (err, buf) => {
          if (err) return cb(err);
          if (buf.length) {
            this._messageLength += buf.length;
            if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
              const error = this.createError(
                RangeError,
                "Max payload size exceeded",
                false,
                1009,
                "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
              );
              cb(error);
              return;
            }
            this._fragments.push(buf);
          }
          this.dataMessage(cb);
          if (this._state === GET_INFO) this.startLoop(cb);
        });
      }
      /**
       * Handles a data message.
       *
       * @param {Function} cb Callback
       * @private
       */
      dataMessage(cb) {
        if (!this._fin) {
          this._state = GET_INFO;
          return;
        }
        const messageLength = this._messageLength;
        const fragments = this._fragments;
        this._totalPayloadLength = 0;
        this._messageLength = 0;
        this._fragmented = 0;
        this._fragments = [];
        if (this._opcode === 2) {
          let data;
          if (this._binaryType === "nodebuffer") {
            data = concat(fragments, messageLength);
          } else if (this._binaryType === "arraybuffer") {
            data = toArrayBuffer(concat(fragments, messageLength));
          } else if (this._binaryType === "blob") {
            data = new Blob(fragments);
          } else {
            data = fragments;
          }
          if (this._allowSynchronousEvents) {
            this.emit("message", data, true);
            this._state = GET_INFO;
          } else {
            this._state = DEFER_EVENT;
            setImmediate(() => {
              this.emit("message", data, true);
              this._state = GET_INFO;
              this.startLoop(cb);
            });
          }
        } else {
          const buf = concat(fragments, messageLength);
          if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
            const error = this.createError(
              Error,
              "invalid UTF-8 sequence",
              true,
              1007,
              "WS_ERR_INVALID_UTF8"
            );
            cb(error);
            return;
          }
          if (this._state === INFLATING || this._allowSynchronousEvents) {
            this.emit("message", buf, false);
            this._state = GET_INFO;
          } else {
            this._state = DEFER_EVENT;
            setImmediate(() => {
              this.emit("message", buf, false);
              this._state = GET_INFO;
              this.startLoop(cb);
            });
          }
        }
      }
      /**
       * Handles a control message.
       *
       * @param {Buffer} data Data to handle
       * @return {(Error|RangeError|undefined)} A possible error
       * @private
       */
      controlMessage(data, cb) {
        if (this._opcode === 8) {
          if (data.length === 0) {
            this._loop = false;
            this.emit("conclude", 1005, EMPTY_BUFFER);
            this.end();
          } else {
            const code = data.readUInt16BE(0);
            if (!isValidStatusCode(code)) {
              const error = this.createError(
                RangeError,
                `invalid status code ${code}`,
                true,
                1002,
                "WS_ERR_INVALID_CLOSE_CODE"
              );
              cb(error);
              return;
            }
            const buf = new FastBuffer(
              data.buffer,
              data.byteOffset + 2,
              data.length - 2
            );
            if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
              const error = this.createError(
                Error,
                "invalid UTF-8 sequence",
                true,
                1007,
                "WS_ERR_INVALID_UTF8"
              );
              cb(error);
              return;
            }
            this._loop = false;
            this.emit("conclude", code, buf);
            this.end();
          }
          this._state = GET_INFO;
          return;
        }
        if (this._allowSynchronousEvents) {
          this.emit(this._opcode === 9 ? "ping" : "pong", data);
          this._state = GET_INFO;
        } else {
          this._state = DEFER_EVENT;
          setImmediate(() => {
            this.emit(this._opcode === 9 ? "ping" : "pong", data);
            this._state = GET_INFO;
            this.startLoop(cb);
          });
        }
      }
      /**
       * Builds an error object.
       *
       * @param {function(new:Error|RangeError)} ErrorCtor The error constructor
       * @param {String} message The error message
       * @param {Boolean} prefix Specifies whether or not to add a default prefix to
       *     `message`
       * @param {Number} statusCode The status code
       * @param {String} errorCode The exposed error code
       * @return {(Error|RangeError)} The error
       * @private
       */
      createError(ErrorCtor, message, prefix, statusCode, errorCode) {
        this._loop = false;
        this._errored = true;
        const err = new ErrorCtor(
          prefix ? `Invalid WebSocket frame: ${message}` : message
        );
        Error.captureStackTrace(err, this.createError);
        err.code = errorCode;
        err[kStatusCode] = statusCode;
        return err;
      }
    };
    module2.exports = Receiver2;
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js
var require_sender = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js"(exports2, module2) {
    "use strict";
    var { Duplex } = require("stream");
    var { randomFillSync } = require("crypto");
    var PerMessageDeflate = require_permessage_deflate();
    var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
    var { isBlob, isValidStatusCode } = require_validation();
    var { mask: applyMask, toBuffer } = require_buffer_util();
    var kByteLength = Symbol("kByteLength");
    var maskBuffer = Buffer.alloc(4);
    var RANDOM_POOL_SIZE = 8 * 1024;
    var randomPool;
    var randomPoolPointer = RANDOM_POOL_SIZE;
    var DEFAULT = 0;
    var DEFLATING = 1;
    var GET_BLOB_DATA = 2;
    var Sender2 = class _Sender {
      /**
       * Creates a Sender instance.
       *
       * @param {Duplex} socket The connection socket
       * @param {Object} [extensions] An object containing the negotiated extensions
       * @param {Function} [generateMask] The function used to generate the masking
       *     key
       */
      constructor(socket, extensions, generateMask) {
        this._extensions = extensions || {};
        if (generateMask) {
          this._generateMask = generateMask;
          this._maskBuffer = Buffer.alloc(4);
        }
        this._socket = socket;
        this._firstFragment = true;
        this._compress = false;
        this._bufferedBytes = 0;
        this._queue = [];
        this._state = DEFAULT;
        this.onerror = NOOP;
        this[kWebSocket] = void 0;
      }
      /**
       * Frames a piece of data according to the HyBi WebSocket protocol.
       *
       * @param {(Buffer|String)} data The data to frame
       * @param {Object} options Options object
       * @param {Boolean} [options.fin=false] Specifies whether or not to set the
       *     FIN bit
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
       *     key
       * @param {Number} options.opcode The opcode
       * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
       *     modified
       * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
       *     RSV1 bit
       * @return {(Buffer|String)[]} The framed data
       * @public
       */
      static frame(data, options) {
        let mask;
        let merge = false;
        let offset = 2;
        let skipMasking = false;
        if (options.mask) {
          mask = options.maskBuffer || maskBuffer;
          if (options.generateMask) {
            options.generateMask(mask);
          } else {
            if (randomPoolPointer === RANDOM_POOL_SIZE) {
              if (randomPool === void 0) {
                randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
              }
              randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);
              randomPoolPointer = 0;
            }
            mask[0] = randomPool[randomPoolPointer++];
            mask[1] = randomPool[randomPoolPointer++];
            mask[2] = randomPool[randomPoolPointer++];
            mask[3] = randomPool[randomPoolPointer++];
          }
          skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
          offset = 6;
        }
        let dataLength;
        if (typeof data === "string") {
          if ((!options.mask || skipMasking) && options[kByteLength] !== void 0) {
            dataLength = options[kByteLength];
          } else {
            data = Buffer.from(data);
            dataLength = data.length;
          }
        } else {
          dataLength = data.length;
          merge = options.mask && options.readOnly && !skipMasking;
        }
        let payloadLength = dataLength;
        if (dataLength >= 65536) {
          offset += 8;
          payloadLength = 127;
        } else if (dataLength > 125) {
          offset += 2;
          payloadLength = 126;
        }
        const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
        target[0] = options.fin ? options.opcode | 128 : options.opcode;
        if (options.rsv1) target[0] |= 64;
        target[1] = payloadLength;
        if (payloadLength === 126) {
          target.writeUInt16BE(dataLength, 2);
        } else if (payloadLength === 127) {
          target[2] = target[3] = 0;
          target.writeUIntBE(dataLength, 4, 6);
        }
        if (!options.mask) return [target, data];
        target[1] |= 128;
        target[offset - 4] = mask[0];
        target[offset - 3] = mask[1];
        target[offset - 2] = mask[2];
        target[offset - 1] = mask[3];
        if (skipMasking) return [target, data];
        if (merge) {
          applyMask(data, mask, target, offset, dataLength);
          return [target];
        }
        applyMask(data, mask, data, 0, dataLength);
        return [target, data];
      }
      /**
       * Sends a close message to the other peer.
       *
       * @param {Number} [code] The status code component of the body
       * @param {(String|Buffer)} [data] The message component of the body
       * @param {Boolean} [mask=false] Specifies whether or not to mask the message
       * @param {Function} [cb] Callback
       * @public
       */
      close(code, data, mask, cb) {
        let buf;
        if (code === void 0) {
          buf = EMPTY_BUFFER;
        } else if (typeof code !== "number" || !isValidStatusCode(code)) {
          throw new TypeError("First argument must be a valid error code number");
        } else if (data === void 0 || !data.length) {
          buf = Buffer.allocUnsafe(2);
          buf.writeUInt16BE(code, 0);
        } else {
          const length = Buffer.byteLength(data);
          if (length > 123) {
            throw new RangeError("The message must not be greater than 123 bytes");
          }
          buf = Buffer.allocUnsafe(2 + length);
          buf.writeUInt16BE(code, 0);
          if (typeof data === "string") {
            buf.write(data, 2);
          } else {
            buf.set(data, 2);
          }
        }
        const options = {
          [kByteLength]: buf.length,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 8,
          readOnly: false,
          rsv1: false
        };
        if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, buf, false, options, cb]);
        } else {
          this.sendFrame(_Sender.frame(buf, options), cb);
        }
      }
      /**
       * Sends a ping message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback
       * @public
       */
      ping(data, mask, cb) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else if (isBlob(data)) {
          byteLength = data.size;
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (byteLength > 125) {
          throw new RangeError("The data size must not be greater than 125 bytes");
        }
        const options = {
          [kByteLength]: byteLength,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 9,
          readOnly,
          rsv1: false
        };
        if (isBlob(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, false, options, cb]);
          } else {
            this.getBlobData(data, false, options, cb);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, false, options, cb]);
        } else {
          this.sendFrame(_Sender.frame(data, options), cb);
        }
      }
      /**
       * Sends a pong message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback
       * @public
       */
      pong(data, mask, cb) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else if (isBlob(data)) {
          byteLength = data.size;
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (byteLength > 125) {
          throw new RangeError("The data size must not be greater than 125 bytes");
        }
        const options = {
          [kByteLength]: byteLength,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 10,
          readOnly,
          rsv1: false
        };
        if (isBlob(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, false, options, cb]);
          } else {
            this.getBlobData(data, false, options, cb);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, false, options, cb]);
        } else {
          this.sendFrame(_Sender.frame(data, options), cb);
        }
      }
      /**
       * Sends a data message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Object} options Options object
       * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
       *     or text
       * @param {Boolean} [options.compress=false] Specifies whether or not to
       *     compress `data`
       * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
       *     last one
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Function} [cb] Callback
       * @public
       */
      send(data, options, cb) {
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        let opcode = options.binary ? 2 : 1;
        let rsv1 = options.compress;
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else if (isBlob(data)) {
          byteLength = data.size;
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (this._firstFragment) {
          this._firstFragment = false;
          if (rsv1 && perMessageDeflate && perMessageDeflate.params[perMessageDeflate._isServer ? "server_no_context_takeover" : "client_no_context_takeover"]) {
            rsv1 = byteLength >= perMessageDeflate._threshold;
          }
          this._compress = rsv1;
        } else {
          rsv1 = false;
          opcode = 0;
        }
        if (options.fin) this._firstFragment = true;
        const opts = {
          [kByteLength]: byteLength,
          fin: options.fin,
          generateMask: this._generateMask,
          mask: options.mask,
          maskBuffer: this._maskBuffer,
          opcode,
          readOnly,
          rsv1
        };
        if (isBlob(data)) {
          if (this._state !== DEFAULT) {
            this.enqueue([this.getBlobData, data, this._compress, opts, cb]);
          } else {
            this.getBlobData(data, this._compress, opts, cb);
          }
        } else if (this._state !== DEFAULT) {
          this.enqueue([this.dispatch, data, this._compress, opts, cb]);
        } else {
          this.dispatch(data, this._compress, opts, cb);
        }
      }
      /**
       * Gets the contents of a blob as binary data.
       *
       * @param {Blob} blob The blob
       * @param {Boolean} [compress=false] Specifies whether or not to compress
       *     the data
       * @param {Object} options Options object
       * @param {Boolean} [options.fin=false] Specifies whether or not to set the
       *     FIN bit
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
       *     key
       * @param {Number} options.opcode The opcode
       * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
       *     modified
       * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
       *     RSV1 bit
       * @param {Function} [cb] Callback
       * @private
       */
      getBlobData(blob, compress, options, cb) {
        this._bufferedBytes += options[kByteLength];
        this._state = GET_BLOB_DATA;
        blob.arrayBuffer().then((arrayBuffer) => {
          if (this._socket.destroyed) {
            const err = new Error(
              "The socket was closed while the blob was being read"
            );
            process.nextTick(callCallbacks, this, err, cb);
            return;
          }
          this._bufferedBytes -= options[kByteLength];
          const data = toBuffer(arrayBuffer);
          if (!compress) {
            this._state = DEFAULT;
            this.sendFrame(_Sender.frame(data, options), cb);
            this.dequeue();
          } else {
            this.dispatch(data, compress, options, cb);
          }
        }).catch((err) => {
          process.nextTick(onError, this, err, cb);
        });
      }
      /**
       * Dispatches a message.
       *
       * @param {(Buffer|String)} data The message to send
       * @param {Boolean} [compress=false] Specifies whether or not to compress
       *     `data`
       * @param {Object} options Options object
       * @param {Boolean} [options.fin=false] Specifies whether or not to set the
       *     FIN bit
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
       *     key
       * @param {Number} options.opcode The opcode
       * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
       *     modified
       * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
       *     RSV1 bit
       * @param {Function} [cb] Callback
       * @private
       */
      dispatch(data, compress, options, cb) {
        if (!compress) {
          this.sendFrame(_Sender.frame(data, options), cb);
          return;
        }
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        this._bufferedBytes += options[kByteLength];
        this._state = DEFLATING;
        perMessageDeflate.compress(data, options.fin, (_, buf) => {
          if (this._socket.destroyed) {
            const err = new Error(
              "The socket was closed while data was being compressed"
            );
            callCallbacks(this, err, cb);
            return;
          }
          this._bufferedBytes -= options[kByteLength];
          this._state = DEFAULT;
          options.readOnly = false;
          this.sendFrame(_Sender.frame(buf, options), cb);
          this.dequeue();
        });
      }
      /**
       * Executes queued send operations.
       *
       * @private
       */
      dequeue() {
        while (this._state === DEFAULT && this._queue.length) {
          const params = this._queue.shift();
          this._bufferedBytes -= params[3][kByteLength];
          Reflect.apply(params[0], this, params.slice(1));
        }
      }
      /**
       * Enqueues a send operation.
       *
       * @param {Array} params Send operation parameters.
       * @private
       */
      enqueue(params) {
        this._bufferedBytes += params[3][kByteLength];
        this._queue.push(params);
      }
      /**
       * Sends a frame.
       *
       * @param {(Buffer | String)[]} list The frame to send
       * @param {Function} [cb] Callback
       * @private
       */
      sendFrame(list, cb) {
        if (list.length === 2) {
          this._socket.cork();
          this._socket.write(list[0]);
          this._socket.write(list[1], cb);
          this._socket.uncork();
        } else {
          this._socket.write(list[0], cb);
        }
      }
    };
    module2.exports = Sender2;
    function callCallbacks(sender, err, cb) {
      if (typeof cb === "function") cb(err);
      for (let i3 = 0; i3 < sender._queue.length; i3++) {
        const params = sender._queue[i3];
        const callback = params[params.length - 1];
        if (typeof callback === "function") callback(err);
      }
    }
    function onError(sender, err, cb) {
      callCallbacks(sender, err, cb);
      sender.onerror(err);
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js
var require_event_target = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js"(exports2, module2) {
    "use strict";
    var { kForOnEventAttribute, kListener } = require_constants();
    var kCode = Symbol("kCode");
    var kData = Symbol("kData");
    var kError = Symbol("kError");
    var kMessage = Symbol("kMessage");
    var kReason = Symbol("kReason");
    var kTarget = Symbol("kTarget");
    var kType = Symbol("kType");
    var kWasClean = Symbol("kWasClean");
    var Event = class {
      /**
       * Create a new `Event`.
       *
       * @param {String} type The name of the event
       * @throws {TypeError} If the `type` argument is not specified
       */
      constructor(type) {
        this[kTarget] = null;
        this[kType] = type;
      }
      /**
       * @type {*}
       */
      get target() {
        return this[kTarget];
      }
      /**
       * @type {String}
       */
      get type() {
        return this[kType];
      }
    };
    Object.defineProperty(Event.prototype, "target", { enumerable: true });
    Object.defineProperty(Event.prototype, "type", { enumerable: true });
    var CloseEvent = class extends Event {
      /**
       * Create a new `CloseEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {Number} [options.code=0] The status code explaining why the
       *     connection was closed
       * @param {String} [options.reason=''] A human-readable string explaining why
       *     the connection was closed
       * @param {Boolean} [options.wasClean=false] Indicates whether or not the
       *     connection was cleanly closed
       */
      constructor(type, options = {}) {
        super(type);
        this[kCode] = options.code === void 0 ? 0 : options.code;
        this[kReason] = options.reason === void 0 ? "" : options.reason;
        this[kWasClean] = options.wasClean === void 0 ? false : options.wasClean;
      }
      /**
       * @type {Number}
       */
      get code() {
        return this[kCode];
      }
      /**
       * @type {String}
       */
      get reason() {
        return this[kReason];
      }
      /**
       * @type {Boolean}
       */
      get wasClean() {
        return this[kWasClean];
      }
    };
    Object.defineProperty(CloseEvent.prototype, "code", { enumerable: true });
    Object.defineProperty(CloseEvent.prototype, "reason", { enumerable: true });
    Object.defineProperty(CloseEvent.prototype, "wasClean", { enumerable: true });
    var ErrorEvent = class extends Event {
      /**
       * Create a new `ErrorEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {*} [options.error=null] The error that generated this event
       * @param {String} [options.message=''] The error message
       */
      constructor(type, options = {}) {
        super(type);
        this[kError] = options.error === void 0 ? null : options.error;
        this[kMessage] = options.message === void 0 ? "" : options.message;
      }
      /**
       * @type {*}
       */
      get error() {
        return this[kError];
      }
      /**
       * @type {String}
       */
      get message() {
        return this[kMessage];
      }
    };
    Object.defineProperty(ErrorEvent.prototype, "error", { enumerable: true });
    Object.defineProperty(ErrorEvent.prototype, "message", { enumerable: true });
    var MessageEvent = class extends Event {
      /**
       * Create a new `MessageEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {*} [options.data=null] The message content
       */
      constructor(type, options = {}) {
        super(type);
        this[kData] = options.data === void 0 ? null : options.data;
      }
      /**
       * @type {*}
       */
      get data() {
        return this[kData];
      }
    };
    Object.defineProperty(MessageEvent.prototype, "data", { enumerable: true });
    var EventTarget = {
      /**
       * Register an event listener.
       *
       * @param {String} type A string representing the event type to listen for
       * @param {(Function|Object)} handler The listener to add
       * @param {Object} [options] An options object specifies characteristics about
       *     the event listener
       * @param {Boolean} [options.once=false] A `Boolean` indicating that the
       *     listener should be invoked at most once after being added. If `true`,
       *     the listener would be automatically removed when invoked.
       * @public
       */
      addEventListener(type, handler, options = {}) {
        for (const listener of this.listeners(type)) {
          if (!options[kForOnEventAttribute] && listener[kListener] === handler && !listener[kForOnEventAttribute]) {
            return;
          }
        }
        let wrapper;
        if (type === "message") {
          wrapper = function onMessage(data, isBinary) {
            const event = new MessageEvent("message", {
              data: isBinary ? data : data.toString()
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "close") {
          wrapper = function onClose(code, message) {
            const event = new CloseEvent("close", {
              code,
              reason: message.toString(),
              wasClean: this._closeFrameReceived && this._closeFrameSent
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "error") {
          wrapper = function onError(error) {
            const event = new ErrorEvent("error", {
              error,
              message: error.message
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "open") {
          wrapper = function onOpen() {
            const event = new Event("open");
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else {
          return;
        }
        wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
        wrapper[kListener] = handler;
        if (options.once) {
          this.once(type, wrapper);
        } else {
          this.on(type, wrapper);
        }
      },
      /**
       * Remove an event listener.
       *
       * @param {String} type A string representing the event type to remove
       * @param {(Function|Object)} handler The listener to remove
       * @public
       */
      removeEventListener(type, handler) {
        for (const listener of this.listeners(type)) {
          if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {
            this.removeListener(type, listener);
            break;
          }
        }
      }
    };
    module2.exports = {
      CloseEvent,
      ErrorEvent,
      Event,
      EventTarget,
      MessageEvent
    };
    function callListener(listener, thisArg, event) {
      if (typeof listener === "object" && listener.handleEvent) {
        listener.handleEvent.call(listener, event);
      } else {
        listener.call(thisArg, event);
      }
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js
var require_extension = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js"(exports2, module2) {
    "use strict";
    var { tokenChars } = require_validation();
    function push(dest, name, elem) {
      if (dest[name] === void 0) dest[name] = [elem];
      else dest[name].push(elem);
    }
    function parse2(header) {
      const offers = /* @__PURE__ */ Object.create(null);
      let params = /* @__PURE__ */ Object.create(null);
      let mustUnescape = false;
      let isEscaping = false;
      let inQuotes = false;
      let extensionName;
      let paramName;
      let start = -1;
      let code = -1;
      let end = -1;
      let i3 = 0;
      for (; i3 < header.length; i3++) {
        code = header.charCodeAt(i3);
        if (extensionName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i3;
          } else if (i3 !== 0 && (code === 32 || code === 9)) {
            if (end === -1 && start !== -1) end = i3;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i3}`);
            }
            if (end === -1) end = i3;
            const name = header.slice(start, end);
            if (code === 44) {
              push(offers, name, params);
              params = /* @__PURE__ */ Object.create(null);
            } else {
              extensionName = name;
            }
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i3}`);
          }
        } else if (paramName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i3;
          } else if (code === 32 || code === 9) {
            if (end === -1 && start !== -1) end = i3;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i3}`);
            }
            if (end === -1) end = i3;
            push(params, header.slice(start, end), true);
            if (code === 44) {
              push(offers, extensionName, params);
              params = /* @__PURE__ */ Object.create(null);
              extensionName = void 0;
            }
            start = end = -1;
          } else if (code === 61 && start !== -1 && end === -1) {
            paramName = header.slice(start, i3);
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i3}`);
          }
        } else {
          if (isEscaping) {
            if (tokenChars[code] !== 1) {
              throw new SyntaxError(`Unexpected character at index ${i3}`);
            }
            if (start === -1) start = i3;
            else if (!mustUnescape) mustUnescape = true;
            isEscaping = false;
          } else if (inQuotes) {
            if (tokenChars[code] === 1) {
              if (start === -1) start = i3;
            } else if (code === 34 && start !== -1) {
              inQuotes = false;
              end = i3;
            } else if (code === 92) {
              isEscaping = true;
            } else {
              throw new SyntaxError(`Unexpected character at index ${i3}`);
            }
          } else if (code === 34 && header.charCodeAt(i3 - 1) === 61) {
            inQuotes = true;
          } else if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i3;
          } else if (start !== -1 && (code === 32 || code === 9)) {
            if (end === -1) end = i3;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i3}`);
            }
            if (end === -1) end = i3;
            let value = header.slice(start, end);
            if (mustUnescape) {
              value = value.replace(/\\/g, "");
              mustUnescape = false;
            }
            push(params, paramName, value);
            if (code === 44) {
              push(offers, extensionName, params);
              params = /* @__PURE__ */ Object.create(null);
              extensionName = void 0;
            }
            paramName = void 0;
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i3}`);
          }
        }
      }
      if (start === -1 || inQuotes || code === 32 || code === 9) {
        throw new SyntaxError("Unexpected end of input");
      }
      if (end === -1) end = i3;
      const token2 = header.slice(start, end);
      if (extensionName === void 0) {
        push(offers, token2, params);
      } else {
        if (paramName === void 0) {
          push(params, token2, true);
        } else if (mustUnescape) {
          push(params, paramName, token2.replace(/\\/g, ""));
        } else {
          push(params, paramName, token2);
        }
        push(offers, extensionName, params);
      }
      return offers;
    }
    function format2(extensions) {
      return Object.keys(extensions).map((extension) => {
        let configurations = extensions[extension];
        if (!Array.isArray(configurations)) configurations = [configurations];
        return configurations.map((params) => {
          return [extension].concat(
            Object.keys(params).map((k) => {
              let values = params[k];
              if (!Array.isArray(values)) values = [values];
              return values.map((v3) => v3 === true ? k : `${k}=${v3}`).join("; ");
            })
          ).join("; ");
        }).join(", ");
      }).join(", ");
    }
    module2.exports = { format: format2, parse: parse2 };
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js
var require_websocket = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js"(exports2, module2) {
    "use strict";
    var EventEmitter = require("events");
    var https = require("https");
    var http = require("http");
    var net = require("net");
    var tls = require("tls");
    var { randomBytes, createHash } = require("crypto");
    var { Duplex, Readable } = require("stream");
    var { URL: URL2 } = require("url");
    var PerMessageDeflate = require_permessage_deflate();
    var Receiver2 = require_receiver();
    var Sender2 = require_sender();
    var { isBlob } = require_validation();
    var {
      BINARY_TYPES,
      CLOSE_TIMEOUT,
      EMPTY_BUFFER,
      GUID,
      kForOnEventAttribute,
      kListener,
      kStatusCode,
      kWebSocket,
      NOOP
    } = require_constants();
    var {
      EventTarget: { addEventListener, removeEventListener }
    } = require_event_target();
    var { format: format2, parse: parse2 } = require_extension();
    var { toBuffer } = require_buffer_util();
    var kAborted = Symbol("kAborted");
    var protocolVersions = [8, 13];
    var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
    var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
    var WebSocket3 = class _WebSocket extends EventEmitter {
      /**
       * Create a new `WebSocket`.
       *
       * @param {(String|URL)} address The URL to which to connect
       * @param {(String|String[])} [protocols] The subprotocols
       * @param {Object} [options] Connection options
       */
      constructor(address, protocols, options) {
        super();
        this._binaryType = BINARY_TYPES[0];
        this._closeCode = 1006;
        this._closeFrameReceived = false;
        this._closeFrameSent = false;
        this._closeMessage = EMPTY_BUFFER;
        this._closeTimer = null;
        this._errorEmitted = false;
        this._extensions = {};
        this._paused = false;
        this._protocol = "";
        this._readyState = _WebSocket.CONNECTING;
        this._receiver = null;
        this._sender = null;
        this._socket = null;
        if (address !== null) {
          this._bufferedAmount = 0;
          this._isServer = false;
          this._redirects = 0;
          if (protocols === void 0) {
            protocols = [];
          } else if (!Array.isArray(protocols)) {
            if (typeof protocols === "object" && protocols !== null) {
              options = protocols;
              protocols = [];
            } else {
              protocols = [protocols];
            }
          }
          initAsClient(this, address, protocols, options);
        } else {
          this._autoPong = options.autoPong;
          this._closeTimeout = options.closeTimeout;
          this._isServer = true;
        }
      }
      /**
       * For historical reasons, the custom "nodebuffer" type is used by the default
       * instead of "blob".
       *
       * @type {String}
       */
      get binaryType() {
        return this._binaryType;
      }
      set binaryType(type) {
        if (!BINARY_TYPES.includes(type)) return;
        this._binaryType = type;
        if (this._receiver) this._receiver._binaryType = type;
      }
      /**
       * @type {Number}
       */
      get bufferedAmount() {
        if (!this._socket) return this._bufferedAmount;
        return this._socket._writableState.length + this._sender._bufferedBytes;
      }
      /**
       * @type {String}
       */
      get extensions() {
        return Object.keys(this._extensions).join();
      }
      /**
       * @type {Boolean}
       */
      get isPaused() {
        return this._paused;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onclose() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onerror() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onopen() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onmessage() {
        return null;
      }
      /**
       * @type {String}
       */
      get protocol() {
        return this._protocol;
      }
      /**
       * @type {Number}
       */
      get readyState() {
        return this._readyState;
      }
      /**
       * @type {String}
       */
      get url() {
        return this._url;
      }
      /**
       * Set up the socket and the internal resources.
       *
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Object} options Options object
       * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Number} [options.maxPayload=0] The maximum allowed message size
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       * @private
       */
      setSocket(socket, head, options) {
        const receiver = new Receiver2({
          allowSynchronousEvents: options.allowSynchronousEvents,
          binaryType: this.binaryType,
          extensions: this._extensions,
          isServer: this._isServer,
          maxPayload: options.maxPayload,
          skipUTF8Validation: options.skipUTF8Validation
        });
        const sender = new Sender2(socket, this._extensions, options.generateMask);
        this._receiver = receiver;
        this._sender = sender;
        this._socket = socket;
        receiver[kWebSocket] = this;
        sender[kWebSocket] = this;
        socket[kWebSocket] = this;
        receiver.on("conclude", receiverOnConclude);
        receiver.on("drain", receiverOnDrain);
        receiver.on("error", receiverOnError);
        receiver.on("message", receiverOnMessage);
        receiver.on("ping", receiverOnPing);
        receiver.on("pong", receiverOnPong);
        sender.onerror = senderOnError;
        if (socket.setTimeout) socket.setTimeout(0);
        if (socket.setNoDelay) socket.setNoDelay();
        if (head.length > 0) socket.unshift(head);
        socket.on("close", socketOnClose);
        socket.on("data", socketOnData);
        socket.on("end", socketOnEnd);
        socket.on("error", socketOnError);
        this._readyState = _WebSocket.OPEN;
        this.emit("open");
      }
      /**
       * Emit the `'close'` event.
       *
       * @private
       */
      emitClose() {
        if (!this._socket) {
          this._readyState = _WebSocket.CLOSED;
          this.emit("close", this._closeCode, this._closeMessage);
          return;
        }
        if (this._extensions[PerMessageDeflate.extensionName]) {
          this._extensions[PerMessageDeflate.extensionName].cleanup();
        }
        this._receiver.removeAllListeners();
        this._readyState = _WebSocket.CLOSED;
        this.emit("close", this._closeCode, this._closeMessage);
      }
      /**
       * Start a closing handshake.
       *
       *          +----------+   +-----------+   +----------+
       *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
       *    |     +----------+   +-----------+   +----------+     |
       *          +----------+   +-----------+         |
       * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING
       *          +----------+   +-----------+   |
       *    |           |                        |   +---+        |
       *                +------------------------+-->|fin| - - - -
       *    |         +---+                      |   +---+
       *     - - - - -|fin|<---------------------+
       *              +---+
       *
       * @param {Number} [code] Status code explaining why the connection is closing
       * @param {(String|Buffer)} [data] The reason why the connection is
       *     closing
       * @public
       */
      close(code, data) {
        if (this.readyState === _WebSocket.CLOSED) return;
        if (this.readyState === _WebSocket.CONNECTING) {
          const msg = "WebSocket was closed before the connection was established";
          abortHandshake(this, this._req, msg);
          return;
        }
        if (this.readyState === _WebSocket.CLOSING) {
          if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) {
            this._socket.end();
          }
          return;
        }
        this._readyState = _WebSocket.CLOSING;
        this._sender.close(code, data, !this._isServer, (err) => {
          if (err) return;
          this._closeFrameSent = true;
          if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) {
            this._socket.end();
          }
        });
        setCloseTimer(this);
      }
      /**
       * Pause the socket.
       *
       * @public
       */
      pause() {
        if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) {
          return;
        }
        this._paused = true;
        this._socket.pause();
      }
      /**
       * Send a ping.
       *
       * @param {*} [data] The data to send
       * @param {Boolean} [mask] Indicates whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when the ping is sent
       * @public
       */
      ping(data, mask, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.ping(data || EMPTY_BUFFER, mask, cb);
      }
      /**
       * Send a pong.
       *
       * @param {*} [data] The data to send
       * @param {Boolean} [mask] Indicates whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when the pong is sent
       * @public
       */
      pong(data, mask, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.pong(data || EMPTY_BUFFER, mask, cb);
      }
      /**
       * Resume the socket.
       *
       * @public
       */
      resume() {
        if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) {
          return;
        }
        this._paused = false;
        if (!this._receiver._writableState.needDrain) this._socket.resume();
      }
      /**
       * Send a data message.
       *
       * @param {*} data The message to send
       * @param {Object} [options] Options object
       * @param {Boolean} [options.binary] Specifies whether `data` is binary or
       *     text
       * @param {Boolean} [options.compress] Specifies whether or not to compress
       *     `data`
       * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
       *     last one
       * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when data is written out
       * @public
       */
      send(data, options, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof options === "function") {
          cb = options;
          options = {};
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        const opts = {
          binary: typeof data !== "string",
          mask: !this._isServer,
          compress: true,
          fin: true,
          ...options
        };
        if (!this._extensions[PerMessageDeflate.extensionName]) {
          opts.compress = false;
        }
        this._sender.send(data || EMPTY_BUFFER, opts, cb);
      }
      /**
       * Forcibly close the connection.
       *
       * @public
       */
      terminate() {
        if (this.readyState === _WebSocket.CLOSED) return;
        if (this.readyState === _WebSocket.CONNECTING) {
          const msg = "WebSocket was closed before the connection was established";
          abortHandshake(this, this._req, msg);
          return;
        }
        if (this._socket) {
          this._readyState = _WebSocket.CLOSING;
          this._socket.destroy();
        }
      }
    };
    Object.defineProperty(WebSocket3, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket3.prototype, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket3, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket3.prototype, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket3, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket3.prototype, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket3, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    Object.defineProperty(WebSocket3.prototype, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    [
      "binaryType",
      "bufferedAmount",
      "extensions",
      "isPaused",
      "protocol",
      "readyState",
      "url"
    ].forEach((property) => {
      Object.defineProperty(WebSocket3.prototype, property, { enumerable: true });
    });
    ["open", "error", "close", "message"].forEach((method) => {
      Object.defineProperty(WebSocket3.prototype, `on${method}`, {
        enumerable: true,
        get() {
          for (const listener of this.listeners(method)) {
            if (listener[kForOnEventAttribute]) return listener[kListener];
          }
          return null;
        },
        set(handler) {
          for (const listener of this.listeners(method)) {
            if (listener[kForOnEventAttribute]) {
              this.removeListener(method, listener);
              break;
            }
          }
          if (typeof handler !== "function") return;
          this.addEventListener(method, handler, {
            [kForOnEventAttribute]: true
          });
        }
      });
    });
    WebSocket3.prototype.addEventListener = addEventListener;
    WebSocket3.prototype.removeEventListener = removeEventListener;
    module2.exports = WebSocket3;
    function initAsClient(websocket, address, protocols, options) {
      const opts = {
        allowSynchronousEvents: true,
        autoPong: true,
        closeTimeout: CLOSE_TIMEOUT,
        protocolVersion: protocolVersions[1],
        maxPayload: 100 * 1024 * 1024,
        skipUTF8Validation: false,
        perMessageDeflate: true,
        followRedirects: false,
        maxRedirects: 10,
        ...options,
        socketPath: void 0,
        hostname: void 0,
        protocol: void 0,
        timeout: void 0,
        method: "GET",
        host: void 0,
        path: void 0,
        port: void 0
      };
      websocket._autoPong = opts.autoPong;
      websocket._closeTimeout = opts.closeTimeout;
      if (!protocolVersions.includes(opts.protocolVersion)) {
        throw new RangeError(
          `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
        );
      }
      let parsedUrl;
      if (address instanceof URL2) {
        parsedUrl = address;
      } else {
        try {
          parsedUrl = new URL2(address);
        } catch (e3) {
          throw new SyntaxError(`Invalid URL: ${address}`);
        }
      }
      if (parsedUrl.protocol === "http:") {
        parsedUrl.protocol = "ws:";
      } else if (parsedUrl.protocol === "https:") {
        parsedUrl.protocol = "wss:";
      }
      websocket._url = parsedUrl.href;
      const isSecure = parsedUrl.protocol === "wss:";
      const isIpcUrl = parsedUrl.protocol === "ws+unix:";
      let invalidUrlMessage;
      if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) {
        invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;
      } else if (isIpcUrl && !parsedUrl.pathname) {
        invalidUrlMessage = "The URL's pathname is empty";
      } else if (parsedUrl.hash) {
        invalidUrlMessage = "The URL contains a fragment identifier";
      }
      if (invalidUrlMessage) {
        const err = new SyntaxError(invalidUrlMessage);
        if (websocket._redirects === 0) {
          throw err;
        } else {
          emitErrorAndClose(websocket, err);
          return;
        }
      }
      const defaultPort = isSecure ? 443 : 80;
      const key = randomBytes(16).toString("base64");
      const request = isSecure ? https.request : http.request;
      const protocolSet = /* @__PURE__ */ new Set();
      let perMessageDeflate;
      opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
      opts.defaultPort = opts.defaultPort || defaultPort;
      opts.port = parsedUrl.port || defaultPort;
      opts.host = parsedUrl.hostname.startsWith("[") ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname;
      opts.headers = {
        ...opts.headers,
        "Sec-WebSocket-Version": opts.protocolVersion,
        "Sec-WebSocket-Key": key,
        Connection: "Upgrade",
        Upgrade: "websocket"
      };
      opts.path = parsedUrl.pathname + parsedUrl.search;
      opts.timeout = opts.handshakeTimeout;
      if (opts.perMessageDeflate) {
        perMessageDeflate = new PerMessageDeflate(
          opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
          false,
          opts.maxPayload
        );
        opts.headers["Sec-WebSocket-Extensions"] = format2({
          [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
        });
      }
      if (protocols.length) {
        for (const protocol of protocols) {
          if (typeof protocol !== "string" || !subprotocolRegex.test(protocol) || protocolSet.has(protocol)) {
            throw new SyntaxError(
              "An invalid or duplicated subprotocol was specified"
            );
          }
          protocolSet.add(protocol);
        }
        opts.headers["Sec-WebSocket-Protocol"] = protocols.join(",");
      }
      if (opts.origin) {
        if (opts.protocolVersion < 13) {
          opts.headers["Sec-WebSocket-Origin"] = opts.origin;
        } else {
          opts.headers.Origin = opts.origin;
        }
      }
      if (parsedUrl.username || parsedUrl.password) {
        opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
      }
      if (isIpcUrl) {
        const parts = opts.path.split(":");
        opts.socketPath = parts[0];
        opts.path = parts[1];
      }
      let req;
      if (opts.followRedirects) {
        if (websocket._redirects === 0) {
          websocket._originalIpc = isIpcUrl;
          websocket._originalSecure = isSecure;
          websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host;
          const headers = options && options.headers;
          options = { ...options, headers: {} };
          if (headers) {
            for (const [key2, value] of Object.entries(headers)) {
              options.headers[key2.toLowerCase()] = value;
            }
          }
        } else if (websocket.listenerCount("redirect") === 0) {
          const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath;
          if (!isSameHost || websocket._originalSecure && !isSecure) {
            delete opts.headers.authorization;
            delete opts.headers.cookie;
            if (!isSameHost) delete opts.headers.host;
            opts.auth = void 0;
          }
        }
        if (opts.auth && !options.headers.authorization) {
          options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
        }
        req = websocket._req = request(opts);
        if (websocket._redirects) {
          websocket.emit("redirect", websocket.url, req);
        }
      } else {
        req = websocket._req = request(opts);
      }
      if (opts.timeout) {
        req.on("timeout", () => {
          abortHandshake(websocket, req, "Opening handshake has timed out");
        });
      }
      req.on("error", (err) => {
        if (req === null || req[kAborted]) return;
        req = websocket._req = null;
        emitErrorAndClose(websocket, err);
      });
      req.on("response", (res) => {
        const location = res.headers.location;
        const statusCode = res.statusCode;
        if (location && opts.followRedirects && statusCode >= 300 && statusCode < 400) {
          if (++websocket._redirects > opts.maxRedirects) {
            abortHandshake(websocket, req, "Maximum redirects exceeded");
            return;
          }
          req.abort();
          let addr;
          try {
            addr = new URL2(location, address);
          } catch (e3) {
            const err = new SyntaxError(`Invalid URL: ${location}`);
            emitErrorAndClose(websocket, err);
            return;
          }
          initAsClient(websocket, addr, protocols, options);
        } else if (!websocket.emit("unexpected-response", req, res)) {
          abortHandshake(
            websocket,
            req,
            `Unexpected server response: ${res.statusCode}`
          );
        }
      });
      req.on("upgrade", (res, socket, head) => {
        websocket.emit("upgrade", res);
        if (websocket.readyState !== WebSocket3.CONNECTING) return;
        req = websocket._req = null;
        const upgrade = res.headers.upgrade;
        if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") {
          abortHandshake(websocket, socket, "Invalid Upgrade header");
          return;
        }
        const digest = createHash("sha1").update(key + GUID).digest("base64");
        if (res.headers["sec-websocket-accept"] !== digest) {
          abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
          return;
        }
        const serverProt = res.headers["sec-websocket-protocol"];
        let protError;
        if (serverProt !== void 0) {
          if (!protocolSet.size) {
            protError = "Server sent a subprotocol but none was requested";
          } else if (!protocolSet.has(serverProt)) {
            protError = "Server sent an invalid subprotocol";
          }
        } else if (protocolSet.size) {
          protError = "Server sent no subprotocol";
        }
        if (protError) {
          abortHandshake(websocket, socket, protError);
          return;
        }
        if (serverProt) websocket._protocol = serverProt;
        const secWebSocketExtensions = res.headers["sec-websocket-extensions"];
        if (secWebSocketExtensions !== void 0) {
          if (!perMessageDeflate) {
            const message = "Server sent a Sec-WebSocket-Extensions header but no extension was requested";
            abortHandshake(websocket, socket, message);
            return;
          }
          let extensions;
          try {
            extensions = parse2(secWebSocketExtensions);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Extensions header";
            abortHandshake(websocket, socket, message);
            return;
          }
          const extensionNames = Object.keys(extensions);
          if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate.extensionName) {
            const message = "Server indicated an extension that was not requested";
            abortHandshake(websocket, socket, message);
            return;
          }
          try {
            perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Extensions header";
            abortHandshake(websocket, socket, message);
            return;
          }
          websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
        }
        websocket.setSocket(socket, head, {
          allowSynchronousEvents: opts.allowSynchronousEvents,
          generateMask: opts.generateMask,
          maxPayload: opts.maxPayload,
          skipUTF8Validation: opts.skipUTF8Validation
        });
      });
      if (opts.finishRequest) {
        opts.finishRequest(req, websocket);
      } else {
        req.end();
      }
    }
    function emitErrorAndClose(websocket, err) {
      websocket._readyState = WebSocket3.CLOSING;
      websocket._errorEmitted = true;
      websocket.emit("error", err);
      websocket.emitClose();
    }
    function netConnect(options) {
      options.path = options.socketPath;
      return net.connect(options);
    }
    function tlsConnect(options) {
      options.path = void 0;
      if (!options.servername && options.servername !== "") {
        options.servername = net.isIP(options.host) ? "" : options.host;
      }
      return tls.connect(options);
    }
    function abortHandshake(websocket, stream, message) {
      websocket._readyState = WebSocket3.CLOSING;
      const err = new Error(message);
      Error.captureStackTrace(err, abortHandshake);
      if (stream.setHeader) {
        stream[kAborted] = true;
        stream.abort();
        if (stream.socket && !stream.socket.destroyed) {
          stream.socket.destroy();
        }
        process.nextTick(emitErrorAndClose, websocket, err);
      } else {
        stream.destroy(err);
        stream.once("error", websocket.emit.bind(websocket, "error"));
        stream.once("close", websocket.emitClose.bind(websocket));
      }
    }
    function sendAfterClose(websocket, data, cb) {
      if (data) {
        const length = isBlob(data) ? data.size : toBuffer(data).length;
        if (websocket._socket) websocket._sender._bufferedBytes += length;
        else websocket._bufferedAmount += length;
      }
      if (cb) {
        const err = new Error(
          `WebSocket is not open: readyState ${websocket.readyState} (${readyStates[websocket.readyState]})`
        );
        process.nextTick(cb, err);
      }
    }
    function receiverOnConclude(code, reason) {
      const websocket = this[kWebSocket];
      websocket._closeFrameReceived = true;
      websocket._closeMessage = reason;
      websocket._closeCode = code;
      if (websocket._socket[kWebSocket] === void 0) return;
      websocket._socket.removeListener("data", socketOnData);
      process.nextTick(resume, websocket._socket);
      if (code === 1005) websocket.close();
      else websocket.close(code, reason);
    }
    function receiverOnDrain() {
      const websocket = this[kWebSocket];
      if (!websocket.isPaused) websocket._socket.resume();
    }
    function receiverOnError(err) {
      const websocket = this[kWebSocket];
      if (websocket._socket[kWebSocket] !== void 0) {
        websocket._socket.removeListener("data", socketOnData);
        process.nextTick(resume, websocket._socket);
        websocket.close(err[kStatusCode]);
      }
      if (!websocket._errorEmitted) {
        websocket._errorEmitted = true;
        websocket.emit("error", err);
      }
    }
    function receiverOnFinish() {
      this[kWebSocket].emitClose();
    }
    function receiverOnMessage(data, isBinary) {
      this[kWebSocket].emit("message", data, isBinary);
    }
    function receiverOnPing(data) {
      const websocket = this[kWebSocket];
      if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
      websocket.emit("ping", data);
    }
    function receiverOnPong(data) {
      this[kWebSocket].emit("pong", data);
    }
    function resume(stream) {
      stream.resume();
    }
    function senderOnError(err) {
      const websocket = this[kWebSocket];
      if (websocket.readyState === WebSocket3.CLOSED) return;
      if (websocket.readyState === WebSocket3.OPEN) {
        websocket._readyState = WebSocket3.CLOSING;
        setCloseTimer(websocket);
      }
      this._socket.end();
      if (!websocket._errorEmitted) {
        websocket._errorEmitted = true;
        websocket.emit("error", err);
      }
    }
    function setCloseTimer(websocket) {
      websocket._closeTimer = setTimeout(
        websocket._socket.destroy.bind(websocket._socket),
        websocket._closeTimeout
      );
    }
    function socketOnClose() {
      const websocket = this[kWebSocket];
      this.removeListener("close", socketOnClose);
      this.removeListener("data", socketOnData);
      this.removeListener("end", socketOnEnd);
      websocket._readyState = WebSocket3.CLOSING;
      if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
        const chunk = this.read(this._readableState.length);
        websocket._receiver.write(chunk);
      }
      websocket._receiver.end();
      this[kWebSocket] = void 0;
      clearTimeout(websocket._closeTimer);
      if (websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted) {
        websocket.emitClose();
      } else {
        websocket._receiver.on("error", receiverOnFinish);
        websocket._receiver.on("finish", receiverOnFinish);
      }
    }
    function socketOnData(chunk) {
      if (!this[kWebSocket]._receiver.write(chunk)) {
        this.pause();
      }
    }
    function socketOnEnd() {
      const websocket = this[kWebSocket];
      websocket._readyState = WebSocket3.CLOSING;
      websocket._receiver.end();
      this.end();
    }
    function socketOnError() {
      const websocket = this[kWebSocket];
      this.removeListener("error", socketOnError);
      this.on("error", NOOP);
      if (websocket) {
        websocket._readyState = WebSocket3.CLOSING;
        this.destroy();
      }
    }
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js
var require_stream = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js"(exports2, module2) {
    "use strict";
    var WebSocket3 = require_websocket();
    var { Duplex } = require("stream");
    function emitClose(stream) {
      stream.emit("close");
    }
    function duplexOnEnd() {
      if (!this.destroyed && this._writableState.finished) {
        this.destroy();
      }
    }
    function duplexOnError(err) {
      this.removeListener("error", duplexOnError);
      this.destroy();
      if (this.listenerCount("error") === 0) {
        this.emit("error", err);
      }
    }
    function createWebSocketStream2(ws, options) {
      let terminateOnDestroy = true;
      const duplex = new Duplex({
        ...options,
        autoDestroy: false,
        emitClose: false,
        objectMode: false,
        writableObjectMode: false
      });
      ws.on("message", function message(msg, isBinary) {
        const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
        if (!duplex.push(data)) ws.pause();
      });
      ws.once("error", function error(err) {
        if (duplex.destroyed) return;
        terminateOnDestroy = false;
        duplex.destroy(err);
      });
      ws.once("close", function close() {
        if (duplex.destroyed) return;
        duplex.push(null);
      });
      duplex._destroy = function(err, callback) {
        if (ws.readyState === ws.CLOSED) {
          callback(err);
          process.nextTick(emitClose, duplex);
          return;
        }
        let called = false;
        ws.once("error", function error(err2) {
          called = true;
          callback(err2);
        });
        ws.once("close", function close() {
          if (!called) callback(err);
          process.nextTick(emitClose, duplex);
        });
        if (terminateOnDestroy) ws.terminate();
      };
      duplex._final = function(callback) {
        if (ws.readyState === ws.CONNECTING) {
          ws.once("open", function open() {
            duplex._final(callback);
          });
          return;
        }
        if (ws._socket === null) return;
        if (ws._socket._writableState.finished) {
          callback();
          if (duplex._readableState.endEmitted) duplex.destroy();
        } else {
          ws._socket.once("finish", function finish() {
            callback();
          });
          ws.close();
        }
      };
      duplex._read = function() {
        if (ws.isPaused) ws.resume();
      };
      duplex._write = function(chunk, encoding, callback) {
        if (ws.readyState === ws.CONNECTING) {
          ws.once("open", function open() {
            duplex._write(chunk, encoding, callback);
          });
          return;
        }
        ws.send(chunk, callback);
      };
      duplex.on("end", duplexOnEnd);
      duplex.on("error", duplexOnError);
      return duplex;
    }
    module2.exports = createWebSocketStream2;
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js
var require_subprotocol = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
    "use strict";
    var { tokenChars } = require_validation();
    function parse2(header) {
      const protocols = /* @__PURE__ */ new Set();
      let start = -1;
      let end = -1;
      let i3 = 0;
      for (i3; i3 < header.length; i3++) {
        const code = header.charCodeAt(i3);
        if (end === -1 && tokenChars[code] === 1) {
          if (start === -1) start = i3;
        } else if (i3 !== 0 && (code === 32 || code === 9)) {
          if (end === -1 && start !== -1) end = i3;
        } else if (code === 44) {
          if (start === -1) {
            throw new SyntaxError(`Unexpected character at index ${i3}`);
          }
          if (end === -1) end = i3;
          const protocol2 = header.slice(start, end);
          if (protocols.has(protocol2)) {
            throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`);
          }
          protocols.add(protocol2);
          start = end = -1;
        } else {
          throw new SyntaxError(`Unexpected character at index ${i3}`);
        }
      }
      if (start === -1 || end !== -1) {
        throw new SyntaxError("Unexpected end of input");
      }
      const protocol = header.slice(start, i3);
      if (protocols.has(protocol)) {
        throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
      }
      protocols.add(protocol);
      return protocols;
    }
    module2.exports = { parse: parse2 };
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js
var require_websocket_server = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
    "use strict";
    var EventEmitter = require("events");
    var http = require("http");
    var { Duplex } = require("stream");
    var { createHash } = require("crypto");
    var extension = require_extension();
    var PerMessageDeflate = require_permessage_deflate();
    var subprotocol = require_subprotocol();
    var WebSocket3 = require_websocket();
    var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants();
    var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
    var RUNNING = 0;
    var CLOSING = 1;
    var CLOSED = 2;
    var WebSocketServer3 = class extends EventEmitter {
      /**
       * Create a `WebSocketServer` instance.
       *
       * @param {Object} options Configuration options
       * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {Boolean} [options.autoPong=true] Specifies whether or not to
       *     automatically send a pong in response to a ping
       * @param {Number} [options.backlog=511] The maximum length of the queue of
       *     pending connections
       * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
       *     track clients
       * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
       *     wait for the closing handshake to finish after `websocket.close()` is
       *     called
       * @param {Function} [options.handleProtocols] A hook to handle protocols
       * @param {String} [options.host] The hostname where to bind the server
       * @param {Number} [options.maxPayload=104857600] The maximum allowed message
       *     size
       * @param {Boolean} [options.noServer=false] Enable no server mode
       * @param {String} [options.path] Accept only connections matching this path
       * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
       *     permessage-deflate
       * @param {Number} [options.port] The port where to bind the server
       * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
       *     server to use
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       * @param {Function} [options.verifyClient] A hook to reject connections
       * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
       *     class to use. It must be the `WebSocket` class or class that extends it
       * @param {Function} [callback] A listener for the `listening` event
       */
      constructor(options, callback) {
        super();
        options = {
          allowSynchronousEvents: true,
          autoPong: true,
          maxPayload: 100 * 1024 * 1024,
          skipUTF8Validation: false,
          perMessageDeflate: false,
          handleProtocols: null,
          clientTracking: true,
          closeTimeout: CLOSE_TIMEOUT,
          verifyClient: null,
          noServer: false,
          backlog: null,
          // use default (511 as implemented in net.js)
          server: null,
          host: null,
          path: null,
          port: null,
          WebSocket: WebSocket3,
          ...options
        };
        if (options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer) {
          throw new TypeError(
            'One and only one of the "port", "server", or "noServer" options must be specified'
          );
        }
        if (options.port != null) {
          this._server = http.createServer((req, res) => {
            const body = http.STATUS_CODES[426];
            res.writeHead(426, {
              "Content-Length": body.length,
              "Content-Type": "text/plain"
            });
            res.end(body);
          });
          this._server.listen(
            options.port,
            options.host,
            options.backlog,
            callback
          );
        } else if (options.server) {
          this._server = options.server;
        }
        if (this._server) {
          const emitConnection = this.emit.bind(this, "connection");
          this._removeListeners = addListeners(this._server, {
            listening: this.emit.bind(this, "listening"),
            error: this.emit.bind(this, "error"),
            upgrade: (req, socket, head) => {
              this.handleUpgrade(req, socket, head, emitConnection);
            }
          });
        }
        if (options.perMessageDeflate === true) options.perMessageDeflate = {};
        if (options.clientTracking) {
          this.clients = /* @__PURE__ */ new Set();
          this._shouldEmitClose = false;
        }
        this.options = options;
        this._state = RUNNING;
      }
      /**
       * Returns the bound address, the address family name, and port of the server
       * as reported by the operating system if listening on an IP socket.
       * If the server is listening on a pipe or UNIX domain socket, the name is
       * returned as a string.
       *
       * @return {(Object|String|null)} The address of the server
       * @public
       */
      address() {
        if (this.options.noServer) {
          throw new Error('The server is operating in "noServer" mode');
        }
        if (!this._server) return null;
        return this._server.address();
      }
      /**
       * Stop the server from accepting new connections and emit the `'close'` event
       * when all existing connections are closed.
       *
       * @param {Function} [cb] A one-time listener for the `'close'` event
       * @public
       */
      close(cb) {
        if (this._state === CLOSED) {
          if (cb) {
            this.once("close", () => {
              cb(new Error("The server is not running"));
            });
          }
          process.nextTick(emitClose, this);
          return;
        }
        if (cb) this.once("close", cb);
        if (this._state === CLOSING) return;
        this._state = CLOSING;
        if (this.options.noServer || this.options.server) {
          if (this._server) {
            this._removeListeners();
            this._removeListeners = this._server = null;
          }
          if (this.clients) {
            if (!this.clients.size) {
              process.nextTick(emitClose, this);
            } else {
              this._shouldEmitClose = true;
            }
          } else {
            process.nextTick(emitClose, this);
          }
        } else {
          const server = this._server;
          this._removeListeners();
          this._removeListeners = this._server = null;
          server.close(() => {
            emitClose(this);
          });
        }
      }
      /**
       * See if a given request should be handled by this server instance.
       *
       * @param {http.IncomingMessage} req Request object to inspect
       * @return {Boolean} `true` if the request is valid, else `false`
       * @public
       */
      shouldHandle(req) {
        if (this.options.path) {
          const index = req.url.indexOf("?");
          const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
          if (pathname !== this.options.path) return false;
        }
        return true;
      }
      /**
       * Handle a HTTP Upgrade request.
       *
       * @param {http.IncomingMessage} req The request object
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Function} cb Callback
       * @public
       */
      handleUpgrade(req, socket, head, cb) {
        socket.on("error", socketOnError);
        const key = req.headers["sec-websocket-key"];
        const upgrade = req.headers.upgrade;
        const version = +req.headers["sec-websocket-version"];
        if (req.method !== "GET") {
          const message = "Invalid HTTP method";
          abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
          return;
        }
        if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") {
          const message = "Invalid Upgrade header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          return;
        }
        if (key === void 0 || !keyRegex.test(key)) {
          const message = "Missing or invalid Sec-WebSocket-Key header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          return;
        }
        if (version !== 13 && version !== 8) {
          const message = "Missing or invalid Sec-WebSocket-Version header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
            "Sec-WebSocket-Version": "13, 8"
          });
          return;
        }
        if (!this.shouldHandle(req)) {
          abortHandshake(socket, 400);
          return;
        }
        const secWebSocketProtocol = req.headers["sec-websocket-protocol"];
        let protocols = /* @__PURE__ */ new Set();
        if (secWebSocketProtocol !== void 0) {
          try {
            protocols = subprotocol.parse(secWebSocketProtocol);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Protocol header";
            abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
            return;
          }
        }
        const secWebSocketExtensions = req.headers["sec-websocket-extensions"];
        const extensions = {};
        if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) {
          const perMessageDeflate = new PerMessageDeflate(
            this.options.perMessageDeflate,
            true,
            this.options.maxPayload
          );
          try {
            const offers = extension.parse(secWebSocketExtensions);
            if (offers[PerMessageDeflate.extensionName]) {
              perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
              extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
            }
          } catch (err) {
            const message = "Invalid or unacceptable Sec-WebSocket-Extensions header";
            abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
            return;
          }
        }
        if (this.options.verifyClient) {
          const info = {
            origin: req.headers[`${version === 8 ? "sec-websocket-origin" : "origin"}`],
            secure: !!(req.socket.authorized || req.socket.encrypted),
            req
          };
          if (this.options.verifyClient.length === 2) {
            this.options.verifyClient(info, (verified, code, message, headers) => {
              if (!verified) {
                return abortHandshake(socket, code || 401, message, headers);
              }
              this.completeUpgrade(
                extensions,
                key,
                protocols,
                req,
                socket,
                head,
                cb
              );
            });
            return;
          }
          if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
        }
        this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
      }
      /**
       * Upgrade the connection to WebSocket.
       *
       * @param {Object} extensions The accepted extensions
       * @param {String} key The value of the `Sec-WebSocket-Key` header
       * @param {Set} protocols The subprotocols
       * @param {http.IncomingMessage} req The request object
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Function} cb Callback
       * @throws {Error} If called more than once with the same socket
       * @private
       */
      completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
        if (!socket.readable || !socket.writable) return socket.destroy();
        if (socket[kWebSocket]) {
          throw new Error(
            "server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration"
          );
        }
        if (this._state > RUNNING) return abortHandshake(socket, 503);
        const digest = createHash("sha1").update(key + GUID).digest("base64");
        const headers = [
          "HTTP/1.1 101 Switching Protocols",
          "Upgrade: websocket",
          "Connection: Upgrade",
          `Sec-WebSocket-Accept: ${digest}`
        ];
        const ws = new this.options.WebSocket(null, void 0, this.options);
        if (protocols.size) {
          const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
          if (protocol) {
            headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
            ws._protocol = protocol;
          }
        }
        if (extensions[PerMessageDeflate.extensionName]) {
          const params = extensions[PerMessageDeflate.extensionName].params;
          const value = extension.format({
            [PerMessageDeflate.extensionName]: [params]
          });
          headers.push(`Sec-WebSocket-Extensions: ${value}`);
          ws._extensions = extensions;
        }
        this.emit("headers", headers, req);
        socket.write(headers.concat("\r\n").join("\r\n"));
        socket.removeListener("error", socketOnError);
        ws.setSocket(socket, head, {
          allowSynchronousEvents: this.options.allowSynchronousEvents,
          maxPayload: this.options.maxPayload,
          skipUTF8Validation: this.options.skipUTF8Validation
        });
        if (this.clients) {
          this.clients.add(ws);
          ws.on("close", () => {
            this.clients.delete(ws);
            if (this._shouldEmitClose && !this.clients.size) {
              process.nextTick(emitClose, this);
            }
          });
        }
        cb(ws, req);
      }
    };
    module2.exports = WebSocketServer3;
    function addListeners(server, map) {
      for (const event of Object.keys(map)) server.on(event, map[event]);
      return function removeListeners() {
        for (const event of Object.keys(map)) {
          server.removeListener(event, map[event]);
        }
      };
    }
    function emitClose(server) {
      server._state = CLOSED;
      server.emit("close");
    }
    function socketOnError() {
      this.destroy();
    }
    function abortHandshake(socket, code, message, headers) {
      message = message || http.STATUS_CODES[code];
      headers = {
        Connection: "close",
        "Content-Type": "text/html",
        "Content-Length": Buffer.byteLength(message),
        ...headers
      };
      socket.once("finish", socket.destroy);
      socket.end(
        `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
` + Object.keys(headers).map((h3) => `${h3}: ${headers[h3]}`).join("\r\n") + "\r\n\r\n" + message
      );
    }
    function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) {
      if (server.listenerCount("wsClientError")) {
        const err = new Error(message);
        Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
        server.emit("wsClientError", err, socket, req);
      } else {
        abortHandshake(socket, code, message, headers);
      }
    }
  }
});

// ../../../packages/common/dist/index.js
var dist_exports = {};
__export(dist_exports, {
  ConsoleLogger: () => ConsoleLogger,
  LoggerFactoryImpl: () => LoggerFactoryImpl,
  createLogger: () => createLogger,
  setLoggerFactory: () => setLoggerFactory
});
function setLoggerFactory(factory) {
  externalFactory = factory;
  LoggerFactoryImpl.reset();
  externalFactory = factory;
}
function createLogger(name) {
  return LoggerFactoryImpl.getLogger(name);
}
var ConsoleLogger, externalFactory, factoryVersion, LoggerFactoryImpl;
var init_dist = __esm({
  "../../../packages/common/dist/index.js"() {
    ConsoleLogger = class _ConsoleLogger {
      name;
      level;
      colors;
      timestamps;
      static COLORS = {
        DEBUG: "\x1B[36m",
        INFO: "\x1B[32m",
        WARN: "\x1B[33m",
        ERROR: "\x1B[31m",
        RESET: "\x1B[0m"
      };
      constructor(name, options = {}) {
        this.name = name;
        this.level = options.level ?? "info";
        this.colors = options.colors ?? this.isNodeEnvironment();
        this.timestamps = options.timestamps ?? true;
      }
      debug(message, context) {
        if (this.isDebugEnabled()) {
          this.log("DEBUG", message, context);
        }
      }
      info(message, context) {
        if (this.isInfoEnabled()) {
          this.log("INFO", message, context);
        }
      }
      warn(message, context) {
        if (this.isWarnEnabled()) {
          this.log("WARN", message, context);
        }
      }
      error(message, context) {
        if (this.isErrorEnabled()) {
          if (message instanceof Error) {
            this.log("ERROR", message.message, { ...context, stack: message.stack });
          } else {
            this.log("ERROR", message, context);
          }
        }
      }
      isDebugEnabled() {
        return this.getLevelValue(this.level) <= this.getLevelValue("debug");
      }
      isInfoEnabled() {
        return this.getLevelValue(this.level) <= this.getLevelValue("info");
      }
      isWarnEnabled() {
        return this.getLevelValue(this.level) <= this.getLevelValue("warn");
      }
      isErrorEnabled() {
        return this.getLevelValue(this.level) <= this.getLevelValue("error");
      }
      getLevelValue(level) {
        const levels = {
          debug: 0,
          info: 1,
          warn: 2,
          error: 3,
          silent: 4
        };
        return levels[level];
      }
      log(level, message, context) {
        const parts = [];
        if (this.timestamps) {
          parts.push((/* @__PURE__ */ new Date()).toISOString());
        }
        if (this.colors) {
          const color = _ConsoleLogger.COLORS[level];
          parts.push(`${color}${level.padEnd(5)}${_ConsoleLogger.COLORS.RESET}`);
        } else {
          parts.push(level.padEnd(5));
        }
        parts.push(`[${this.name}]`);
        parts.push(message);
        const logLine = parts.join(" ");
        const consoleMethod = this.getConsoleMethod(level);
        if (context && Object.keys(context).length > 0) {
          consoleMethod(logLine, context);
        } else {
          consoleMethod(logLine);
        }
      }
      getConsoleMethod(level) {
        switch (level) {
          case "DEBUG":
            return console.debug.bind(console);
          case "INFO":
            return console.info.bind(console);
          case "WARN":
            return console.warn.bind(console);
          case "ERROR":
            return console.error.bind(console);
          default:
            return console.log.bind(console);
        }
      }
      isNodeEnvironment() {
        return typeof process !== "undefined" && process.versions?.node !== void 0;
      }
    };
    externalFactory = null;
    factoryVersion = 0;
    LoggerFactoryImpl = class {
      static loggers = /* @__PURE__ */ new Map();
      static config = {
        defaultLevel: "info"
      };
      static getLogger(nameOrClass) {
        const name = typeof nameOrClass === "string" ? nameOrClass : nameOrClass.name;
        if (this.loggers.has(name)) {
          return this.loggers.get(name);
        }
        const lazyLogger = this.createLazyLogger(name);
        this.loggers.set(name, lazyLogger);
        return lazyLogger;
      }
      static configure(config) {
        this.config = { ...this.config, ...config };
      }
      static reset() {
        this.loggers.clear();
        this.config = { defaultLevel: "info" };
        externalFactory = null;
        factoryVersion++;
      }
      static createLazyLogger(name) {
        let realLogger = null;
        let loggerVersion = -1;
        const getRealLogger = () => {
          if (!realLogger || loggerVersion !== factoryVersion) {
            realLogger = this.createLogger(name);
            loggerVersion = factoryVersion;
          }
          return realLogger;
        };
        return {
          name,
          level: this.config.defaultLevel || "info",
          debug: (message, context) => getRealLogger().debug(message, context),
          info: (message, context) => getRealLogger().info(message, context),
          warn: (message, context) => getRealLogger().warn(message, context),
          error: (message, context) => getRealLogger().error(message, context),
          isDebugEnabled: () => getRealLogger().isDebugEnabled(),
          isInfoEnabled: () => getRealLogger().isInfoEnabled(),
          isWarnEnabled: () => getRealLogger().isWarnEnabled(),
          isErrorEnabled: () => getRealLogger().isErrorEnabled()
        };
      }
      static createLogger(name) {
        if (externalFactory) {
          return externalFactory.getLogger(name);
        }
        if (this.config.defaultImplementation) {
          return this.config.defaultImplementation(name);
        }
        return new ConsoleLogger(name, {
          level: this.config.defaultLevel,
          ...this.config.consoleOptions
        });
      }
    };
  }
});

// ../../../node_modules/.pnpm/reconnecting-websocket@4.4.0/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js
var require_reconnecting_websocket_cjs = __commonJS({
  "../../../node_modules/.pnpm/reconnecting-websocket@4.4.0/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js"(exports2, module2) {
    "use strict";
    var extendStatics = function(d3, b3) {
      extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
        d5.__proto__ = b5;
      } || function(d5, b5) {
        for (var p in b5) if (b5.hasOwnProperty(p)) d5[p] = b5[p];
      };
      return extendStatics(d3, b3);
    };
    function __extends(d3, b3) {
      extendStatics(d3, b3);
      function __() {
        this.constructor = d3;
      }
      d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
    }
    function __values(o) {
      var m = typeof Symbol === "function" && o[Symbol.iterator], i3 = 0;
      if (m) return m.call(o);
      return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
    }
    function __read(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    }
    function __spread() {
      for (var ar = [], i3 = 0; i3 < arguments.length; i3++)
        ar = ar.concat(__read(arguments[i3]));
      return ar;
    }
    var Event = (
      /** @class */
      /* @__PURE__ */ function() {
        function Event2(type, target) {
          this.target = target;
          this.type = type;
        }
        return Event2;
      }()
    );
    var ErrorEvent = (
      /** @class */
      function(_super) {
        __extends(ErrorEvent2, _super);
        function ErrorEvent2(error, target) {
          var _this = _super.call(this, "error", target) || this;
          _this.message = error.message;
          _this.error = error;
          return _this;
        }
        return ErrorEvent2;
      }(Event)
    );
    var CloseEvent = (
      /** @class */
      function(_super) {
        __extends(CloseEvent2, _super);
        function CloseEvent2(code, reason, target) {
          if (code === void 0) {
            code = 1e3;
          }
          if (reason === void 0) {
            reason = "";
          }
          var _this = _super.call(this, "close", target) || this;
          _this.wasClean = true;
          _this.code = code;
          _this.reason = reason;
          return _this;
        }
        return CloseEvent2;
      }(Event)
    );
    var getGlobalWebSocket = function() {
      if (typeof WebSocket !== "undefined") {
        return WebSocket;
      }
    };
    var isWebSocket = function(w5) {
      return typeof w5 !== "undefined" && !!w5 && w5.CLOSING === 2;
    };
    var DEFAULT = {
      maxReconnectionDelay: 1e4,
      minReconnectionDelay: 1e3 + Math.random() * 4e3,
      minUptime: 5e3,
      reconnectionDelayGrowFactor: 1.3,
      connectionTimeout: 4e3,
      maxRetries: Infinity,
      maxEnqueuedMessages: Infinity,
      startClosed: false,
      debug: false
    };
    var ReconnectingWebSocket2 = (
      /** @class */
      function() {
        function ReconnectingWebSocket3(url, protocols, options) {
          var _this = this;
          if (options === void 0) {
            options = {};
          }
          this._listeners = {
            error: [],
            message: [],
            open: [],
            close: []
          };
          this._retryCount = -1;
          this._shouldReconnect = true;
          this._connectLock = false;
          this._binaryType = "blob";
          this._closeCalled = false;
          this._messageQueue = [];
          this.onclose = null;
          this.onerror = null;
          this.onmessage = null;
          this.onopen = null;
          this._handleOpen = function(event) {
            _this._debug("open event");
            var _a = _this._options.minUptime, minUptime = _a === void 0 ? DEFAULT.minUptime : _a;
            clearTimeout(_this._connectTimeout);
            _this._uptimeTimeout = setTimeout(function() {
              return _this._acceptOpen();
            }, minUptime);
            _this._ws.binaryType = _this._binaryType;
            _this._messageQueue.forEach(function(message) {
              return _this._ws.send(message);
            });
            _this._messageQueue = [];
            if (_this.onopen) {
              _this.onopen(event);
            }
            _this._listeners.open.forEach(function(listener) {
              return _this._callEventListener(event, listener);
            });
          };
          this._handleMessage = function(event) {
            _this._debug("message event");
            if (_this.onmessage) {
              _this.onmessage(event);
            }
            _this._listeners.message.forEach(function(listener) {
              return _this._callEventListener(event, listener);
            });
          };
          this._handleError = function(event) {
            _this._debug("error event", event.message);
            _this._disconnect(void 0, event.message === "TIMEOUT" ? "timeout" : void 0);
            if (_this.onerror) {
              _this.onerror(event);
            }
            _this._debug("exec error listeners");
            _this._listeners.error.forEach(function(listener) {
              return _this._callEventListener(event, listener);
            });
            _this._connect();
          };
          this._handleClose = function(event) {
            _this._debug("close event");
            _this._clearTimeouts();
            if (_this._shouldReconnect) {
              _this._connect();
            }
            if (_this.onclose) {
              _this.onclose(event);
            }
            _this._listeners.close.forEach(function(listener) {
              return _this._callEventListener(event, listener);
            });
          };
          this._url = url;
          this._protocols = protocols;
          this._options = options;
          if (this._options.startClosed) {
            this._shouldReconnect = false;
          }
          this._connect();
        }
        Object.defineProperty(ReconnectingWebSocket3, "CONNECTING", {
          get: function() {
            return 0;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3, "OPEN", {
          get: function() {
            return 1;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3, "CLOSING", {
          get: function() {
            return 2;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3, "CLOSED", {
          get: function() {
            return 3;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "CONNECTING", {
          get: function() {
            return ReconnectingWebSocket3.CONNECTING;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "OPEN", {
          get: function() {
            return ReconnectingWebSocket3.OPEN;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "CLOSING", {
          get: function() {
            return ReconnectingWebSocket3.CLOSING;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "CLOSED", {
          get: function() {
            return ReconnectingWebSocket3.CLOSED;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "binaryType", {
          get: function() {
            return this._ws ? this._ws.binaryType : this._binaryType;
          },
          set: function(value) {
            this._binaryType = value;
            if (this._ws) {
              this._ws.binaryType = value;
            }
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "retryCount", {
          /**
           * Returns the number or connection retries
           */
          get: function() {
            return Math.max(this._retryCount, 0);
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "bufferedAmount", {
          /**
           * The number of bytes of data that have been queued using calls to send() but not yet
           * transmitted to the network. This value resets to zero once all queued data has been sent.
           * This value does not reset to zero when the connection is closed; if you keep calling send(),
           * this will continue to climb. Read only
           */
          get: function() {
            var bytes = this._messageQueue.reduce(function(acc, message) {
              if (typeof message === "string") {
                acc += message.length;
              } else if (message instanceof Blob) {
                acc += message.size;
              } else {
                acc += message.byteLength;
              }
              return acc;
            }, 0);
            return bytes + (this._ws ? this._ws.bufferedAmount : 0);
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "extensions", {
          /**
           * The extensions selected by the server. This is currently only the empty string or a list of
           * extensions as negotiated by the connection
           */
          get: function() {
            return this._ws ? this._ws.extensions : "";
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "protocol", {
          /**
           * A string indicating the name of the sub-protocol the server selected;
           * this will be one of the strings specified in the protocols parameter when creating the
           * WebSocket object
           */
          get: function() {
            return this._ws ? this._ws.protocol : "";
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "readyState", {
          /**
           * The current state of the connection; this is one of the Ready state constants
           */
          get: function() {
            if (this._ws) {
              return this._ws.readyState;
            }
            return this._options.startClosed ? ReconnectingWebSocket3.CLOSED : ReconnectingWebSocket3.CONNECTING;
          },
          enumerable: true,
          configurable: true
        });
        Object.defineProperty(ReconnectingWebSocket3.prototype, "url", {
          /**
           * The URL as resolved by the constructor
           */
          get: function() {
            return this._ws ? this._ws.url : "";
          },
          enumerable: true,
          configurable: true
        });
        ReconnectingWebSocket3.prototype.close = function(code, reason) {
          if (code === void 0) {
            code = 1e3;
          }
          this._closeCalled = true;
          this._shouldReconnect = false;
          this._clearTimeouts();
          if (!this._ws) {
            this._debug("close enqueued: no ws instance");
            return;
          }
          if (this._ws.readyState === this.CLOSED) {
            this._debug("close: already closed");
            return;
          }
          this._ws.close(code, reason);
        };
        ReconnectingWebSocket3.prototype.reconnect = function(code, reason) {
          this._shouldReconnect = true;
          this._closeCalled = false;
          this._retryCount = -1;
          if (!this._ws || this._ws.readyState === this.CLOSED) {
            this._connect();
          } else {
            this._disconnect(code, reason);
            this._connect();
          }
        };
        ReconnectingWebSocket3.prototype.send = function(data) {
          if (this._ws && this._ws.readyState === this.OPEN) {
            this._debug("send", data);
            this._ws.send(data);
          } else {
            var _a = this._options.maxEnqueuedMessages, maxEnqueuedMessages = _a === void 0 ? DEFAULT.maxEnqueuedMessages : _a;
            if (this._messageQueue.length < maxEnqueuedMessages) {
              this._debug("enqueue", data);
              this._messageQueue.push(data);
            }
          }
        };
        ReconnectingWebSocket3.prototype.addEventListener = function(type, listener) {
          if (this._listeners[type]) {
            this._listeners[type].push(listener);
          }
        };
        ReconnectingWebSocket3.prototype.dispatchEvent = function(event) {
          var e_1, _a;
          var listeners = this._listeners[event.type];
          if (listeners) {
            try {
              for (var listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {
                var listener = listeners_1_1.value;
                this._callEventListener(event, listener);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (listeners_1_1 && !listeners_1_1.done && (_a = listeners_1.return)) _a.call(listeners_1);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
          return true;
        };
        ReconnectingWebSocket3.prototype.removeEventListener = function(type, listener) {
          if (this._listeners[type]) {
            this._listeners[type] = this._listeners[type].filter(function(l3) {
              return l3 !== listener;
            });
          }
        };
        ReconnectingWebSocket3.prototype._debug = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (this._options.debug) {
            console.log.apply(console, __spread(["RWS>"], args));
          }
        };
        ReconnectingWebSocket3.prototype._getNextDelay = function() {
          var _a = this._options, _b = _a.reconnectionDelayGrowFactor, reconnectionDelayGrowFactor = _b === void 0 ? DEFAULT.reconnectionDelayGrowFactor : _b, _c = _a.minReconnectionDelay, minReconnectionDelay = _c === void 0 ? DEFAULT.minReconnectionDelay : _c, _d = _a.maxReconnectionDelay, maxReconnectionDelay = _d === void 0 ? DEFAULT.maxReconnectionDelay : _d;
          var delay = 0;
          if (this._retryCount > 0) {
            delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);
            if (delay > maxReconnectionDelay) {
              delay = maxReconnectionDelay;
            }
          }
          this._debug("next delay", delay);
          return delay;
        };
        ReconnectingWebSocket3.prototype._wait = function() {
          var _this = this;
          return new Promise(function(resolve4) {
            setTimeout(resolve4, _this._getNextDelay());
          });
        };
        ReconnectingWebSocket3.prototype._getNextUrl = function(urlProvider) {
          if (typeof urlProvider === "string") {
            return Promise.resolve(urlProvider);
          }
          if (typeof urlProvider === "function") {
            var url = urlProvider();
            if (typeof url === "string") {
              return Promise.resolve(url);
            }
            if (!!url.then) {
              return url;
            }
          }
          throw Error("Invalid URL");
        };
        ReconnectingWebSocket3.prototype._connect = function() {
          var _this = this;
          if (this._connectLock || !this._shouldReconnect) {
            return;
          }
          this._connectLock = true;
          var _a = this._options, _b = _a.maxRetries, maxRetries = _b === void 0 ? DEFAULT.maxRetries : _b, _c = _a.connectionTimeout, connectionTimeout = _c === void 0 ? DEFAULT.connectionTimeout : _c, _d = _a.WebSocket, WebSocket3 = _d === void 0 ? getGlobalWebSocket() : _d;
          if (this._retryCount >= maxRetries) {
            this._debug("max retries reached", this._retryCount, ">=", maxRetries);
            return;
          }
          this._retryCount++;
          this._debug("connect", this._retryCount);
          this._removeListeners();
          if (!isWebSocket(WebSocket3)) {
            throw Error("No valid WebSocket class provided");
          }
          this._wait().then(function() {
            return _this._getNextUrl(_this._url);
          }).then(function(url) {
            if (_this._closeCalled) {
              return;
            }
            _this._debug("connect", { url, protocols: _this._protocols });
            _this._ws = _this._protocols ? new WebSocket3(url, _this._protocols) : new WebSocket3(url);
            _this._ws.binaryType = _this._binaryType;
            _this._connectLock = false;
            _this._addListeners();
            _this._connectTimeout = setTimeout(function() {
              return _this._handleTimeout();
            }, connectionTimeout);
          });
        };
        ReconnectingWebSocket3.prototype._handleTimeout = function() {
          this._debug("timeout event");
          this._handleError(new ErrorEvent(Error("TIMEOUT"), this));
        };
        ReconnectingWebSocket3.prototype._disconnect = function(code, reason) {
          if (code === void 0) {
            code = 1e3;
          }
          this._clearTimeouts();
          if (!this._ws) {
            return;
          }
          this._removeListeners();
          try {
            this._ws.close(code, reason);
            this._handleClose(new CloseEvent(code, reason, this));
          } catch (error) {
          }
        };
        ReconnectingWebSocket3.prototype._acceptOpen = function() {
          this._debug("accept open");
          this._retryCount = 0;
        };
        ReconnectingWebSocket3.prototype._callEventListener = function(event, listener) {
          if ("handleEvent" in listener) {
            listener.handleEvent(event);
          } else {
            listener(event);
          }
        };
        ReconnectingWebSocket3.prototype._removeListeners = function() {
          if (!this._ws) {
            return;
          }
          this._debug("removeListeners");
          this._ws.removeEventListener("open", this._handleOpen);
          this._ws.removeEventListener("close", this._handleClose);
          this._ws.removeEventListener("message", this._handleMessage);
          this._ws.removeEventListener("error", this._handleError);
        };
        ReconnectingWebSocket3.prototype._addListeners = function() {
          if (!this._ws) {
            return;
          }
          this._debug("addListeners");
          this._ws.addEventListener("open", this._handleOpen);
          this._ws.addEventListener("close", this._handleClose);
          this._ws.addEventListener("message", this._handleMessage);
          this._ws.addEventListener("error", this._handleError);
        };
        ReconnectingWebSocket3.prototype._clearTimeouts = function() {
          clearTimeout(this._connectTimeout);
          clearTimeout(this._uptimeTimeout);
        };
        return ReconnectingWebSocket3;
      }()
    );
    module2.exports = ReconnectingWebSocket2;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isFunction.js
var require_isFunction = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isFunction.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isFunction = void 0;
    function isFunction(value) {
      return typeof value === "function";
    }
    exports2.isFunction = isFunction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js
var require_createErrorClass = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createErrorClass = void 0;
    function createErrorClass(createImpl) {
      var _super = function(instance) {
        Error.call(instance);
        instance.stack = new Error().stack;
      };
      var ctorFunc = createImpl(_super);
      ctorFunc.prototype = Object.create(Error.prototype);
      ctorFunc.prototype.constructor = ctorFunc;
      return ctorFunc;
    }
    exports2.createErrorClass = createErrorClass;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js
var require_UnsubscriptionError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.UnsubscriptionError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.UnsubscriptionError = createErrorClass_1.createErrorClass(function(_super) {
      return function UnsubscriptionErrorImpl(errors) {
        _super(this);
        this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i3) {
          return i3 + 1 + ") " + err.toString();
        }).join("\n  ") : "";
        this.name = "UnsubscriptionError";
        this.errors = errors;
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/arrRemove.js
var require_arrRemove = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/arrRemove.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.arrRemove = void 0;
    function arrRemove(arr, item) {
      if (arr) {
        var index = arr.indexOf(item);
        0 <= index && arr.splice(index, 1);
      }
    }
    exports2.arrRemove = arrRemove;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subscription.js
var require_Subscription = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subscription.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isSubscription = exports2.EMPTY_SUBSCRIPTION = exports2.Subscription = void 0;
    var isFunction_1 = require_isFunction();
    var UnsubscriptionError_1 = require_UnsubscriptionError();
    var arrRemove_1 = require_arrRemove();
    var Subscription = function() {
      function Subscription2(initialTeardown) {
        this.initialTeardown = initialTeardown;
        this.closed = false;
        this._parentage = null;
        this._finalizers = null;
      }
      Subscription2.prototype.unsubscribe = function() {
        var e_1, _a, e_2, _b;
        var errors;
        if (!this.closed) {
          this.closed = true;
          var _parentage = this._parentage;
          if (_parentage) {
            this._parentage = null;
            if (Array.isArray(_parentage)) {
              try {
                for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
                  var parent_1 = _parentage_1_1.value;
                  parent_1.remove(this);
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
                } finally {
                  if (e_1) throw e_1.error;
                }
              }
            } else {
              _parentage.remove(this);
            }
          }
          var initialFinalizer = this.initialTeardown;
          if (isFunction_1.isFunction(initialFinalizer)) {
            try {
              initialFinalizer();
            } catch (e3) {
              errors = e3 instanceof UnsubscriptionError_1.UnsubscriptionError ? e3.errors : [e3];
            }
          }
          var _finalizers = this._finalizers;
          if (_finalizers) {
            this._finalizers = null;
            try {
              for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
                var finalizer = _finalizers_1_1.value;
                try {
                  execFinalizer(finalizer);
                } catch (err) {
                  errors = errors !== null && errors !== void 0 ? errors : [];
                  if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
                    errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
                  } else {
                    errors.push(err);
                  }
                }
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
          if (errors) {
            throw new UnsubscriptionError_1.UnsubscriptionError(errors);
          }
        }
      };
      Subscription2.prototype.add = function(teardown) {
        var _a;
        if (teardown && teardown !== this) {
          if (this.closed) {
            execFinalizer(teardown);
          } else {
            if (teardown instanceof Subscription2) {
              if (teardown.closed || teardown._hasParent(this)) {
                return;
              }
              teardown._addParent(this);
            }
            (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
          }
        }
      };
      Subscription2.prototype._hasParent = function(parent) {
        var _parentage = this._parentage;
        return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
      };
      Subscription2.prototype._addParent = function(parent) {
        var _parentage = this._parentage;
        this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
      };
      Subscription2.prototype._removeParent = function(parent) {
        var _parentage = this._parentage;
        if (_parentage === parent) {
          this._parentage = null;
        } else if (Array.isArray(_parentage)) {
          arrRemove_1.arrRemove(_parentage, parent);
        }
      };
      Subscription2.prototype.remove = function(teardown) {
        var _finalizers = this._finalizers;
        _finalizers && arrRemove_1.arrRemove(_finalizers, teardown);
        if (teardown instanceof Subscription2) {
          teardown._removeParent(this);
        }
      };
      Subscription2.EMPTY = function() {
        var empty = new Subscription2();
        empty.closed = true;
        return empty;
      }();
      return Subscription2;
    }();
    exports2.Subscription = Subscription;
    exports2.EMPTY_SUBSCRIPTION = Subscription.EMPTY;
    function isSubscription(value) {
      return value instanceof Subscription || value && "closed" in value && isFunction_1.isFunction(value.remove) && isFunction_1.isFunction(value.add) && isFunction_1.isFunction(value.unsubscribe);
    }
    exports2.isSubscription = isSubscription;
    function execFinalizer(finalizer) {
      if (isFunction_1.isFunction(finalizer)) {
        finalizer();
      } else {
        finalizer.unsubscribe();
      }
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/config.js
var require_config = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/config.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.config = void 0;
    exports2.config = {
      onUnhandledError: null,
      onStoppedNotification: null,
      Promise: void 0,
      useDeprecatedSynchronousErrorHandling: false,
      useDeprecatedNextContext: false
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js
var require_timeoutProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.timeoutProvider = void 0;
    exports2.timeoutProvider = {
      setTimeout: function(handler, timeout) {
        var args = [];
        for (var _i = 2; _i < arguments.length; _i++) {
          args[_i - 2] = arguments[_i];
        }
        var delegate = exports2.timeoutProvider.delegate;
        if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
          return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
        }
        return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
      },
      clearTimeout: function(handle) {
        var delegate = exports2.timeoutProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js
var require_reportUnhandledError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.reportUnhandledError = void 0;
    var config_1 = require_config();
    var timeoutProvider_1 = require_timeoutProvider();
    function reportUnhandledError(err) {
      timeoutProvider_1.timeoutProvider.setTimeout(function() {
        var onUnhandledError = config_1.config.onUnhandledError;
        if (onUnhandledError) {
          onUnhandledError(err);
        } else {
          throw err;
        }
      });
    }
    exports2.reportUnhandledError = reportUnhandledError;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/noop.js
var require_noop = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/noop.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.noop = void 0;
    function noop() {
    }
    exports2.noop = noop;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/NotificationFactories.js
var require_NotificationFactories = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/NotificationFactories.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createNotification = exports2.nextNotification = exports2.errorNotification = exports2.COMPLETE_NOTIFICATION = void 0;
    exports2.COMPLETE_NOTIFICATION = function() {
      return createNotification("C", void 0, void 0);
    }();
    function errorNotification(error) {
      return createNotification("E", void 0, error);
    }
    exports2.errorNotification = errorNotification;
    function nextNotification(value) {
      return createNotification("N", value, void 0);
    }
    exports2.nextNotification = nextNotification;
    function createNotification(kind, value, error) {
      return {
        kind,
        value,
        error
      };
    }
    exports2.createNotification = createNotification;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/errorContext.js
var require_errorContext = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/errorContext.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.captureError = exports2.errorContext = void 0;
    var config_1 = require_config();
    var context = null;
    function errorContext(cb) {
      if (config_1.config.useDeprecatedSynchronousErrorHandling) {
        var isRoot = !context;
        if (isRoot) {
          context = { errorThrown: false, error: null };
        }
        cb();
        if (isRoot) {
          var _a = context, errorThrown = _a.errorThrown, error = _a.error;
          context = null;
          if (errorThrown) {
            throw error;
          }
        }
      } else {
        cb();
      }
    }
    exports2.errorContext = errorContext;
    function captureError(err) {
      if (config_1.config.useDeprecatedSynchronousErrorHandling && context) {
        context.errorThrown = true;
        context.error = err;
      }
    }
    exports2.captureError = captureError;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subscriber.js
var require_Subscriber = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subscriber.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.EMPTY_OBSERVER = exports2.SafeSubscriber = exports2.Subscriber = void 0;
    var isFunction_1 = require_isFunction();
    var Subscription_1 = require_Subscription();
    var config_1 = require_config();
    var reportUnhandledError_1 = require_reportUnhandledError();
    var noop_1 = require_noop();
    var NotificationFactories_1 = require_NotificationFactories();
    var timeoutProvider_1 = require_timeoutProvider();
    var errorContext_1 = require_errorContext();
    var Subscriber = function(_super) {
      __extends(Subscriber2, _super);
      function Subscriber2(destination) {
        var _this = _super.call(this) || this;
        _this.isStopped = false;
        if (destination) {
          _this.destination = destination;
          if (Subscription_1.isSubscription(destination)) {
            destination.add(_this);
          }
        } else {
          _this.destination = exports2.EMPTY_OBSERVER;
        }
        return _this;
      }
      Subscriber2.create = function(next, error, complete) {
        return new SafeSubscriber(next, error, complete);
      };
      Subscriber2.prototype.next = function(value) {
        if (this.isStopped) {
          handleStoppedNotification(NotificationFactories_1.nextNotification(value), this);
        } else {
          this._next(value);
        }
      };
      Subscriber2.prototype.error = function(err) {
        if (this.isStopped) {
          handleStoppedNotification(NotificationFactories_1.errorNotification(err), this);
        } else {
          this.isStopped = true;
          this._error(err);
        }
      };
      Subscriber2.prototype.complete = function() {
        if (this.isStopped) {
          handleStoppedNotification(NotificationFactories_1.COMPLETE_NOTIFICATION, this);
        } else {
          this.isStopped = true;
          this._complete();
        }
      };
      Subscriber2.prototype.unsubscribe = function() {
        if (!this.closed) {
          this.isStopped = true;
          _super.prototype.unsubscribe.call(this);
          this.destination = null;
        }
      };
      Subscriber2.prototype._next = function(value) {
        this.destination.next(value);
      };
      Subscriber2.prototype._error = function(err) {
        try {
          this.destination.error(err);
        } finally {
          this.unsubscribe();
        }
      };
      Subscriber2.prototype._complete = function() {
        try {
          this.destination.complete();
        } finally {
          this.unsubscribe();
        }
      };
      return Subscriber2;
    }(Subscription_1.Subscription);
    exports2.Subscriber = Subscriber;
    var _bind = Function.prototype.bind;
    function bind(fn, thisArg) {
      return _bind.call(fn, thisArg);
    }
    var ConsumerObserver = function() {
      function ConsumerObserver2(partialObserver) {
        this.partialObserver = partialObserver;
      }
      ConsumerObserver2.prototype.next = function(value) {
        var partialObserver = this.partialObserver;
        if (partialObserver.next) {
          try {
            partialObserver.next(value);
          } catch (error) {
            handleUnhandledError(error);
          }
        }
      };
      ConsumerObserver2.prototype.error = function(err) {
        var partialObserver = this.partialObserver;
        if (partialObserver.error) {
          try {
            partialObserver.error(err);
          } catch (error) {
            handleUnhandledError(error);
          }
        } else {
          handleUnhandledError(err);
        }
      };
      ConsumerObserver2.prototype.complete = function() {
        var partialObserver = this.partialObserver;
        if (partialObserver.complete) {
          try {
            partialObserver.complete();
          } catch (error) {
            handleUnhandledError(error);
          }
        }
      };
      return ConsumerObserver2;
    }();
    var SafeSubscriber = function(_super) {
      __extends(SafeSubscriber2, _super);
      function SafeSubscriber2(observerOrNext, error, complete) {
        var _this = _super.call(this) || this;
        var partialObserver;
        if (isFunction_1.isFunction(observerOrNext) || !observerOrNext) {
          partialObserver = {
            next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
            error: error !== null && error !== void 0 ? error : void 0,
            complete: complete !== null && complete !== void 0 ? complete : void 0
          };
        } else {
          var context_1;
          if (_this && config_1.config.useDeprecatedNextContext) {
            context_1 = Object.create(observerOrNext);
            context_1.unsubscribe = function() {
              return _this.unsubscribe();
            };
            partialObserver = {
              next: observerOrNext.next && bind(observerOrNext.next, context_1),
              error: observerOrNext.error && bind(observerOrNext.error, context_1),
              complete: observerOrNext.complete && bind(observerOrNext.complete, context_1)
            };
          } else {
            partialObserver = observerOrNext;
          }
        }
        _this.destination = new ConsumerObserver(partialObserver);
        return _this;
      }
      return SafeSubscriber2;
    }(Subscriber);
    exports2.SafeSubscriber = SafeSubscriber;
    function handleUnhandledError(error) {
      if (config_1.config.useDeprecatedSynchronousErrorHandling) {
        errorContext_1.captureError(error);
      } else {
        reportUnhandledError_1.reportUnhandledError(error);
      }
    }
    function defaultErrorHandler(err) {
      throw err;
    }
    function handleStoppedNotification(notification, subscriber) {
      var onStoppedNotification = config_1.config.onStoppedNotification;
      onStoppedNotification && timeoutProvider_1.timeoutProvider.setTimeout(function() {
        return onStoppedNotification(notification, subscriber);
      });
    }
    exports2.EMPTY_OBSERVER = {
      closed: true,
      next: noop_1.noop,
      error: defaultErrorHandler,
      complete: noop_1.noop
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/symbol/observable.js
var require_observable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/symbol/observable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.observable = void 0;
    exports2.observable = function() {
      return typeof Symbol === "function" && Symbol.observable || "@@observable";
    }();
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/identity.js
var require_identity = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/identity.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.identity = void 0;
    function identity(x3) {
      return x3;
    }
    exports2.identity = identity;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/pipe.js
var require_pipe = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/pipe.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.pipeFromArray = exports2.pipe = void 0;
    var identity_1 = require_identity();
    function pipe() {
      var fns = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        fns[_i] = arguments[_i];
      }
      return pipeFromArray(fns);
    }
    exports2.pipe = pipe;
    function pipeFromArray(fns) {
      if (fns.length === 0) {
        return identity_1.identity;
      }
      if (fns.length === 1) {
        return fns[0];
      }
      return function piped(input) {
        return fns.reduce(function(prev, fn) {
          return fn(prev);
        }, input);
      };
    }
    exports2.pipeFromArray = pipeFromArray;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Observable.js
var require_Observable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Observable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Observable = void 0;
    var Subscriber_1 = require_Subscriber();
    var Subscription_1 = require_Subscription();
    var observable_1 = require_observable();
    var pipe_1 = require_pipe();
    var config_1 = require_config();
    var isFunction_1 = require_isFunction();
    var errorContext_1 = require_errorContext();
    var Observable = function() {
      function Observable2(subscribe) {
        if (subscribe) {
          this._subscribe = subscribe;
        }
      }
      Observable2.prototype.lift = function(operator) {
        var observable = new Observable2();
        observable.source = this;
        observable.operator = operator;
        return observable;
      };
      Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
        var _this = this;
        var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new Subscriber_1.SafeSubscriber(observerOrNext, error, complete);
        errorContext_1.errorContext(function() {
          var _a = _this, operator = _a.operator, source = _a.source;
          subscriber.add(operator ? operator.call(subscriber, source) : source ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
        });
        return subscriber;
      };
      Observable2.prototype._trySubscribe = function(sink) {
        try {
          return this._subscribe(sink);
        } catch (err) {
          sink.error(err);
        }
      };
      Observable2.prototype.forEach = function(next, promiseCtor) {
        var _this = this;
        promiseCtor = getPromiseCtor(promiseCtor);
        return new promiseCtor(function(resolve4, reject) {
          var subscriber = new Subscriber_1.SafeSubscriber({
            next: function(value) {
              try {
                next(value);
              } catch (err) {
                reject(err);
                subscriber.unsubscribe();
              }
            },
            error: reject,
            complete: resolve4
          });
          _this.subscribe(subscriber);
        });
      };
      Observable2.prototype._subscribe = function(subscriber) {
        var _a;
        return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
      };
      Observable2.prototype[observable_1.observable] = function() {
        return this;
      };
      Observable2.prototype.pipe = function() {
        var operations = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          operations[_i] = arguments[_i];
        }
        return pipe_1.pipeFromArray(operations)(this);
      };
      Observable2.prototype.toPromise = function(promiseCtor) {
        var _this = this;
        promiseCtor = getPromiseCtor(promiseCtor);
        return new promiseCtor(function(resolve4, reject) {
          var value;
          _this.subscribe(function(x3) {
            return value = x3;
          }, function(err) {
            return reject(err);
          }, function() {
            return resolve4(value);
          });
        });
      };
      Observable2.create = function(subscribe) {
        return new Observable2(subscribe);
      };
      return Observable2;
    }();
    exports2.Observable = Observable;
    function getPromiseCtor(promiseCtor) {
      var _a;
      return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config_1.config.Promise) !== null && _a !== void 0 ? _a : Promise;
    }
    function isObserver(value) {
      return value && isFunction_1.isFunction(value.next) && isFunction_1.isFunction(value.error) && isFunction_1.isFunction(value.complete);
    }
    function isSubscriber(value) {
      return value && value instanceof Subscriber_1.Subscriber || isObserver(value) && Subscription_1.isSubscription(value);
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/lift.js
var require_lift = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/lift.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.operate = exports2.hasLift = void 0;
    var isFunction_1 = require_isFunction();
    function hasLift(source) {
      return isFunction_1.isFunction(source === null || source === void 0 ? void 0 : source.lift);
    }
    exports2.hasLift = hasLift;
    function operate(init) {
      return function(source) {
        if (hasLift(source)) {
          return source.lift(function(liftedSource) {
            try {
              return init(liftedSource, this);
            } catch (err) {
              this.error(err);
            }
          });
        }
        throw new TypeError("Unable to lift unknown Observable type");
      };
    }
    exports2.operate = operate;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js
var require_OperatorSubscriber = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.OperatorSubscriber = exports2.createOperatorSubscriber = void 0;
    var Subscriber_1 = require_Subscriber();
    function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
      return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
    }
    exports2.createOperatorSubscriber = createOperatorSubscriber;
    var OperatorSubscriber = function(_super) {
      __extends(OperatorSubscriber2, _super);
      function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
        var _this = _super.call(this, destination) || this;
        _this.onFinalize = onFinalize;
        _this.shouldUnsubscribe = shouldUnsubscribe;
        _this._next = onNext ? function(value) {
          try {
            onNext(value);
          } catch (err) {
            destination.error(err);
          }
        } : _super.prototype._next;
        _this._error = onError ? function(err) {
          try {
            onError(err);
          } catch (err2) {
            destination.error(err2);
          } finally {
            this.unsubscribe();
          }
        } : _super.prototype._error;
        _this._complete = onComplete ? function() {
          try {
            onComplete();
          } catch (err) {
            destination.error(err);
          } finally {
            this.unsubscribe();
          }
        } : _super.prototype._complete;
        return _this;
      }
      OperatorSubscriber2.prototype.unsubscribe = function() {
        var _a;
        if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
          var closed_1 = this.closed;
          _super.prototype.unsubscribe.call(this);
          !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
        }
      };
      return OperatorSubscriber2;
    }(Subscriber_1.Subscriber);
    exports2.OperatorSubscriber = OperatorSubscriber;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/refCount.js
var require_refCount = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/refCount.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.refCount = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function refCount() {
      return lift_1.operate(function(source, subscriber) {
        var connection = null;
        source._refCount++;
        var refCounter = OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, void 0, function() {
          if (!source || source._refCount <= 0 || 0 < --source._refCount) {
            connection = null;
            return;
          }
          var sharedConnection = source._connection;
          var conn = connection;
          connection = null;
          if (sharedConnection && (!conn || sharedConnection === conn)) {
            sharedConnection.unsubscribe();
          }
          subscriber.unsubscribe();
        });
        source.subscribe(refCounter);
        if (!refCounter.closed) {
          connection = source.connect();
        }
      });
    }
    exports2.refCount = refCount;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js
var require_ConnectableObservable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ConnectableObservable = void 0;
    var Observable_1 = require_Observable();
    var Subscription_1 = require_Subscription();
    var refCount_1 = require_refCount();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var lift_1 = require_lift();
    var ConnectableObservable = function(_super) {
      __extends(ConnectableObservable2, _super);
      function ConnectableObservable2(source, subjectFactory) {
        var _this = _super.call(this) || this;
        _this.source = source;
        _this.subjectFactory = subjectFactory;
        _this._subject = null;
        _this._refCount = 0;
        _this._connection = null;
        if (lift_1.hasLift(source)) {
          _this.lift = source.lift;
        }
        return _this;
      }
      ConnectableObservable2.prototype._subscribe = function(subscriber) {
        return this.getSubject().subscribe(subscriber);
      };
      ConnectableObservable2.prototype.getSubject = function() {
        var subject = this._subject;
        if (!subject || subject.isStopped) {
          this._subject = this.subjectFactory();
        }
        return this._subject;
      };
      ConnectableObservable2.prototype._teardown = function() {
        this._refCount = 0;
        var _connection = this._connection;
        this._subject = this._connection = null;
        _connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();
      };
      ConnectableObservable2.prototype.connect = function() {
        var _this = this;
        var connection = this._connection;
        if (!connection) {
          connection = this._connection = new Subscription_1.Subscription();
          var subject_1 = this.getSubject();
          connection.add(this.source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subject_1, void 0, function() {
            _this._teardown();
            subject_1.complete();
          }, function(err) {
            _this._teardown();
            subject_1.error(err);
          }, function() {
            return _this._teardown();
          })));
          if (connection.closed) {
            this._connection = null;
            connection = Subscription_1.Subscription.EMPTY;
          }
        }
        return connection;
      };
      ConnectableObservable2.prototype.refCount = function() {
        return refCount_1.refCount()(this);
      };
      return ConnectableObservable2;
    }(Observable_1.Observable);
    exports2.ConnectableObservable = ConnectableObservable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js
var require_performanceTimestampProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.performanceTimestampProvider = void 0;
    exports2.performanceTimestampProvider = {
      now: function() {
        return (exports2.performanceTimestampProvider.delegate || performance).now();
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js
var require_animationFrameProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.animationFrameProvider = void 0;
    var Subscription_1 = require_Subscription();
    exports2.animationFrameProvider = {
      schedule: function(callback) {
        var request = requestAnimationFrame;
        var cancel = cancelAnimationFrame;
        var delegate = exports2.animationFrameProvider.delegate;
        if (delegate) {
          request = delegate.requestAnimationFrame;
          cancel = delegate.cancelAnimationFrame;
        }
        var handle = request(function(timestamp) {
          cancel = void 0;
          callback(timestamp);
        });
        return new Subscription_1.Subscription(function() {
          return cancel === null || cancel === void 0 ? void 0 : cancel(handle);
        });
      },
      requestAnimationFrame: function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var delegate = exports2.animationFrameProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame).apply(void 0, __spreadArray([], __read(args)));
      },
      cancelAnimationFrame: function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var delegate = exports2.animationFrameProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame).apply(void 0, __spreadArray([], __read(args)));
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js
var require_animationFrames = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.animationFrames = void 0;
    var Observable_1 = require_Observable();
    var performanceTimestampProvider_1 = require_performanceTimestampProvider();
    var animationFrameProvider_1 = require_animationFrameProvider();
    function animationFrames(timestampProvider) {
      return timestampProvider ? animationFramesFactory(timestampProvider) : DEFAULT_ANIMATION_FRAMES;
    }
    exports2.animationFrames = animationFrames;
    function animationFramesFactory(timestampProvider) {
      return new Observable_1.Observable(function(subscriber) {
        var provider = timestampProvider || performanceTimestampProvider_1.performanceTimestampProvider;
        var start = provider.now();
        var id = 0;
        var run = function() {
          if (!subscriber.closed) {
            id = animationFrameProvider_1.animationFrameProvider.requestAnimationFrame(function(timestamp) {
              id = 0;
              var now = provider.now();
              subscriber.next({
                timestamp: timestampProvider ? now : timestamp,
                elapsed: now - start
              });
              run();
            });
          }
        };
        run();
        return function() {
          if (id) {
            animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
          }
        };
      });
    }
    var DEFAULT_ANIMATION_FRAMES = animationFramesFactory();
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js
var require_ObjectUnsubscribedError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ObjectUnsubscribedError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.ObjectUnsubscribedError = createErrorClass_1.createErrorClass(function(_super) {
      return function ObjectUnsubscribedErrorImpl() {
        _super(this);
        this.name = "ObjectUnsubscribedError";
        this.message = "object unsubscribed";
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subject.js
var require_Subject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Subject.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AnonymousSubject = exports2.Subject = void 0;
    var Observable_1 = require_Observable();
    var Subscription_1 = require_Subscription();
    var ObjectUnsubscribedError_1 = require_ObjectUnsubscribedError();
    var arrRemove_1 = require_arrRemove();
    var errorContext_1 = require_errorContext();
    var Subject3 = function(_super) {
      __extends(Subject4, _super);
      function Subject4() {
        var _this = _super.call(this) || this;
        _this.closed = false;
        _this.currentObservers = null;
        _this.observers = [];
        _this.isStopped = false;
        _this.hasError = false;
        _this.thrownError = null;
        return _this;
      }
      Subject4.prototype.lift = function(operator) {
        var subject = new AnonymousSubject(this, this);
        subject.operator = operator;
        return subject;
      };
      Subject4.prototype._throwIfClosed = function() {
        if (this.closed) {
          throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
        }
      };
      Subject4.prototype.next = function(value) {
        var _this = this;
        errorContext_1.errorContext(function() {
          var e_1, _a;
          _this._throwIfClosed();
          if (!_this.isStopped) {
            if (!_this.currentObservers) {
              _this.currentObservers = Array.from(_this.observers);
            }
            try {
              for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
                var observer = _c.value;
                observer.next(value);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
          }
        });
      };
      Subject4.prototype.error = function(err) {
        var _this = this;
        errorContext_1.errorContext(function() {
          _this._throwIfClosed();
          if (!_this.isStopped) {
            _this.hasError = _this.isStopped = true;
            _this.thrownError = err;
            var observers = _this.observers;
            while (observers.length) {
              observers.shift().error(err);
            }
          }
        });
      };
      Subject4.prototype.complete = function() {
        var _this = this;
        errorContext_1.errorContext(function() {
          _this._throwIfClosed();
          if (!_this.isStopped) {
            _this.isStopped = true;
            var observers = _this.observers;
            while (observers.length) {
              observers.shift().complete();
            }
          }
        });
      };
      Subject4.prototype.unsubscribe = function() {
        this.isStopped = this.closed = true;
        this.observers = this.currentObservers = null;
      };
      Object.defineProperty(Subject4.prototype, "observed", {
        get: function() {
          var _a;
          return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
        },
        enumerable: false,
        configurable: true
      });
      Subject4.prototype._trySubscribe = function(subscriber) {
        this._throwIfClosed();
        return _super.prototype._trySubscribe.call(this, subscriber);
      };
      Subject4.prototype._subscribe = function(subscriber) {
        this._throwIfClosed();
        this._checkFinalizedStatuses(subscriber);
        return this._innerSubscribe(subscriber);
      };
      Subject4.prototype._innerSubscribe = function(subscriber) {
        var _this = this;
        var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
        if (hasError || isStopped) {
          return Subscription_1.EMPTY_SUBSCRIPTION;
        }
        this.currentObservers = null;
        observers.push(subscriber);
        return new Subscription_1.Subscription(function() {
          _this.currentObservers = null;
          arrRemove_1.arrRemove(observers, subscriber);
        });
      };
      Subject4.prototype._checkFinalizedStatuses = function(subscriber) {
        var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
        if (hasError) {
          subscriber.error(thrownError);
        } else if (isStopped) {
          subscriber.complete();
        }
      };
      Subject4.prototype.asObservable = function() {
        var observable = new Observable_1.Observable();
        observable.source = this;
        return observable;
      };
      Subject4.create = function(destination, source) {
        return new AnonymousSubject(destination, source);
      };
      return Subject4;
    }(Observable_1.Observable);
    exports2.Subject = Subject3;
    var AnonymousSubject = function(_super) {
      __extends(AnonymousSubject2, _super);
      function AnonymousSubject2(destination, source) {
        var _this = _super.call(this) || this;
        _this.destination = destination;
        _this.source = source;
        return _this;
      }
      AnonymousSubject2.prototype.next = function(value) {
        var _a, _b;
        (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
      };
      AnonymousSubject2.prototype.error = function(err) {
        var _a, _b;
        (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
      };
      AnonymousSubject2.prototype.complete = function() {
        var _a, _b;
        (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
      };
      AnonymousSubject2.prototype._subscribe = function(subscriber) {
        var _a, _b;
        return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : Subscription_1.EMPTY_SUBSCRIPTION;
      };
      return AnonymousSubject2;
    }(Subject3);
    exports2.AnonymousSubject = AnonymousSubject;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js
var require_BehaviorSubject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.BehaviorSubject = void 0;
    var Subject_1 = require_Subject();
    var BehaviorSubject = function(_super) {
      __extends(BehaviorSubject2, _super);
      function BehaviorSubject2(_value) {
        var _this = _super.call(this) || this;
        _this._value = _value;
        return _this;
      }
      Object.defineProperty(BehaviorSubject2.prototype, "value", {
        get: function() {
          return this.getValue();
        },
        enumerable: false,
        configurable: true
      });
      BehaviorSubject2.prototype._subscribe = function(subscriber) {
        var subscription = _super.prototype._subscribe.call(this, subscriber);
        !subscription.closed && subscriber.next(this._value);
        return subscription;
      };
      BehaviorSubject2.prototype.getValue = function() {
        var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;
        if (hasError) {
          throw thrownError;
        }
        this._throwIfClosed();
        return _value;
      };
      BehaviorSubject2.prototype.next = function(value) {
        _super.prototype.next.call(this, this._value = value);
      };
      return BehaviorSubject2;
    }(Subject_1.Subject);
    exports2.BehaviorSubject = BehaviorSubject;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js
var require_dateTimestampProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.dateTimestampProvider = void 0;
    exports2.dateTimestampProvider = {
      now: function() {
        return (exports2.dateTimestampProvider.delegate || Date).now();
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/ReplaySubject.js
var require_ReplaySubject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/ReplaySubject.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ReplaySubject = void 0;
    var Subject_1 = require_Subject();
    var dateTimestampProvider_1 = require_dateTimestampProvider();
    var ReplaySubject = function(_super) {
      __extends(ReplaySubject2, _super);
      function ReplaySubject2(_bufferSize, _windowTime, _timestampProvider) {
        if (_bufferSize === void 0) {
          _bufferSize = Infinity;
        }
        if (_windowTime === void 0) {
          _windowTime = Infinity;
        }
        if (_timestampProvider === void 0) {
          _timestampProvider = dateTimestampProvider_1.dateTimestampProvider;
        }
        var _this = _super.call(this) || this;
        _this._bufferSize = _bufferSize;
        _this._windowTime = _windowTime;
        _this._timestampProvider = _timestampProvider;
        _this._buffer = [];
        _this._infiniteTimeWindow = true;
        _this._infiniteTimeWindow = _windowTime === Infinity;
        _this._bufferSize = Math.max(1, _bufferSize);
        _this._windowTime = Math.max(1, _windowTime);
        return _this;
      }
      ReplaySubject2.prototype.next = function(value) {
        var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;
        if (!isStopped) {
          _buffer.push(value);
          !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
        }
        this._trimBuffer();
        _super.prototype.next.call(this, value);
      };
      ReplaySubject2.prototype._subscribe = function(subscriber) {
        this._throwIfClosed();
        this._trimBuffer();
        var subscription = this._innerSubscribe(subscriber);
        var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;
        var copy = _buffer.slice();
        for (var i3 = 0; i3 < copy.length && !subscriber.closed; i3 += _infiniteTimeWindow ? 1 : 2) {
          subscriber.next(copy[i3]);
        }
        this._checkFinalizedStatuses(subscriber);
        return subscription;
      };
      ReplaySubject2.prototype._trimBuffer = function() {
        var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;
        var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
        _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
        if (!_infiniteTimeWindow) {
          var now = _timestampProvider.now();
          var last = 0;
          for (var i3 = 1; i3 < _buffer.length && _buffer[i3] <= now; i3 += 2) {
            last = i3;
          }
          last && _buffer.splice(0, last + 1);
        }
      };
      return ReplaySubject2;
    }(Subject_1.Subject);
    exports2.ReplaySubject = ReplaySubject;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/AsyncSubject.js
var require_AsyncSubject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/AsyncSubject.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsyncSubject = void 0;
    var Subject_1 = require_Subject();
    var AsyncSubject = function(_super) {
      __extends(AsyncSubject2, _super);
      function AsyncSubject2() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._value = null;
        _this._hasValue = false;
        _this._isComplete = false;
        return _this;
      }
      AsyncSubject2.prototype._checkFinalizedStatuses = function(subscriber) {
        var _a = this, hasError = _a.hasError, _hasValue = _a._hasValue, _value = _a._value, thrownError = _a.thrownError, isStopped = _a.isStopped, _isComplete = _a._isComplete;
        if (hasError) {
          subscriber.error(thrownError);
        } else if (isStopped || _isComplete) {
          _hasValue && subscriber.next(_value);
          subscriber.complete();
        }
      };
      AsyncSubject2.prototype.next = function(value) {
        if (!this.isStopped) {
          this._value = value;
          this._hasValue = true;
        }
      };
      AsyncSubject2.prototype.complete = function() {
        var _a = this, _hasValue = _a._hasValue, _value = _a._value, _isComplete = _a._isComplete;
        if (!_isComplete) {
          this._isComplete = true;
          _hasValue && _super.prototype.next.call(this, _value);
          _super.prototype.complete.call(this);
        }
      };
      return AsyncSubject2;
    }(Subject_1.Subject);
    exports2.AsyncSubject = AsyncSubject;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/Action.js
var require_Action = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/Action.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Action = void 0;
    var Subscription_1 = require_Subscription();
    var Action = function(_super) {
      __extends(Action2, _super);
      function Action2(scheduler, work) {
        return _super.call(this) || this;
      }
      Action2.prototype.schedule = function(state, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        return this;
      };
      return Action2;
    }(Subscription_1.Subscription);
    exports2.Action = Action;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js
var require_intervalProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.intervalProvider = void 0;
    exports2.intervalProvider = {
      setInterval: function(handler, timeout) {
        var args = [];
        for (var _i = 2; _i < arguments.length; _i++) {
          args[_i - 2] = arguments[_i];
        }
        var delegate = exports2.intervalProvider.delegate;
        if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
          return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));
        }
        return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
      },
      clearInterval: function(handle) {
        var delegate = exports2.intervalProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js
var require_AsyncAction = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsyncAction = void 0;
    var Action_1 = require_Action();
    var intervalProvider_1 = require_intervalProvider();
    var arrRemove_1 = require_arrRemove();
    var AsyncAction = function(_super) {
      __extends(AsyncAction2, _super);
      function AsyncAction2(scheduler, work) {
        var _this = _super.call(this, scheduler, work) || this;
        _this.scheduler = scheduler;
        _this.work = work;
        _this.pending = false;
        return _this;
      }
      AsyncAction2.prototype.schedule = function(state, delay) {
        var _a;
        if (delay === void 0) {
          delay = 0;
        }
        if (this.closed) {
          return this;
        }
        this.state = state;
        var id = this.id;
        var scheduler = this.scheduler;
        if (id != null) {
          this.id = this.recycleAsyncId(scheduler, id, delay);
        }
        this.pending = true;
        this.delay = delay;
        this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
        return this;
      };
      AsyncAction2.prototype.requestAsyncId = function(scheduler, _id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        return intervalProvider_1.intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
      };
      AsyncAction2.prototype.recycleAsyncId = function(_scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (delay != null && this.delay === delay && this.pending === false) {
          return id;
        }
        if (id != null) {
          intervalProvider_1.intervalProvider.clearInterval(id);
        }
        return void 0;
      };
      AsyncAction2.prototype.execute = function(state, delay) {
        if (this.closed) {
          return new Error("executing a cancelled action");
        }
        this.pending = false;
        var error = this._execute(state, delay);
        if (error) {
          return error;
        } else if (this.pending === false && this.id != null) {
          this.id = this.recycleAsyncId(this.scheduler, this.id, null);
        }
      };
      AsyncAction2.prototype._execute = function(state, _delay) {
        var errored = false;
        var errorValue;
        try {
          this.work(state);
        } catch (e3) {
          errored = true;
          errorValue = e3 ? e3 : new Error("Scheduled action threw falsy error");
        }
        if (errored) {
          this.unsubscribe();
          return errorValue;
        }
      };
      AsyncAction2.prototype.unsubscribe = function() {
        if (!this.closed) {
          var _a = this, id = _a.id, scheduler = _a.scheduler;
          var actions = scheduler.actions;
          this.work = this.state = this.scheduler = null;
          this.pending = false;
          arrRemove_1.arrRemove(actions, this);
          if (id != null) {
            this.id = this.recycleAsyncId(scheduler, id, null);
          }
          this.delay = null;
          _super.prototype.unsubscribe.call(this);
        }
      };
      return AsyncAction2;
    }(Action_1.Action);
    exports2.AsyncAction = AsyncAction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/Immediate.js
var require_Immediate = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/Immediate.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TestTools = exports2.Immediate = void 0;
    var nextHandle = 1;
    var resolved;
    var activeHandles = {};
    function findAndClearHandle(handle) {
      if (handle in activeHandles) {
        delete activeHandles[handle];
        return true;
      }
      return false;
    }
    exports2.Immediate = {
      setImmediate: function(cb) {
        var handle = nextHandle++;
        activeHandles[handle] = true;
        if (!resolved) {
          resolved = Promise.resolve();
        }
        resolved.then(function() {
          return findAndClearHandle(handle) && cb();
        });
        return handle;
      },
      clearImmediate: function(handle) {
        findAndClearHandle(handle);
      }
    };
    exports2.TestTools = {
      pending: function() {
        return Object.keys(activeHandles).length;
      }
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js
var require_immediateProvider = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.immediateProvider = void 0;
    var Immediate_1 = require_Immediate();
    var setImmediate2 = Immediate_1.Immediate.setImmediate;
    var clearImmediate = Immediate_1.Immediate.clearImmediate;
    exports2.immediateProvider = {
      setImmediate: function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var delegate = exports2.immediateProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate2).apply(void 0, __spreadArray([], __read(args)));
      },
      clearImmediate: function(handle) {
        var delegate = exports2.immediateProvider.delegate;
        return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);
      },
      delegate: void 0
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js
var require_AsapAction = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsapAction = void 0;
    var AsyncAction_1 = require_AsyncAction();
    var immediateProvider_1 = require_immediateProvider();
    var AsapAction = function(_super) {
      __extends(AsapAction2, _super);
      function AsapAction2(scheduler, work) {
        var _this = _super.call(this, scheduler, work) || this;
        _this.scheduler = scheduler;
        _this.work = work;
        return _this;
      }
      AsapAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (delay !== null && delay > 0) {
          return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        scheduler.actions.push(this);
        return scheduler._scheduled || (scheduler._scheduled = immediateProvider_1.immediateProvider.setImmediate(scheduler.flush.bind(scheduler, void 0)));
      };
      AsapAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
        var _a;
        if (delay === void 0) {
          delay = 0;
        }
        if (delay != null ? delay > 0 : this.delay > 0) {
          return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
        }
        var actions = scheduler.actions;
        if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
          immediateProvider_1.immediateProvider.clearImmediate(id);
          if (scheduler._scheduled === id) {
            scheduler._scheduled = void 0;
          }
        }
        return void 0;
      };
      return AsapAction2;
    }(AsyncAction_1.AsyncAction);
    exports2.AsapAction = AsapAction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Scheduler.js
var require_Scheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Scheduler.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Scheduler = void 0;
    var dateTimestampProvider_1 = require_dateTimestampProvider();
    var Scheduler = function() {
      function Scheduler2(schedulerActionCtor, now) {
        if (now === void 0) {
          now = Scheduler2.now;
        }
        this.schedulerActionCtor = schedulerActionCtor;
        this.now = now;
      }
      Scheduler2.prototype.schedule = function(work, delay, state) {
        if (delay === void 0) {
          delay = 0;
        }
        return new this.schedulerActionCtor(this, work).schedule(state, delay);
      };
      Scheduler2.now = dateTimestampProvider_1.dateTimestampProvider.now;
      return Scheduler2;
    }();
    exports2.Scheduler = Scheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js
var require_AsyncScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsyncScheduler = void 0;
    var Scheduler_1 = require_Scheduler();
    var AsyncScheduler = function(_super) {
      __extends(AsyncScheduler2, _super);
      function AsyncScheduler2(SchedulerAction, now) {
        if (now === void 0) {
          now = Scheduler_1.Scheduler.now;
        }
        var _this = _super.call(this, SchedulerAction, now) || this;
        _this.actions = [];
        _this._active = false;
        return _this;
      }
      AsyncScheduler2.prototype.flush = function(action) {
        var actions = this.actions;
        if (this._active) {
          actions.push(action);
          return;
        }
        var error;
        this._active = true;
        do {
          if (error = action.execute(action.state, action.delay)) {
            break;
          }
        } while (action = actions.shift());
        this._active = false;
        if (error) {
          while (action = actions.shift()) {
            action.unsubscribe();
          }
          throw error;
        }
      };
      return AsyncScheduler2;
    }(Scheduler_1.Scheduler);
    exports2.AsyncScheduler = AsyncScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js
var require_AsapScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AsapScheduler = void 0;
    var AsyncScheduler_1 = require_AsyncScheduler();
    var AsapScheduler = function(_super) {
      __extends(AsapScheduler2, _super);
      function AsapScheduler2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      AsapScheduler2.prototype.flush = function(action) {
        this._active = true;
        var flushId = this._scheduled;
        this._scheduled = void 0;
        var actions = this.actions;
        var error;
        action = action || actions.shift();
        do {
          if (error = action.execute(action.state, action.delay)) {
            break;
          }
        } while ((action = actions[0]) && action.id === flushId && actions.shift());
        this._active = false;
        if (error) {
          while ((action = actions[0]) && action.id === flushId && actions.shift()) {
            action.unsubscribe();
          }
          throw error;
        }
      };
      return AsapScheduler2;
    }(AsyncScheduler_1.AsyncScheduler);
    exports2.AsapScheduler = AsapScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/asap.js
var require_asap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/asap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.asap = exports2.asapScheduler = void 0;
    var AsapAction_1 = require_AsapAction();
    var AsapScheduler_1 = require_AsapScheduler();
    exports2.asapScheduler = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction);
    exports2.asap = exports2.asapScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/async.js
var require_async = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.async = exports2.asyncScheduler = void 0;
    var AsyncAction_1 = require_AsyncAction();
    var AsyncScheduler_1 = require_AsyncScheduler();
    exports2.asyncScheduler = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);
    exports2.async = exports2.asyncScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js
var require_QueueAction = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.QueueAction = void 0;
    var AsyncAction_1 = require_AsyncAction();
    var QueueAction = function(_super) {
      __extends(QueueAction2, _super);
      function QueueAction2(scheduler, work) {
        var _this = _super.call(this, scheduler, work) || this;
        _this.scheduler = scheduler;
        _this.work = work;
        return _this;
      }
      QueueAction2.prototype.schedule = function(state, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (delay > 0) {
          return _super.prototype.schedule.call(this, state, delay);
        }
        this.delay = delay;
        this.state = state;
        this.scheduler.flush(this);
        return this;
      };
      QueueAction2.prototype.execute = function(state, delay) {
        return delay > 0 || this.closed ? _super.prototype.execute.call(this, state, delay) : this._execute(state, delay);
      };
      QueueAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (delay != null && delay > 0 || delay == null && this.delay > 0) {
          return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        scheduler.flush(this);
        return 0;
      };
      return QueueAction2;
    }(AsyncAction_1.AsyncAction);
    exports2.QueueAction = QueueAction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js
var require_QueueScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.QueueScheduler = void 0;
    var AsyncScheduler_1 = require_AsyncScheduler();
    var QueueScheduler = function(_super) {
      __extends(QueueScheduler2, _super);
      function QueueScheduler2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      return QueueScheduler2;
    }(AsyncScheduler_1.AsyncScheduler);
    exports2.QueueScheduler = QueueScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/queue.js
var require_queue = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/queue.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.queue = exports2.queueScheduler = void 0;
    var QueueAction_1 = require_QueueAction();
    var QueueScheduler_1 = require_QueueScheduler();
    exports2.queueScheduler = new QueueScheduler_1.QueueScheduler(QueueAction_1.QueueAction);
    exports2.queue = exports2.queueScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js
var require_AnimationFrameAction = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AnimationFrameAction = void 0;
    var AsyncAction_1 = require_AsyncAction();
    var animationFrameProvider_1 = require_animationFrameProvider();
    var AnimationFrameAction = function(_super) {
      __extends(AnimationFrameAction2, _super);
      function AnimationFrameAction2(scheduler, work) {
        var _this = _super.call(this, scheduler, work) || this;
        _this.scheduler = scheduler;
        _this.work = work;
        return _this;
      }
      AnimationFrameAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (delay !== null && delay > 0) {
          return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
        }
        scheduler.actions.push(this);
        return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider_1.animationFrameProvider.requestAnimationFrame(function() {
          return scheduler.flush(void 0);
        }));
      };
      AnimationFrameAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
        var _a;
        if (delay === void 0) {
          delay = 0;
        }
        if (delay != null ? delay > 0 : this.delay > 0) {
          return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
        }
        var actions = scheduler.actions;
        if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
          animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
          scheduler._scheduled = void 0;
        }
        return void 0;
      };
      return AnimationFrameAction2;
    }(AsyncAction_1.AsyncAction);
    exports2.AnimationFrameAction = AnimationFrameAction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js
var require_AnimationFrameScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AnimationFrameScheduler = void 0;
    var AsyncScheduler_1 = require_AsyncScheduler();
    var AnimationFrameScheduler = function(_super) {
      __extends(AnimationFrameScheduler2, _super);
      function AnimationFrameScheduler2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      AnimationFrameScheduler2.prototype.flush = function(action) {
        this._active = true;
        var flushId;
        if (action) {
          flushId = action.id;
        } else {
          flushId = this._scheduled;
          this._scheduled = void 0;
        }
        var actions = this.actions;
        var error;
        action = action || actions.shift();
        do {
          if (error = action.execute(action.state, action.delay)) {
            break;
          }
        } while ((action = actions[0]) && action.id === flushId && actions.shift());
        this._active = false;
        if (error) {
          while ((action = actions[0]) && action.id === flushId && actions.shift()) {
            action.unsubscribe();
          }
          throw error;
        }
      };
      return AnimationFrameScheduler2;
    }(AsyncScheduler_1.AsyncScheduler);
    exports2.AnimationFrameScheduler = AnimationFrameScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js
var require_animationFrame = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.animationFrame = exports2.animationFrameScheduler = void 0;
    var AnimationFrameAction_1 = require_AnimationFrameAction();
    var AnimationFrameScheduler_1 = require_AnimationFrameScheduler();
    exports2.animationFrameScheduler = new AnimationFrameScheduler_1.AnimationFrameScheduler(AnimationFrameAction_1.AnimationFrameAction);
    exports2.animationFrame = exports2.animationFrameScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js
var require_VirtualTimeScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js"(exports2) {
    "use strict";
    var __extends = exports2 && exports2.__extends || /* @__PURE__ */ function() {
      var extendStatics = function(d3, b3) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) {
          d5.__proto__ = b5;
        } || function(d5, b5) {
          for (var p in b5) if (Object.prototype.hasOwnProperty.call(b5, p)) d5[p] = b5[p];
        };
        return extendStatics(d3, b3);
      };
      return function(d3, b3) {
        if (typeof b3 !== "function" && b3 !== null)
          throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
        extendStatics(d3, b3);
        function __() {
          this.constructor = d3;
        }
        d3.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
      };
    }();
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.VirtualAction = exports2.VirtualTimeScheduler = void 0;
    var AsyncAction_1 = require_AsyncAction();
    var Subscription_1 = require_Subscription();
    var AsyncScheduler_1 = require_AsyncScheduler();
    var VirtualTimeScheduler = function(_super) {
      __extends(VirtualTimeScheduler2, _super);
      function VirtualTimeScheduler2(schedulerActionCtor, maxFrames) {
        if (schedulerActionCtor === void 0) {
          schedulerActionCtor = VirtualAction;
        }
        if (maxFrames === void 0) {
          maxFrames = Infinity;
        }
        var _this = _super.call(this, schedulerActionCtor, function() {
          return _this.frame;
        }) || this;
        _this.maxFrames = maxFrames;
        _this.frame = 0;
        _this.index = -1;
        return _this;
      }
      VirtualTimeScheduler2.prototype.flush = function() {
        var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
        var error;
        var action;
        while ((action = actions[0]) && action.delay <= maxFrames) {
          actions.shift();
          this.frame = action.delay;
          if (error = action.execute(action.state, action.delay)) {
            break;
          }
        }
        if (error) {
          while (action = actions.shift()) {
            action.unsubscribe();
          }
          throw error;
        }
      };
      VirtualTimeScheduler2.frameTimeFactor = 10;
      return VirtualTimeScheduler2;
    }(AsyncScheduler_1.AsyncScheduler);
    exports2.VirtualTimeScheduler = VirtualTimeScheduler;
    var VirtualAction = function(_super) {
      __extends(VirtualAction2, _super);
      function VirtualAction2(scheduler, work, index) {
        if (index === void 0) {
          index = scheduler.index += 1;
        }
        var _this = _super.call(this, scheduler, work) || this;
        _this.scheduler = scheduler;
        _this.work = work;
        _this.index = index;
        _this.active = true;
        _this.index = scheduler.index = index;
        return _this;
      }
      VirtualAction2.prototype.schedule = function(state, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        if (Number.isFinite(delay)) {
          if (!this.id) {
            return _super.prototype.schedule.call(this, state, delay);
          }
          this.active = false;
          var action = new VirtualAction2(this.scheduler, this.work);
          this.add(action);
          return action.schedule(state, delay);
        } else {
          return Subscription_1.Subscription.EMPTY;
        }
      };
      VirtualAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        this.delay = scheduler.frame + delay;
        var actions = scheduler.actions;
        actions.push(this);
        actions.sort(VirtualAction2.sortActions);
        return 1;
      };
      VirtualAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
        if (delay === void 0) {
          delay = 0;
        }
        return void 0;
      };
      VirtualAction2.prototype._execute = function(state, delay) {
        if (this.active === true) {
          return _super.prototype._execute.call(this, state, delay);
        }
      };
      VirtualAction2.sortActions = function(a, b3) {
        if (a.delay === b3.delay) {
          if (a.index === b3.index) {
            return 0;
          } else if (a.index > b3.index) {
            return 1;
          } else {
            return -1;
          }
        } else if (a.delay > b3.delay) {
          return 1;
        } else {
          return -1;
        }
      };
      return VirtualAction2;
    }(AsyncAction_1.AsyncAction);
    exports2.VirtualAction = VirtualAction;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/empty.js
var require_empty = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/empty.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.empty = exports2.EMPTY = void 0;
    var Observable_1 = require_Observable();
    exports2.EMPTY = new Observable_1.Observable(function(subscriber) {
      return subscriber.complete();
    });
    function empty(scheduler) {
      return scheduler ? emptyScheduled(scheduler) : exports2.EMPTY;
    }
    exports2.empty = empty;
    function emptyScheduled(scheduler) {
      return new Observable_1.Observable(function(subscriber) {
        return scheduler.schedule(function() {
          return subscriber.complete();
        });
      });
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isScheduler.js
var require_isScheduler = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isScheduler.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isScheduler = void 0;
    var isFunction_1 = require_isFunction();
    function isScheduler(value) {
      return value && isFunction_1.isFunction(value.schedule);
    }
    exports2.isScheduler = isScheduler;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/args.js
var require_args = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/args.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.popNumber = exports2.popScheduler = exports2.popResultSelector = void 0;
    var isFunction_1 = require_isFunction();
    var isScheduler_1 = require_isScheduler();
    function last(arr) {
      return arr[arr.length - 1];
    }
    function popResultSelector(args) {
      return isFunction_1.isFunction(last(args)) ? args.pop() : void 0;
    }
    exports2.popResultSelector = popResultSelector;
    function popScheduler(args) {
      return isScheduler_1.isScheduler(last(args)) ? args.pop() : void 0;
    }
    exports2.popScheduler = popScheduler;
    function popNumber(args, defaultValue) {
      return typeof last(args) === "number" ? args.pop() : defaultValue;
    }
    exports2.popNumber = popNumber;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js
var require_isArrayLike = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isArrayLike = void 0;
    exports2.isArrayLike = function(x3) {
      return x3 && typeof x3.length === "number" && typeof x3 !== "function";
    };
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isPromise.js
var require_isPromise = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isPromise.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isPromise = void 0;
    var isFunction_1 = require_isFunction();
    function isPromise(value) {
      return isFunction_1.isFunction(value === null || value === void 0 ? void 0 : value.then);
    }
    exports2.isPromise = isPromise;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js
var require_isInteropObservable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isInteropObservable = void 0;
    var observable_1 = require_observable();
    var isFunction_1 = require_isFunction();
    function isInteropObservable(input) {
      return isFunction_1.isFunction(input[observable_1.observable]);
    }
    exports2.isInteropObservable = isInteropObservable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js
var require_isAsyncIterable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isAsyncIterable = void 0;
    var isFunction_1 = require_isFunction();
    function isAsyncIterable(obj) {
      return Symbol.asyncIterator && isFunction_1.isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
    }
    exports2.isAsyncIterable = isAsyncIterable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js
var require_throwUnobservableError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createInvalidObservableTypeError = void 0;
    function createInvalidObservableTypeError(input) {
      return new TypeError("You provided " + (input !== null && typeof input === "object" ? "an invalid object" : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
    }
    exports2.createInvalidObservableTypeError = createInvalidObservableTypeError;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/symbol/iterator.js
var require_iterator = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/symbol/iterator.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.iterator = exports2.getSymbolIterator = void 0;
    function getSymbolIterator() {
      if (typeof Symbol !== "function" || !Symbol.iterator) {
        return "@@iterator";
      }
      return Symbol.iterator;
    }
    exports2.getSymbolIterator = getSymbolIterator;
    exports2.iterator = getSymbolIterator();
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isIterable.js
var require_isIterable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isIterable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isIterable = void 0;
    var iterator_1 = require_iterator();
    var isFunction_1 = require_isFunction();
    function isIterable(input) {
      return isFunction_1.isFunction(input === null || input === void 0 ? void 0 : input[iterator_1.iterator]);
    }
    exports2.isIterable = isIterable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js
var require_isReadableStreamLike = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js"(exports2) {
    "use strict";
    var __generator = exports2 && exports2.__generator || function(thisArg, body) {
      var _ = { label: 0, sent: function() {
        if (t[0] & 1) throw t[1];
        return t[1];
      }, trys: [], ops: [] }, f, y3, t, g3;
      return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() {
        return this;
      }), g3;
      function verb(n3) {
        return function(v3) {
          return step([n3, v3]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
          if (f = 1, y3 && (t = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t = y3["return"]) && t.call(y3), 0) : y3.next) && !(t = t.call(y3, op[1])).done) return t;
          if (y3 = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
            case 4:
              _.label++;
              return { value: op[1], done: false };
            case 5:
              _.label++;
              y3 = op[1];
              op = [0];
              continue;
            case 7:
              op = _.ops.pop();
              _.trys.pop();
              continue;
            default:
              if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _.label = op[1];
                break;
              }
              if (op[0] === 6 && _.label < t[1]) {
                _.label = t[1];
                t = op;
                break;
              }
              if (t && _.label < t[2]) {
                _.label = t[2];
                _.ops.push(op);
                break;
              }
              if (t[2]) _.ops.pop();
              _.trys.pop();
              continue;
          }
          op = body.call(thisArg, _);
        } catch (e3) {
          op = [6, e3];
          y3 = 0;
        } finally {
          f = t = 0;
        }
        if (op[0] & 5) throw op[1];
        return { value: op[0] ? op[1] : void 0, done: true };
      }
    };
    var __await = exports2 && exports2.__await || function(v3) {
      return this instanceof __await ? (this.v = v3, this) : new __await(v3);
    };
    var __asyncGenerator = exports2 && exports2.__asyncGenerator || function(thisArg, _arguments, generator) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var g3 = generator.apply(thisArg, _arguments || []), i3, q = [];
      return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
        return this;
      }, i3;
      function verb(n3) {
        if (g3[n3]) i3[n3] = function(v3) {
          return new Promise(function(a, b3) {
            q.push([n3, v3, a, b3]) > 1 || resume(n3, v3);
          });
        };
      }
      function resume(n3, v3) {
        try {
          step(g3[n3](v3));
        } catch (e3) {
          settle(q[0][3], e3);
        }
      }
      function step(r3) {
        r3.value instanceof __await ? Promise.resolve(r3.value.v).then(fulfill, reject) : settle(q[0][2], r3);
      }
      function fulfill(value) {
        resume("next", value);
      }
      function reject(value) {
        resume("throw", value);
      }
      function settle(f, v3) {
        if (f(v3), q.shift(), q.length) resume(q[0][0], q[0][1]);
      }
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isReadableStreamLike = exports2.readableStreamLikeToAsyncGenerator = void 0;
    var isFunction_1 = require_isFunction();
    function readableStreamLikeToAsyncGenerator(readableStream) {
      return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
        var reader, _a, value, done;
        return __generator(this, function(_b) {
          switch (_b.label) {
            case 0:
              reader = readableStream.getReader();
              _b.label = 1;
            case 1:
              _b.trys.push([1, , 9, 10]);
              _b.label = 2;
            case 2:
              if (false) return [3, 8];
              return [4, __await(reader.read())];
            case 3:
              _a = _b.sent(), value = _a.value, done = _a.done;
              if (!done) return [3, 5];
              return [4, __await(void 0)];
            case 4:
              return [2, _b.sent()];
            case 5:
              return [4, __await(value)];
            case 6:
              return [4, _b.sent()];
            case 7:
              _b.sent();
              return [3, 2];
            case 8:
              return [3, 10];
            case 9:
              reader.releaseLock();
              return [7];
            case 10:
              return [2];
          }
        });
      });
    }
    exports2.readableStreamLikeToAsyncGenerator = readableStreamLikeToAsyncGenerator;
    function isReadableStreamLike(obj) {
      return isFunction_1.isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
    }
    exports2.isReadableStreamLike = isReadableStreamLike;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js
var require_innerFrom = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js"(exports2) {
    "use strict";
    var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P3, generator) {
      function adopt(value) {
        return value instanceof P3 ? value : new P3(function(resolve4) {
          resolve4(value);
        });
      }
      return new (P3 || (P3 = Promise))(function(resolve4, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e3) {
            reject(e3);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e3) {
            reject(e3);
          }
        }
        function step(result) {
          result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    var __generator = exports2 && exports2.__generator || function(thisArg, body) {
      var _ = { label: 0, sent: function() {
        if (t[0] & 1) throw t[1];
        return t[1];
      }, trys: [], ops: [] }, f, y3, t, g3;
      return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() {
        return this;
      }), g3;
      function verb(n3) {
        return function(v3) {
          return step([n3, v3]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
          if (f = 1, y3 && (t = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t = y3["return"]) && t.call(y3), 0) : y3.next) && !(t = t.call(y3, op[1])).done) return t;
          if (y3 = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
            case 4:
              _.label++;
              return { value: op[1], done: false };
            case 5:
              _.label++;
              y3 = op[1];
              op = [0];
              continue;
            case 7:
              op = _.ops.pop();
              _.trys.pop();
              continue;
            default:
              if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _.label = op[1];
                break;
              }
              if (op[0] === 6 && _.label < t[1]) {
                _.label = t[1];
                t = op;
                break;
              }
              if (t && _.label < t[2]) {
                _.label = t[2];
                _.ops.push(op);
                break;
              }
              if (t[2]) _.ops.pop();
              _.trys.pop();
              continue;
          }
          op = body.call(thisArg, _);
        } catch (e3) {
          op = [6, e3];
          y3 = 0;
        } finally {
          f = t = 0;
        }
        if (op[0] & 5) throw op[1];
        return { value: op[0] ? op[1] : void 0, done: true };
      }
    };
    var __asyncValues = exports2 && exports2.__asyncValues || function(o) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i3;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
        return this;
      }, i3);
      function verb(n3) {
        i3[n3] = o[n3] && function(v3) {
          return new Promise(function(resolve4, reject) {
            v3 = o[n3](v3), settle(resolve4, reject, v3.done, v3.value);
          });
        };
      }
      function settle(resolve4, reject, d3, v3) {
        Promise.resolve(v3).then(function(v5) {
          resolve4({ value: v5, done: d3 });
        }, reject);
      }
    };
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.fromReadableStreamLike = exports2.fromAsyncIterable = exports2.fromIterable = exports2.fromPromise = exports2.fromArrayLike = exports2.fromInteropObservable = exports2.innerFrom = void 0;
    var isArrayLike_1 = require_isArrayLike();
    var isPromise_1 = require_isPromise();
    var Observable_1 = require_Observable();
    var isInteropObservable_1 = require_isInteropObservable();
    var isAsyncIterable_1 = require_isAsyncIterable();
    var throwUnobservableError_1 = require_throwUnobservableError();
    var isIterable_1 = require_isIterable();
    var isReadableStreamLike_1 = require_isReadableStreamLike();
    var isFunction_1 = require_isFunction();
    var reportUnhandledError_1 = require_reportUnhandledError();
    var observable_1 = require_observable();
    function innerFrom(input) {
      if (input instanceof Observable_1.Observable) {
        return input;
      }
      if (input != null) {
        if (isInteropObservable_1.isInteropObservable(input)) {
          return fromInteropObservable(input);
        }
        if (isArrayLike_1.isArrayLike(input)) {
          return fromArrayLike(input);
        }
        if (isPromise_1.isPromise(input)) {
          return fromPromise(input);
        }
        if (isAsyncIterable_1.isAsyncIterable(input)) {
          return fromAsyncIterable(input);
        }
        if (isIterable_1.isIterable(input)) {
          return fromIterable(input);
        }
        if (isReadableStreamLike_1.isReadableStreamLike(input)) {
          return fromReadableStreamLike(input);
        }
      }
      throw throwUnobservableError_1.createInvalidObservableTypeError(input);
    }
    exports2.innerFrom = innerFrom;
    function fromInteropObservable(obj) {
      return new Observable_1.Observable(function(subscriber) {
        var obs = obj[observable_1.observable]();
        if (isFunction_1.isFunction(obs.subscribe)) {
          return obs.subscribe(subscriber);
        }
        throw new TypeError("Provided object does not correctly implement Symbol.observable");
      });
    }
    exports2.fromInteropObservable = fromInteropObservable;
    function fromArrayLike(array) {
      return new Observable_1.Observable(function(subscriber) {
        for (var i3 = 0; i3 < array.length && !subscriber.closed; i3++) {
          subscriber.next(array[i3]);
        }
        subscriber.complete();
      });
    }
    exports2.fromArrayLike = fromArrayLike;
    function fromPromise(promise) {
      return new Observable_1.Observable(function(subscriber) {
        promise.then(function(value) {
          if (!subscriber.closed) {
            subscriber.next(value);
            subscriber.complete();
          }
        }, function(err) {
          return subscriber.error(err);
        }).then(null, reportUnhandledError_1.reportUnhandledError);
      });
    }
    exports2.fromPromise = fromPromise;
    function fromIterable(iterable) {
      return new Observable_1.Observable(function(subscriber) {
        var e_1, _a;
        try {
          for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
            var value = iterable_1_1.value;
            subscriber.next(value);
            if (subscriber.closed) {
              return;
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        subscriber.complete();
      });
    }
    exports2.fromIterable = fromIterable;
    function fromAsyncIterable(asyncIterable) {
      return new Observable_1.Observable(function(subscriber) {
        process2(asyncIterable, subscriber).catch(function(err) {
          return subscriber.error(err);
        });
      });
    }
    exports2.fromAsyncIterable = fromAsyncIterable;
    function fromReadableStreamLike(readableStream) {
      return fromAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(readableStream));
    }
    exports2.fromReadableStreamLike = fromReadableStreamLike;
    function process2(asyncIterable, subscriber) {
      var asyncIterable_1, asyncIterable_1_1;
      var e_2, _a;
      return __awaiter(this, void 0, void 0, function() {
        var value, e_2_1;
        return __generator(this, function(_b) {
          switch (_b.label) {
            case 0:
              _b.trys.push([0, 5, 6, 11]);
              asyncIterable_1 = __asyncValues(asyncIterable);
              _b.label = 1;
            case 1:
              return [4, asyncIterable_1.next()];
            case 2:
              if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];
              value = asyncIterable_1_1.value;
              subscriber.next(value);
              if (subscriber.closed) {
                return [2];
              }
              _b.label = 3;
            case 3:
              return [3, 1];
            case 4:
              return [3, 11];
            case 5:
              e_2_1 = _b.sent();
              e_2 = { error: e_2_1 };
              return [3, 11];
            case 6:
              _b.trys.push([6, , 9, 10]);
              if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];
              return [4, _a.call(asyncIterable_1)];
            case 7:
              _b.sent();
              _b.label = 8;
            case 8:
              return [3, 10];
            case 9:
              if (e_2) throw e_2.error;
              return [7];
            case 10:
              return [7];
            case 11:
              subscriber.complete();
              return [2];
          }
        });
      });
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js
var require_executeSchedule = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.executeSchedule = void 0;
    function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
      if (delay === void 0) {
        delay = 0;
      }
      if (repeat === void 0) {
        repeat = false;
      }
      var scheduleSubscription = scheduler.schedule(function() {
        work();
        if (repeat) {
          parentSubscription.add(this.schedule(null, delay));
        } else {
          this.unsubscribe();
        }
      }, delay);
      parentSubscription.add(scheduleSubscription);
      if (!repeat) {
        return scheduleSubscription;
      }
    }
    exports2.executeSchedule = executeSchedule;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/observeOn.js
var require_observeOn = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/observeOn.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.observeOn = void 0;
    var executeSchedule_1 = require_executeSchedule();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function observeOn(scheduler, delay) {
      if (delay === void 0) {
        delay = 0;
      }
      return lift_1.operate(function(source, subscriber) {
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            return subscriber.next(value);
          }, delay);
        }, function() {
          return executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            return subscriber.complete();
          }, delay);
        }, function(err) {
          return executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            return subscriber.error(err);
          }, delay);
        }));
      });
    }
    exports2.observeOn = observeOn;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js
var require_subscribeOn = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.subscribeOn = void 0;
    var lift_1 = require_lift();
    function subscribeOn(scheduler, delay) {
      if (delay === void 0) {
        delay = 0;
      }
      return lift_1.operate(function(source, subscriber) {
        subscriber.add(scheduler.schedule(function() {
          return source.subscribe(subscriber);
        }, delay));
      });
    }
    exports2.subscribeOn = subscribeOn;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js
var require_scheduleObservable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduleObservable = void 0;
    var innerFrom_1 = require_innerFrom();
    var observeOn_1 = require_observeOn();
    var subscribeOn_1 = require_subscribeOn();
    function scheduleObservable(input, scheduler) {
      return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler));
    }
    exports2.scheduleObservable = scheduleObservable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js
var require_schedulePromise = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.schedulePromise = void 0;
    var innerFrom_1 = require_innerFrom();
    var observeOn_1 = require_observeOn();
    var subscribeOn_1 = require_subscribeOn();
    function schedulePromise(input, scheduler) {
      return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler));
    }
    exports2.schedulePromise = schedulePromise;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js
var require_scheduleArray = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduleArray = void 0;
    var Observable_1 = require_Observable();
    function scheduleArray(input, scheduler) {
      return new Observable_1.Observable(function(subscriber) {
        var i3 = 0;
        return scheduler.schedule(function() {
          if (i3 === input.length) {
            subscriber.complete();
          } else {
            subscriber.next(input[i3++]);
            if (!subscriber.closed) {
              this.schedule();
            }
          }
        });
      });
    }
    exports2.scheduleArray = scheduleArray;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js
var require_scheduleIterable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduleIterable = void 0;
    var Observable_1 = require_Observable();
    var iterator_1 = require_iterator();
    var isFunction_1 = require_isFunction();
    var executeSchedule_1 = require_executeSchedule();
    function scheduleIterable(input, scheduler) {
      return new Observable_1.Observable(function(subscriber) {
        var iterator;
        executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
          iterator = input[iterator_1.iterator]();
          executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            var _a;
            var value;
            var done;
            try {
              _a = iterator.next(), value = _a.value, done = _a.done;
            } catch (err) {
              subscriber.error(err);
              return;
            }
            if (done) {
              subscriber.complete();
            } else {
              subscriber.next(value);
            }
          }, 0, true);
        });
        return function() {
          return isFunction_1.isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return();
        };
      });
    }
    exports2.scheduleIterable = scheduleIterable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js
var require_scheduleAsyncIterable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduleAsyncIterable = void 0;
    var Observable_1 = require_Observable();
    var executeSchedule_1 = require_executeSchedule();
    function scheduleAsyncIterable(input, scheduler) {
      if (!input) {
        throw new Error("Iterable cannot be null");
      }
      return new Observable_1.Observable(function(subscriber) {
        executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
          var iterator = input[Symbol.asyncIterator]();
          executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            iterator.next().then(function(result) {
              if (result.done) {
                subscriber.complete();
              } else {
                subscriber.next(result.value);
              }
            });
          }, 0, true);
        });
      });
    }
    exports2.scheduleAsyncIterable = scheduleAsyncIterable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js
var require_scheduleReadableStreamLike = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduleReadableStreamLike = void 0;
    var scheduleAsyncIterable_1 = require_scheduleAsyncIterable();
    var isReadableStreamLike_1 = require_isReadableStreamLike();
    function scheduleReadableStreamLike(input, scheduler) {
      return scheduleAsyncIterable_1.scheduleAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(input), scheduler);
    }
    exports2.scheduleReadableStreamLike = scheduleReadableStreamLike;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js
var require_scheduled = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scheduled = void 0;
    var scheduleObservable_1 = require_scheduleObservable();
    var schedulePromise_1 = require_schedulePromise();
    var scheduleArray_1 = require_scheduleArray();
    var scheduleIterable_1 = require_scheduleIterable();
    var scheduleAsyncIterable_1 = require_scheduleAsyncIterable();
    var isInteropObservable_1 = require_isInteropObservable();
    var isPromise_1 = require_isPromise();
    var isArrayLike_1 = require_isArrayLike();
    var isIterable_1 = require_isIterable();
    var isAsyncIterable_1 = require_isAsyncIterable();
    var throwUnobservableError_1 = require_throwUnobservableError();
    var isReadableStreamLike_1 = require_isReadableStreamLike();
    var scheduleReadableStreamLike_1 = require_scheduleReadableStreamLike();
    function scheduled(input, scheduler) {
      if (input != null) {
        if (isInteropObservable_1.isInteropObservable(input)) {
          return scheduleObservable_1.scheduleObservable(input, scheduler);
        }
        if (isArrayLike_1.isArrayLike(input)) {
          return scheduleArray_1.scheduleArray(input, scheduler);
        }
        if (isPromise_1.isPromise(input)) {
          return schedulePromise_1.schedulePromise(input, scheduler);
        }
        if (isAsyncIterable_1.isAsyncIterable(input)) {
          return scheduleAsyncIterable_1.scheduleAsyncIterable(input, scheduler);
        }
        if (isIterable_1.isIterable(input)) {
          return scheduleIterable_1.scheduleIterable(input, scheduler);
        }
        if (isReadableStreamLike_1.isReadableStreamLike(input)) {
          return scheduleReadableStreamLike_1.scheduleReadableStreamLike(input, scheduler);
        }
      }
      throw throwUnobservableError_1.createInvalidObservableTypeError(input);
    }
    exports2.scheduled = scheduled;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/from.js
var require_from = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/from.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.from = void 0;
    var scheduled_1 = require_scheduled();
    var innerFrom_1 = require_innerFrom();
    function from(input, scheduler) {
      return scheduler ? scheduled_1.scheduled(input, scheduler) : innerFrom_1.innerFrom(input);
    }
    exports2.from = from;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/of.js
var require_of = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/of.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.of = void 0;
    var args_1 = require_args();
    var from_1 = require_from();
    function of() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(args);
      return from_1.from(args, scheduler);
    }
    exports2.of = of;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/throwError.js
var require_throwError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/throwError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.throwError = void 0;
    var Observable_1 = require_Observable();
    var isFunction_1 = require_isFunction();
    function throwError(errorOrErrorFactory, scheduler) {
      var errorFactory = isFunction_1.isFunction(errorOrErrorFactory) ? errorOrErrorFactory : function() {
        return errorOrErrorFactory;
      };
      var init = function(subscriber) {
        return subscriber.error(errorFactory());
      };
      return new Observable_1.Observable(scheduler ? function(subscriber) {
        return scheduler.schedule(init, 0, subscriber);
      } : init);
    }
    exports2.throwError = throwError;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Notification.js
var require_Notification = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/Notification.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.observeNotification = exports2.Notification = exports2.NotificationKind = void 0;
    var empty_1 = require_empty();
    var of_1 = require_of();
    var throwError_1 = require_throwError();
    var isFunction_1 = require_isFunction();
    var NotificationKind;
    (function(NotificationKind2) {
      NotificationKind2["NEXT"] = "N";
      NotificationKind2["ERROR"] = "E";
      NotificationKind2["COMPLETE"] = "C";
    })(NotificationKind = exports2.NotificationKind || (exports2.NotificationKind = {}));
    var Notification = function() {
      function Notification2(kind, value, error) {
        this.kind = kind;
        this.value = value;
        this.error = error;
        this.hasValue = kind === "N";
      }
      Notification2.prototype.observe = function(observer) {
        return observeNotification(this, observer);
      };
      Notification2.prototype.do = function(nextHandler, errorHandler, completeHandler) {
        var _a = this, kind = _a.kind, value = _a.value, error = _a.error;
        return kind === "N" ? nextHandler === null || nextHandler === void 0 ? void 0 : nextHandler(value) : kind === "E" ? errorHandler === null || errorHandler === void 0 ? void 0 : errorHandler(error) : completeHandler === null || completeHandler === void 0 ? void 0 : completeHandler();
      };
      Notification2.prototype.accept = function(nextOrObserver, error, complete) {
        var _a;
        return isFunction_1.isFunction((_a = nextOrObserver) === null || _a === void 0 ? void 0 : _a.next) ? this.observe(nextOrObserver) : this.do(nextOrObserver, error, complete);
      };
      Notification2.prototype.toObservable = function() {
        var _a = this, kind = _a.kind, value = _a.value, error = _a.error;
        var result = kind === "N" ? of_1.of(value) : kind === "E" ? throwError_1.throwError(function() {
          return error;
        }) : kind === "C" ? empty_1.EMPTY : 0;
        if (!result) {
          throw new TypeError("Unexpected notification kind " + kind);
        }
        return result;
      };
      Notification2.createNext = function(value) {
        return new Notification2("N", value);
      };
      Notification2.createError = function(err) {
        return new Notification2("E", void 0, err);
      };
      Notification2.createComplete = function() {
        return Notification2.completeNotification;
      };
      Notification2.completeNotification = new Notification2("C");
      return Notification2;
    }();
    exports2.Notification = Notification;
    function observeNotification(notification, observer) {
      var _a, _b, _c;
      var _d = notification, kind = _d.kind, value = _d.value, error = _d.error;
      if (typeof kind !== "string") {
        throw new TypeError('Invalid notification, missing "kind"');
      }
      kind === "N" ? (_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, value) : kind === "E" ? (_b = observer.error) === null || _b === void 0 ? void 0 : _b.call(observer, error) : (_c = observer.complete) === null || _c === void 0 ? void 0 : _c.call(observer);
    }
    exports2.observeNotification = observeNotification;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isObservable.js
var require_isObservable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isObservable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isObservable = void 0;
    var Observable_1 = require_Observable();
    var isFunction_1 = require_isFunction();
    function isObservable(obj) {
      return !!obj && (obj instanceof Observable_1.Observable || isFunction_1.isFunction(obj.lift) && isFunction_1.isFunction(obj.subscribe));
    }
    exports2.isObservable = isObservable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/EmptyError.js
var require_EmptyError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/EmptyError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.EmptyError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.EmptyError = createErrorClass_1.createErrorClass(function(_super) {
      return function EmptyErrorImpl() {
        _super(this);
        this.name = "EmptyError";
        this.message = "no elements in sequence";
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/lastValueFrom.js
var require_lastValueFrom = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/lastValueFrom.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.lastValueFrom = void 0;
    var EmptyError_1 = require_EmptyError();
    function lastValueFrom(source, config) {
      var hasConfig = typeof config === "object";
      return new Promise(function(resolve4, reject) {
        var _hasValue = false;
        var _value;
        source.subscribe({
          next: function(value) {
            _value = value;
            _hasValue = true;
          },
          error: reject,
          complete: function() {
            if (_hasValue) {
              resolve4(_value);
            } else if (hasConfig) {
              resolve4(config.defaultValue);
            } else {
              reject(new EmptyError_1.EmptyError());
            }
          }
        });
      });
    }
    exports2.lastValueFrom = lastValueFrom;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/firstValueFrom.js
var require_firstValueFrom = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/firstValueFrom.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.firstValueFrom = void 0;
    var EmptyError_1 = require_EmptyError();
    var Subscriber_1 = require_Subscriber();
    function firstValueFrom(source, config) {
      var hasConfig = typeof config === "object";
      return new Promise(function(resolve4, reject) {
        var subscriber = new Subscriber_1.SafeSubscriber({
          next: function(value) {
            resolve4(value);
            subscriber.unsubscribe();
          },
          error: reject,
          complete: function() {
            if (hasConfig) {
              resolve4(config.defaultValue);
            } else {
              reject(new EmptyError_1.EmptyError());
            }
          }
        });
        source.subscribe(subscriber);
      });
    }
    exports2.firstValueFrom = firstValueFrom;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js
var require_ArgumentOutOfRangeError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ArgumentOutOfRangeError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.ArgumentOutOfRangeError = createErrorClass_1.createErrorClass(function(_super) {
      return function ArgumentOutOfRangeErrorImpl() {
        _super(this);
        this.name = "ArgumentOutOfRangeError";
        this.message = "argument out of range";
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js
var require_NotFoundError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.NotFoundError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.NotFoundError = createErrorClass_1.createErrorClass(function(_super) {
      return function NotFoundErrorImpl(message) {
        _super(this);
        this.name = "NotFoundError";
        this.message = message;
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/SequenceError.js
var require_SequenceError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/SequenceError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SequenceError = void 0;
    var createErrorClass_1 = require_createErrorClass();
    exports2.SequenceError = createErrorClass_1.createErrorClass(function(_super) {
      return function SequenceErrorImpl(message) {
        _super(this);
        this.name = "SequenceError";
        this.message = message;
      };
    });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isDate.js
var require_isDate = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isDate.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isValidDate = void 0;
    function isValidDate(value) {
      return value instanceof Date && !isNaN(value);
    }
    exports2.isValidDate = isValidDate;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeout.js
var require_timeout = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeout.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.timeout = exports2.TimeoutError = void 0;
    var async_1 = require_async();
    var isDate_1 = require_isDate();
    var lift_1 = require_lift();
    var innerFrom_1 = require_innerFrom();
    var createErrorClass_1 = require_createErrorClass();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var executeSchedule_1 = require_executeSchedule();
    exports2.TimeoutError = createErrorClass_1.createErrorClass(function(_super) {
      return function TimeoutErrorImpl(info) {
        if (info === void 0) {
          info = null;
        }
        _super(this);
        this.message = "Timeout has occurred";
        this.name = "TimeoutError";
        this.info = info;
      };
    });
    function timeout(config, schedulerArg) {
      var _a = isDate_1.isValidDate(config) ? { first: config } : typeof config === "number" ? { each: config } : config, first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : async_1.asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d;
      if (first == null && each == null) {
        throw new TypeError("No timeout provided.");
      }
      return lift_1.operate(function(source, subscriber) {
        var originalSourceSubscription;
        var timerSubscription;
        var lastValue = null;
        var seen = 0;
        var startTimer = function(delay) {
          timerSubscription = executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
            try {
              originalSourceSubscription.unsubscribe();
              innerFrom_1.innerFrom(_with({
                meta,
                lastValue,
                seen
              })).subscribe(subscriber);
            } catch (err) {
              subscriber.error(err);
            }
          }, delay);
        };
        originalSourceSubscription = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
          seen++;
          subscriber.next(lastValue = value);
          each > 0 && startTimer(each);
        }, void 0, void 0, function() {
          if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {
            timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
          }
          lastValue = null;
        }));
        !seen && startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
      });
    }
    exports2.timeout = timeout;
    function timeoutErrorFactory(info) {
      throw new exports2.TimeoutError(info);
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/map.js
var require_map = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/map.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.map = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function map(project, thisArg) {
      return lift_1.operate(function(source, subscriber) {
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          subscriber.next(project.call(thisArg, value, index++));
        }));
      });
    }
    exports2.map = map;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js
var require_mapOneOrManyArgs = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mapOneOrManyArgs = void 0;
    var map_1 = require_map();
    var isArray = Array.isArray;
    function callOrApply(fn, args) {
      return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);
    }
    function mapOneOrManyArgs(fn) {
      return map_1.map(function(args) {
        return callOrApply(fn, args);
      });
    }
    exports2.mapOneOrManyArgs = mapOneOrManyArgs;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js
var require_bindCallbackInternals = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bindCallbackInternals = void 0;
    var isScheduler_1 = require_isScheduler();
    var Observable_1 = require_Observable();
    var subscribeOn_1 = require_subscribeOn();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var observeOn_1 = require_observeOn();
    var AsyncSubject_1 = require_AsyncSubject();
    function bindCallbackInternals(isNodeStyle, callbackFunc, resultSelector, scheduler) {
      if (resultSelector) {
        if (isScheduler_1.isScheduler(resultSelector)) {
          scheduler = resultSelector;
        } else {
          return function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            return bindCallbackInternals(isNodeStyle, callbackFunc, scheduler).apply(this, args).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector));
          };
        }
      }
      if (scheduler) {
        return function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          return bindCallbackInternals(isNodeStyle, callbackFunc).apply(this, args).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler));
        };
      }
      return function() {
        var _this = this;
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var subject = new AsyncSubject_1.AsyncSubject();
        var uninitialized = true;
        return new Observable_1.Observable(function(subscriber) {
          var subs = subject.subscribe(subscriber);
          if (uninitialized) {
            uninitialized = false;
            var isAsync_1 = false;
            var isComplete_1 = false;
            callbackFunc.apply(_this, __spreadArray(__spreadArray([], __read(args)), [
              function() {
                var results = [];
                for (var _i2 = 0; _i2 < arguments.length; _i2++) {
                  results[_i2] = arguments[_i2];
                }
                if (isNodeStyle) {
                  var err = results.shift();
                  if (err != null) {
                    subject.error(err);
                    return;
                  }
                }
                subject.next(1 < results.length ? results : results[0]);
                isComplete_1 = true;
                if (isAsync_1) {
                  subject.complete();
                }
              }
            ]));
            if (isComplete_1) {
              subject.complete();
            }
            isAsync_1 = true;
          }
          return subs;
        });
      };
    }
    exports2.bindCallbackInternals = bindCallbackInternals;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js
var require_bindCallback = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bindCallback = void 0;
    var bindCallbackInternals_1 = require_bindCallbackInternals();
    function bindCallback(callbackFunc, resultSelector, scheduler) {
      return bindCallbackInternals_1.bindCallbackInternals(false, callbackFunc, resultSelector, scheduler);
    }
    exports2.bindCallback = bindCallback;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js
var require_bindNodeCallback = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bindNodeCallback = void 0;
    var bindCallbackInternals_1 = require_bindCallbackInternals();
    function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
      return bindCallbackInternals_1.bindCallbackInternals(true, callbackFunc, resultSelector, scheduler);
    }
    exports2.bindNodeCallback = bindNodeCallback;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js
var require_argsArgArrayOrObject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.argsArgArrayOrObject = void 0;
    var isArray = Array.isArray;
    var getPrototypeOf = Object.getPrototypeOf;
    var objectProto = Object.prototype;
    var getKeys = Object.keys;
    function argsArgArrayOrObject(args) {
      if (args.length === 1) {
        var first_1 = args[0];
        if (isArray(first_1)) {
          return { args: first_1, keys: null };
        }
        if (isPOJO(first_1)) {
          var keys = getKeys(first_1);
          return {
            args: keys.map(function(key) {
              return first_1[key];
            }),
            keys
          };
        }
      }
      return { args, keys: null };
    }
    exports2.argsArgArrayOrObject = argsArgArrayOrObject;
    function isPOJO(obj) {
      return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto;
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/createObject.js
var require_createObject = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/createObject.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createObject = void 0;
    function createObject(keys, values) {
      return keys.reduce(function(result, key, i3) {
        return result[key] = values[i3], result;
      }, {});
    }
    exports2.createObject = createObject;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js
var require_combineLatest = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.combineLatestInit = exports2.combineLatest = void 0;
    var Observable_1 = require_Observable();
    var argsArgArrayOrObject_1 = require_argsArgArrayOrObject();
    var from_1 = require_from();
    var identity_1 = require_identity();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var args_1 = require_args();
    var createObject_1 = require_createObject();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var executeSchedule_1 = require_executeSchedule();
    function combineLatest() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(args);
      var resultSelector = args_1.popResultSelector(args);
      var _a = argsArgArrayOrObject_1.argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;
      if (observables.length === 0) {
        return from_1.from([], scheduler);
      }
      var result = new Observable_1.Observable(combineLatestInit(observables, scheduler, keys ? function(values) {
        return createObject_1.createObject(keys, values);
      } : identity_1.identity));
      return resultSelector ? result.pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)) : result;
    }
    exports2.combineLatest = combineLatest;
    function combineLatestInit(observables, scheduler, valueTransform) {
      if (valueTransform === void 0) {
        valueTransform = identity_1.identity;
      }
      return function(subscriber) {
        maybeSchedule(scheduler, function() {
          var length = observables.length;
          var values = new Array(length);
          var active = length;
          var remainingFirstValues = length;
          var _loop_1 = function(i5) {
            maybeSchedule(scheduler, function() {
              var source = from_1.from(observables[i5], scheduler);
              var hasFirstValue = false;
              source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
                values[i5] = value;
                if (!hasFirstValue) {
                  hasFirstValue = true;
                  remainingFirstValues--;
                }
                if (!remainingFirstValues) {
                  subscriber.next(valueTransform(values.slice()));
                }
              }, function() {
                if (!--active) {
                  subscriber.complete();
                }
              }));
            }, subscriber);
          };
          for (var i3 = 0; i3 < length; i3++) {
            _loop_1(i3);
          }
        }, subscriber);
      };
    }
    exports2.combineLatestInit = combineLatestInit;
    function maybeSchedule(scheduler, execute, subscription) {
      if (scheduler) {
        executeSchedule_1.executeSchedule(subscription, scheduler, execute);
      } else {
        execute();
      }
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js
var require_mergeInternals = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeInternals = void 0;
    var innerFrom_1 = require_innerFrom();
    var executeSchedule_1 = require_executeSchedule();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
      var buffer = [];
      var active = 0;
      var index = 0;
      var isComplete = false;
      var checkComplete = function() {
        if (isComplete && !buffer.length && !active) {
          subscriber.complete();
        }
      };
      var outerNext = function(value) {
        return active < concurrent ? doInnerSub(value) : buffer.push(value);
      };
      var doInnerSub = function(value) {
        expand && subscriber.next(value);
        active++;
        var innerComplete = false;
        innerFrom_1.innerFrom(project(value, index++)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(innerValue) {
          onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
          if (expand) {
            outerNext(innerValue);
          } else {
            subscriber.next(innerValue);
          }
        }, function() {
          innerComplete = true;
        }, void 0, function() {
          if (innerComplete) {
            try {
              active--;
              var _loop_1 = function() {
                var bufferedValue = buffer.shift();
                if (innerSubScheduler) {
                  executeSchedule_1.executeSchedule(subscriber, innerSubScheduler, function() {
                    return doInnerSub(bufferedValue);
                  });
                } else {
                  doInnerSub(bufferedValue);
                }
              };
              while (buffer.length && active < concurrent) {
                _loop_1();
              }
              checkComplete();
            } catch (err) {
              subscriber.error(err);
            }
          }
        }));
      };
      source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, outerNext, function() {
        isComplete = true;
        checkComplete();
      }));
      return function() {
        additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
      };
    }
    exports2.mergeInternals = mergeInternals;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js
var require_mergeMap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeMap = void 0;
    var map_1 = require_map();
    var innerFrom_1 = require_innerFrom();
    var lift_1 = require_lift();
    var mergeInternals_1 = require_mergeInternals();
    var isFunction_1 = require_isFunction();
    function mergeMap(project, resultSelector, concurrent) {
      if (concurrent === void 0) {
        concurrent = Infinity;
      }
      if (isFunction_1.isFunction(resultSelector)) {
        return mergeMap(function(a, i3) {
          return map_1.map(function(b3, ii) {
            return resultSelector(a, b3, i3, ii);
          })(innerFrom_1.innerFrom(project(a, i3)));
        }, concurrent);
      } else if (typeof resultSelector === "number") {
        concurrent = resultSelector;
      }
      return lift_1.operate(function(source, subscriber) {
        return mergeInternals_1.mergeInternals(source, subscriber, project, concurrent);
      });
    }
    exports2.mergeMap = mergeMap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js
var require_mergeAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeAll = void 0;
    var mergeMap_1 = require_mergeMap();
    var identity_1 = require_identity();
    function mergeAll(concurrent) {
      if (concurrent === void 0) {
        concurrent = Infinity;
      }
      return mergeMap_1.mergeMap(identity_1.identity, concurrent);
    }
    exports2.mergeAll = mergeAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatAll.js
var require_concatAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concatAll = void 0;
    var mergeAll_1 = require_mergeAll();
    function concatAll() {
      return mergeAll_1.mergeAll(1);
    }
    exports2.concatAll = concatAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/concat.js
var require_concat = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/concat.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concat = void 0;
    var concatAll_1 = require_concatAll();
    var args_1 = require_args();
    var from_1 = require_from();
    function concat() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      return concatAll_1.concatAll()(from_1.from(args, args_1.popScheduler(args)));
    }
    exports2.concat = concat;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/defer.js
var require_defer = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/defer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.defer = void 0;
    var Observable_1 = require_Observable();
    var innerFrom_1 = require_innerFrom();
    function defer(observableFactory) {
      return new Observable_1.Observable(function(subscriber) {
        innerFrom_1.innerFrom(observableFactory()).subscribe(subscriber);
      });
    }
    exports2.defer = defer;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/connectable.js
var require_connectable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/connectable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.connectable = void 0;
    var Subject_1 = require_Subject();
    var Observable_1 = require_Observable();
    var defer_1 = require_defer();
    var DEFAULT_CONFIG = {
      connector: function() {
        return new Subject_1.Subject();
      },
      resetOnDisconnect: true
    };
    function connectable(source, config) {
      if (config === void 0) {
        config = DEFAULT_CONFIG;
      }
      var connection = null;
      var connector = config.connector, _a = config.resetOnDisconnect, resetOnDisconnect = _a === void 0 ? true : _a;
      var subject = connector();
      var result = new Observable_1.Observable(function(subscriber) {
        return subject.subscribe(subscriber);
      });
      result.connect = function() {
        if (!connection || connection.closed) {
          connection = defer_1.defer(function() {
            return source;
          }).subscribe(subject);
          if (resetOnDisconnect) {
            connection.add(function() {
              return subject = connector();
            });
          }
        }
        return connection;
      };
      return result;
    }
    exports2.connectable = connectable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js
var require_forkJoin = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.forkJoin = void 0;
    var Observable_1 = require_Observable();
    var argsArgArrayOrObject_1 = require_argsArgArrayOrObject();
    var innerFrom_1 = require_innerFrom();
    var args_1 = require_args();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var createObject_1 = require_createObject();
    function forkJoin() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var resultSelector = args_1.popResultSelector(args);
      var _a = argsArgArrayOrObject_1.argsArgArrayOrObject(args), sources = _a.args, keys = _a.keys;
      var result = new Observable_1.Observable(function(subscriber) {
        var length = sources.length;
        if (!length) {
          subscriber.complete();
          return;
        }
        var values = new Array(length);
        var remainingCompletions = length;
        var remainingEmissions = length;
        var _loop_1 = function(sourceIndex2) {
          var hasValue = false;
          innerFrom_1.innerFrom(sources[sourceIndex2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
            if (!hasValue) {
              hasValue = true;
              remainingEmissions--;
            }
            values[sourceIndex2] = value;
          }, function() {
            return remainingCompletions--;
          }, void 0, function() {
            if (!remainingCompletions || !hasValue) {
              if (!remainingEmissions) {
                subscriber.next(keys ? createObject_1.createObject(keys, values) : values);
              }
              subscriber.complete();
            }
          }));
        };
        for (var sourceIndex = 0; sourceIndex < length; sourceIndex++) {
          _loop_1(sourceIndex);
        }
      });
      return resultSelector ? result.pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)) : result;
    }
    exports2.forkJoin = forkJoin;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js
var require_fromEvent = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.fromEvent = void 0;
    var innerFrom_1 = require_innerFrom();
    var Observable_1 = require_Observable();
    var mergeMap_1 = require_mergeMap();
    var isArrayLike_1 = require_isArrayLike();
    var isFunction_1 = require_isFunction();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var nodeEventEmitterMethods = ["addListener", "removeListener"];
    var eventTargetMethods = ["addEventListener", "removeEventListener"];
    var jqueryMethods = ["on", "off"];
    function fromEvent(target, eventName, options, resultSelector) {
      if (isFunction_1.isFunction(options)) {
        resultSelector = options;
        options = void 0;
      }
      if (resultSelector) {
        return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector));
      }
      var _a = __read(isEventTarget(target) ? eventTargetMethods.map(function(methodName) {
        return function(handler) {
          return target[methodName](eventName, handler, options);
        };
      }) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [], 2), add = _a[0], remove = _a[1];
      if (!add) {
        if (isArrayLike_1.isArrayLike(target)) {
          return mergeMap_1.mergeMap(function(subTarget) {
            return fromEvent(subTarget, eventName, options);
          })(innerFrom_1.innerFrom(target));
        }
      }
      if (!add) {
        throw new TypeError("Invalid event target");
      }
      return new Observable_1.Observable(function(subscriber) {
        var handler = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          return subscriber.next(1 < args.length ? args : args[0]);
        };
        add(handler);
        return function() {
          return remove(handler);
        };
      });
    }
    exports2.fromEvent = fromEvent;
    function toCommonHandlerRegistry(target, eventName) {
      return function(methodName) {
        return function(handler) {
          return target[methodName](eventName, handler);
        };
      };
    }
    function isNodeStyleEventEmitter(target) {
      return isFunction_1.isFunction(target.addListener) && isFunction_1.isFunction(target.removeListener);
    }
    function isJQueryStyleEventEmitter(target) {
      return isFunction_1.isFunction(target.on) && isFunction_1.isFunction(target.off);
    }
    function isEventTarget(target) {
      return isFunction_1.isFunction(target.addEventListener) && isFunction_1.isFunction(target.removeEventListener);
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js
var require_fromEventPattern = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.fromEventPattern = void 0;
    var Observable_1 = require_Observable();
    var isFunction_1 = require_isFunction();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    function fromEventPattern(addHandler, removeHandler, resultSelector) {
      if (resultSelector) {
        return fromEventPattern(addHandler, removeHandler).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector));
      }
      return new Observable_1.Observable(function(subscriber) {
        var handler = function() {
          var e3 = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            e3[_i] = arguments[_i];
          }
          return subscriber.next(e3.length === 1 ? e3[0] : e3);
        };
        var retValue = addHandler(handler);
        return isFunction_1.isFunction(removeHandler) ? function() {
          return removeHandler(handler, retValue);
        } : void 0;
      });
    }
    exports2.fromEventPattern = fromEventPattern;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/generate.js
var require_generate = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/generate.js"(exports2) {
    "use strict";
    var __generator = exports2 && exports2.__generator || function(thisArg, body) {
      var _ = { label: 0, sent: function() {
        if (t[0] & 1) throw t[1];
        return t[1];
      }, trys: [], ops: [] }, f, y3, t, g3;
      return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() {
        return this;
      }), g3;
      function verb(n3) {
        return function(v3) {
          return step([n3, v3]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
          if (f = 1, y3 && (t = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t = y3["return"]) && t.call(y3), 0) : y3.next) && !(t = t.call(y3, op[1])).done) return t;
          if (y3 = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
            case 4:
              _.label++;
              return { value: op[1], done: false };
            case 5:
              _.label++;
              y3 = op[1];
              op = [0];
              continue;
            case 7:
              op = _.ops.pop();
              _.trys.pop();
              continue;
            default:
              if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _.label = op[1];
                break;
              }
              if (op[0] === 6 && _.label < t[1]) {
                _.label = t[1];
                t = op;
                break;
              }
              if (t && _.label < t[2]) {
                _.label = t[2];
                _.ops.push(op);
                break;
              }
              if (t[2]) _.ops.pop();
              _.trys.pop();
              continue;
          }
          op = body.call(thisArg, _);
        } catch (e3) {
          op = [6, e3];
          y3 = 0;
        } finally {
          f = t = 0;
        }
        if (op[0] & 5) throw op[1];
        return { value: op[0] ? op[1] : void 0, done: true };
      }
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.generate = void 0;
    var identity_1 = require_identity();
    var isScheduler_1 = require_isScheduler();
    var defer_1 = require_defer();
    var scheduleIterable_1 = require_scheduleIterable();
    function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler) {
      var _a, _b;
      var resultSelector;
      var initialState;
      if (arguments.length === 1) {
        _a = initialStateOrOptions, initialState = _a.initialState, condition = _a.condition, iterate = _a.iterate, _b = _a.resultSelector, resultSelector = _b === void 0 ? identity_1.identity : _b, scheduler = _a.scheduler;
      } else {
        initialState = initialStateOrOptions;
        if (!resultSelectorOrScheduler || isScheduler_1.isScheduler(resultSelectorOrScheduler)) {
          resultSelector = identity_1.identity;
          scheduler = resultSelectorOrScheduler;
        } else {
          resultSelector = resultSelectorOrScheduler;
        }
      }
      function gen() {
        var state;
        return __generator(this, function(_a2) {
          switch (_a2.label) {
            case 0:
              state = initialState;
              _a2.label = 1;
            case 1:
              if (!(!condition || condition(state))) return [3, 4];
              return [4, resultSelector(state)];
            case 2:
              _a2.sent();
              _a2.label = 3;
            case 3:
              state = iterate(state);
              return [3, 1];
            case 4:
              return [2];
          }
        });
      }
      return defer_1.defer(scheduler ? function() {
        return scheduleIterable_1.scheduleIterable(gen(), scheduler);
      } : gen);
    }
    exports2.generate = generate;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/iif.js
var require_iif = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/iif.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.iif = void 0;
    var defer_1 = require_defer();
    function iif(condition, trueResult, falseResult) {
      return defer_1.defer(function() {
        return condition() ? trueResult : falseResult;
      });
    }
    exports2.iif = iif;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/timer.js
var require_timer = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/timer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.timer = void 0;
    var Observable_1 = require_Observable();
    var async_1 = require_async();
    var isScheduler_1 = require_isScheduler();
    var isDate_1 = require_isDate();
    function timer(dueTime, intervalOrScheduler, scheduler) {
      if (dueTime === void 0) {
        dueTime = 0;
      }
      if (scheduler === void 0) {
        scheduler = async_1.async;
      }
      var intervalDuration = -1;
      if (intervalOrScheduler != null) {
        if (isScheduler_1.isScheduler(intervalOrScheduler)) {
          scheduler = intervalOrScheduler;
        } else {
          intervalDuration = intervalOrScheduler;
        }
      }
      return new Observable_1.Observable(function(subscriber) {
        var due = isDate_1.isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
        if (due < 0) {
          due = 0;
        }
        var n3 = 0;
        return scheduler.schedule(function() {
          if (!subscriber.closed) {
            subscriber.next(n3++);
            if (0 <= intervalDuration) {
              this.schedule(void 0, intervalDuration);
            } else {
              subscriber.complete();
            }
          }
        }, due);
      });
    }
    exports2.timer = timer;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/interval.js
var require_interval = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/interval.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.interval = void 0;
    var async_1 = require_async();
    var timer_1 = require_timer();
    function interval(period, scheduler) {
      if (period === void 0) {
        period = 0;
      }
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      if (period < 0) {
        period = 0;
      }
      return timer_1.timer(period, period, scheduler);
    }
    exports2.interval = interval;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/merge.js
var require_merge = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/merge.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.merge = void 0;
    var mergeAll_1 = require_mergeAll();
    var innerFrom_1 = require_innerFrom();
    var empty_1 = require_empty();
    var args_1 = require_args();
    var from_1 = require_from();
    function merge() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(args);
      var concurrent = args_1.popNumber(args, Infinity);
      var sources = args;
      return !sources.length ? empty_1.EMPTY : sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : mergeAll_1.mergeAll(concurrent)(from_1.from(sources, scheduler));
    }
    exports2.merge = merge;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/never.js
var require_never = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/never.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.never = exports2.NEVER = void 0;
    var Observable_1 = require_Observable();
    var noop_1 = require_noop();
    exports2.NEVER = new Observable_1.Observable(noop_1.noop);
    function never() {
      return exports2.NEVER;
    }
    exports2.never = never;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js
var require_argsOrArgArray = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.argsOrArgArray = void 0;
    var isArray = Array.isArray;
    function argsOrArgArray(args) {
      return args.length === 1 && isArray(args[0]) ? args[0] : args;
    }
    exports2.argsOrArgArray = argsOrArgArray;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js
var require_onErrorResumeNext = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.onErrorResumeNext = void 0;
    var Observable_1 = require_Observable();
    var argsOrArgArray_1 = require_argsOrArgArray();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    var innerFrom_1 = require_innerFrom();
    function onErrorResumeNext() {
      var sources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        sources[_i] = arguments[_i];
      }
      var nextSources = argsOrArgArray_1.argsOrArgArray(sources);
      return new Observable_1.Observable(function(subscriber) {
        var sourceIndex = 0;
        var subscribeNext = function() {
          if (sourceIndex < nextSources.length) {
            var nextSource = void 0;
            try {
              nextSource = innerFrom_1.innerFrom(nextSources[sourceIndex++]);
            } catch (err) {
              subscribeNext();
              return;
            }
            var innerSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, noop_1.noop, noop_1.noop);
            nextSource.subscribe(innerSubscriber);
            innerSubscriber.add(subscribeNext);
          } else {
            subscriber.complete();
          }
        };
        subscribeNext();
      });
    }
    exports2.onErrorResumeNext = onErrorResumeNext;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/pairs.js
var require_pairs = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/pairs.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.pairs = void 0;
    var from_1 = require_from();
    function pairs(obj, scheduler) {
      return from_1.from(Object.entries(obj), scheduler);
    }
    exports2.pairs = pairs;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/not.js
var require_not = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/not.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.not = void 0;
    function not(pred, thisArg) {
      return function(value, index) {
        return !pred.call(thisArg, value, index);
      };
    }
    exports2.not = not;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/filter.js
var require_filter = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/filter.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.filter = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function filter(predicate, thisArg) {
      return lift_1.operate(function(source, subscriber) {
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return predicate.call(thisArg, value, index++) && subscriber.next(value);
        }));
      });
    }
    exports2.filter = filter;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/partition.js
var require_partition = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/partition.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.partition = void 0;
    var not_1 = require_not();
    var filter_1 = require_filter();
    var innerFrom_1 = require_innerFrom();
    function partition(source, predicate, thisArg) {
      return [filter_1.filter(predicate, thisArg)(innerFrom_1.innerFrom(source)), filter_1.filter(not_1.not(predicate, thisArg))(innerFrom_1.innerFrom(source))];
    }
    exports2.partition = partition;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/race.js
var require_race = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/race.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.raceInit = exports2.race = void 0;
    var Observable_1 = require_Observable();
    var innerFrom_1 = require_innerFrom();
    var argsOrArgArray_1 = require_argsOrArgArray();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function race() {
      var sources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        sources[_i] = arguments[_i];
      }
      sources = argsOrArgArray_1.argsOrArgArray(sources);
      return sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : new Observable_1.Observable(raceInit(sources));
    }
    exports2.race = race;
    function raceInit(sources) {
      return function(subscriber) {
        var subscriptions = [];
        var _loop_1 = function(i5) {
          subscriptions.push(innerFrom_1.innerFrom(sources[i5]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
            if (subscriptions) {
              for (var s = 0; s < subscriptions.length; s++) {
                s !== i5 && subscriptions[s].unsubscribe();
              }
              subscriptions = null;
            }
            subscriber.next(value);
          })));
        };
        for (var i3 = 0; subscriptions && !subscriber.closed && i3 < sources.length; i3++) {
          _loop_1(i3);
        }
      };
    }
    exports2.raceInit = raceInit;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/range.js
var require_range = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/range.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.range = void 0;
    var Observable_1 = require_Observable();
    var empty_1 = require_empty();
    function range(start, count, scheduler) {
      if (count == null) {
        count = start;
        start = 0;
      }
      if (count <= 0) {
        return empty_1.EMPTY;
      }
      var end = count + start;
      return new Observable_1.Observable(scheduler ? function(subscriber) {
        var n3 = start;
        return scheduler.schedule(function() {
          if (n3 < end) {
            subscriber.next(n3++);
            this.schedule();
          } else {
            subscriber.complete();
          }
        });
      } : function(subscriber) {
        var n3 = start;
        while (n3 < end && !subscriber.closed) {
          subscriber.next(n3++);
        }
        subscriber.complete();
      });
    }
    exports2.range = range;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/using.js
var require_using = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/using.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.using = void 0;
    var Observable_1 = require_Observable();
    var innerFrom_1 = require_innerFrom();
    var empty_1 = require_empty();
    function using(resourceFactory, observableFactory) {
      return new Observable_1.Observable(function(subscriber) {
        var resource = resourceFactory();
        var result = observableFactory(resource);
        var source = result ? innerFrom_1.innerFrom(result) : empty_1.EMPTY;
        source.subscribe(subscriber);
        return function() {
          if (resource) {
            resource.unsubscribe();
          }
        };
      });
    }
    exports2.using = using;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/zip.js
var require_zip = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/zip.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.zip = void 0;
    var Observable_1 = require_Observable();
    var innerFrom_1 = require_innerFrom();
    var argsOrArgArray_1 = require_argsOrArgArray();
    var empty_1 = require_empty();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var args_1 = require_args();
    function zip() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var resultSelector = args_1.popResultSelector(args);
      var sources = argsOrArgArray_1.argsOrArgArray(args);
      return sources.length ? new Observable_1.Observable(function(subscriber) {
        var buffers = sources.map(function() {
          return [];
        });
        var completed = sources.map(function() {
          return false;
        });
        subscriber.add(function() {
          buffers = completed = null;
        });
        var _loop_1 = function(sourceIndex2) {
          innerFrom_1.innerFrom(sources[sourceIndex2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
            buffers[sourceIndex2].push(value);
            if (buffers.every(function(buffer) {
              return buffer.length;
            })) {
              var result = buffers.map(function(buffer) {
                return buffer.shift();
              });
              subscriber.next(resultSelector ? resultSelector.apply(void 0, __spreadArray([], __read(result))) : result);
              if (buffers.some(function(buffer, i3) {
                return !buffer.length && completed[i3];
              })) {
                subscriber.complete();
              }
            }
          }, function() {
            completed[sourceIndex2] = true;
            !buffers[sourceIndex2].length && subscriber.complete();
          }));
        };
        for (var sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
          _loop_1(sourceIndex);
        }
        return function() {
          buffers = completed = null;
        };
      }) : empty_1.EMPTY;
    }
    exports2.zip = zip;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/types.js
var require_types = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/audit.js
var require_audit = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/audit.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.audit = void 0;
    var lift_1 = require_lift();
    var innerFrom_1 = require_innerFrom();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function audit(durationSelector) {
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        var lastValue = null;
        var durationSubscriber = null;
        var isComplete = false;
        var endDuration = function() {
          durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
          durationSubscriber = null;
          if (hasValue) {
            hasValue = false;
            var value = lastValue;
            lastValue = null;
            subscriber.next(value);
          }
          isComplete && subscriber.complete();
        };
        var cleanupDuration = function() {
          durationSubscriber = null;
          isComplete && subscriber.complete();
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          hasValue = true;
          lastValue = value;
          if (!durationSubscriber) {
            innerFrom_1.innerFrom(durationSelector(value)).subscribe(durationSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, endDuration, cleanupDuration));
          }
        }, function() {
          isComplete = true;
          (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
        }));
      });
    }
    exports2.audit = audit;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/auditTime.js
var require_auditTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/auditTime.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.auditTime = void 0;
    var async_1 = require_async();
    var audit_1 = require_audit();
    var timer_1 = require_timer();
    function auditTime(duration, scheduler) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      return audit_1.audit(function() {
        return timer_1.timer(duration, scheduler);
      });
    }
    exports2.auditTime = auditTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/buffer.js
var require_buffer = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/buffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.buffer = void 0;
    var lift_1 = require_lift();
    var noop_1 = require_noop();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function buffer(closingNotifier) {
      return lift_1.operate(function(source, subscriber) {
        var currentBuffer = [];
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return currentBuffer.push(value);
        }, function() {
          subscriber.next(currentBuffer);
          subscriber.complete();
        }));
        innerFrom_1.innerFrom(closingNotifier).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          var b3 = currentBuffer;
          currentBuffer = [];
          subscriber.next(b3);
        }, noop_1.noop));
        return function() {
          currentBuffer = null;
        };
      });
    }
    exports2.buffer = buffer;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js
var require_bufferCount = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bufferCount = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var arrRemove_1 = require_arrRemove();
    function bufferCount(bufferSize, startBufferEvery) {
      if (startBufferEvery === void 0) {
        startBufferEvery = null;
      }
      startBufferEvery = startBufferEvery !== null && startBufferEvery !== void 0 ? startBufferEvery : bufferSize;
      return lift_1.operate(function(source, subscriber) {
        var buffers = [];
        var count = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var e_1, _a, e_2, _b;
          var toEmit = null;
          if (count++ % startBufferEvery === 0) {
            buffers.push([]);
          }
          try {
            for (var buffers_1 = __values(buffers), buffers_1_1 = buffers_1.next(); !buffers_1_1.done; buffers_1_1 = buffers_1.next()) {
              var buffer = buffers_1_1.value;
              buffer.push(value);
              if (bufferSize <= buffer.length) {
                toEmit = toEmit !== null && toEmit !== void 0 ? toEmit : [];
                toEmit.push(buffer);
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (buffers_1_1 && !buffers_1_1.done && (_a = buffers_1.return)) _a.call(buffers_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          if (toEmit) {
            try {
              for (var toEmit_1 = __values(toEmit), toEmit_1_1 = toEmit_1.next(); !toEmit_1_1.done; toEmit_1_1 = toEmit_1.next()) {
                var buffer = toEmit_1_1.value;
                arrRemove_1.arrRemove(buffers, buffer);
                subscriber.next(buffer);
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (toEmit_1_1 && !toEmit_1_1.done && (_b = toEmit_1.return)) _b.call(toEmit_1);
              } finally {
                if (e_2) throw e_2.error;
              }
            }
          }
        }, function() {
          var e_3, _a;
          try {
            for (var buffers_2 = __values(buffers), buffers_2_1 = buffers_2.next(); !buffers_2_1.done; buffers_2_1 = buffers_2.next()) {
              var buffer = buffers_2_1.value;
              subscriber.next(buffer);
            }
          } catch (e_3_1) {
            e_3 = { error: e_3_1 };
          } finally {
            try {
              if (buffers_2_1 && !buffers_2_1.done && (_a = buffers_2.return)) _a.call(buffers_2);
            } finally {
              if (e_3) throw e_3.error;
            }
          }
          subscriber.complete();
        }, void 0, function() {
          buffers = null;
        }));
      });
    }
    exports2.bufferCount = bufferCount;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js
var require_bufferTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bufferTime = void 0;
    var Subscription_1 = require_Subscription();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var arrRemove_1 = require_arrRemove();
    var async_1 = require_async();
    var args_1 = require_args();
    var executeSchedule_1 = require_executeSchedule();
    function bufferTime(bufferTimeSpan) {
      var _a, _b;
      var otherArgs = [];
      for (var _i = 1; _i < arguments.length; _i++) {
        otherArgs[_i - 1] = arguments[_i];
      }
      var scheduler = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler;
      var bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
      var maxBufferSize = otherArgs[1] || Infinity;
      return lift_1.operate(function(source, subscriber) {
        var bufferRecords = [];
        var restartOnEmit = false;
        var emit = function(record) {
          var buffer = record.buffer, subs = record.subs;
          subs.unsubscribe();
          arrRemove_1.arrRemove(bufferRecords, record);
          subscriber.next(buffer);
          restartOnEmit && startBuffer();
        };
        var startBuffer = function() {
          if (bufferRecords) {
            var subs = new Subscription_1.Subscription();
            subscriber.add(subs);
            var buffer = [];
            var record_1 = {
              buffer,
              subs
            };
            bufferRecords.push(record_1);
            executeSchedule_1.executeSchedule(subs, scheduler, function() {
              return emit(record_1);
            }, bufferTimeSpan);
          }
        };
        if (bufferCreationInterval !== null && bufferCreationInterval >= 0) {
          executeSchedule_1.executeSchedule(subscriber, scheduler, startBuffer, bufferCreationInterval, true);
        } else {
          restartOnEmit = true;
        }
        startBuffer();
        var bufferTimeSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var e_1, _a2;
          var recordsCopy = bufferRecords.slice();
          try {
            for (var recordsCopy_1 = __values(recordsCopy), recordsCopy_1_1 = recordsCopy_1.next(); !recordsCopy_1_1.done; recordsCopy_1_1 = recordsCopy_1.next()) {
              var record = recordsCopy_1_1.value;
              var buffer = record.buffer;
              buffer.push(value);
              maxBufferSize <= buffer.length && emit(record);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (recordsCopy_1_1 && !recordsCopy_1_1.done && (_a2 = recordsCopy_1.return)) _a2.call(recordsCopy_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }, function() {
          while (bufferRecords === null || bufferRecords === void 0 ? void 0 : bufferRecords.length) {
            subscriber.next(bufferRecords.shift().buffer);
          }
          bufferTimeSubscriber === null || bufferTimeSubscriber === void 0 ? void 0 : bufferTimeSubscriber.unsubscribe();
          subscriber.complete();
          subscriber.unsubscribe();
        }, void 0, function() {
          return bufferRecords = null;
        });
        source.subscribe(bufferTimeSubscriber);
      });
    }
    exports2.bufferTime = bufferTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js
var require_bufferToggle = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bufferToggle = void 0;
    var Subscription_1 = require_Subscription();
    var lift_1 = require_lift();
    var innerFrom_1 = require_innerFrom();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    var arrRemove_1 = require_arrRemove();
    function bufferToggle(openings, closingSelector) {
      return lift_1.operate(function(source, subscriber) {
        var buffers = [];
        innerFrom_1.innerFrom(openings).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(openValue) {
          var buffer = [];
          buffers.push(buffer);
          var closingSubscription = new Subscription_1.Subscription();
          var emitBuffer = function() {
            arrRemove_1.arrRemove(buffers, buffer);
            subscriber.next(buffer);
            closingSubscription.unsubscribe();
          };
          closingSubscription.add(innerFrom_1.innerFrom(closingSelector(openValue)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, emitBuffer, noop_1.noop)));
        }, noop_1.noop));
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var e_1, _a;
          try {
            for (var buffers_1 = __values(buffers), buffers_1_1 = buffers_1.next(); !buffers_1_1.done; buffers_1_1 = buffers_1.next()) {
              var buffer = buffers_1_1.value;
              buffer.push(value);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (buffers_1_1 && !buffers_1_1.done && (_a = buffers_1.return)) _a.call(buffers_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }, function() {
          while (buffers.length > 0) {
            subscriber.next(buffers.shift());
          }
          subscriber.complete();
        }));
      });
    }
    exports2.bufferToggle = bufferToggle;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js
var require_bufferWhen = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.bufferWhen = void 0;
    var lift_1 = require_lift();
    var noop_1 = require_noop();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function bufferWhen(closingSelector) {
      return lift_1.operate(function(source, subscriber) {
        var buffer = null;
        var closingSubscriber = null;
        var openBuffer = function() {
          closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
          var b3 = buffer;
          buffer = [];
          b3 && subscriber.next(b3);
          innerFrom_1.innerFrom(closingSelector()).subscribe(closingSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, openBuffer, noop_1.noop));
        };
        openBuffer();
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return buffer === null || buffer === void 0 ? void 0 : buffer.push(value);
        }, function() {
          buffer && subscriber.next(buffer);
          subscriber.complete();
        }, void 0, function() {
          return buffer = closingSubscriber = null;
        }));
      });
    }
    exports2.bufferWhen = bufferWhen;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/catchError.js
var require_catchError = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/catchError.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.catchError = void 0;
    var innerFrom_1 = require_innerFrom();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var lift_1 = require_lift();
    function catchError(selector) {
      return lift_1.operate(function(source, subscriber) {
        var innerSub = null;
        var syncUnsub = false;
        var handledResult;
        innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, function(err) {
          handledResult = innerFrom_1.innerFrom(selector(err, catchError(selector)(source)));
          if (innerSub) {
            innerSub.unsubscribe();
            innerSub = null;
            handledResult.subscribe(subscriber);
          } else {
            syncUnsub = true;
          }
        }));
        if (syncUnsub) {
          innerSub.unsubscribe();
          innerSub = null;
          handledResult.subscribe(subscriber);
        }
      });
    }
    exports2.catchError = catchError;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js
var require_scanInternals = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scanInternals = void 0;
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
      return function(source, subscriber) {
        var hasState = hasSeed;
        var state = seed;
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var i3 = index++;
          state = hasState ? accumulator(state, value, i3) : (hasState = true, value);
          emitOnNext && subscriber.next(state);
        }, emitBeforeComplete && function() {
          hasState && subscriber.next(state);
          subscriber.complete();
        }));
      };
    }
    exports2.scanInternals = scanInternals;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/reduce.js
var require_reduce = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/reduce.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.reduce = void 0;
    var scanInternals_1 = require_scanInternals();
    var lift_1 = require_lift();
    function reduce(accumulator, seed) {
      return lift_1.operate(scanInternals_1.scanInternals(accumulator, seed, arguments.length >= 2, false, true));
    }
    exports2.reduce = reduce;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/toArray.js
var require_toArray = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/toArray.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.toArray = void 0;
    var reduce_1 = require_reduce();
    var lift_1 = require_lift();
    var arrReducer = function(arr, value) {
      return arr.push(value), arr;
    };
    function toArray() {
      return lift_1.operate(function(source, subscriber) {
        reduce_1.reduce(arrReducer, [])(source).subscribe(subscriber);
      });
    }
    exports2.toArray = toArray;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js
var require_joinAllInternals = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.joinAllInternals = void 0;
    var identity_1 = require_identity();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var pipe_1 = require_pipe();
    var mergeMap_1 = require_mergeMap();
    var toArray_1 = require_toArray();
    function joinAllInternals(joinFn, project) {
      return pipe_1.pipe(toArray_1.toArray(), mergeMap_1.mergeMap(function(sources) {
        return joinFn(sources);
      }), project ? mapOneOrManyArgs_1.mapOneOrManyArgs(project) : identity_1.identity);
    }
    exports2.joinAllInternals = joinAllInternals;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js
var require_combineLatestAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.combineLatestAll = void 0;
    var combineLatest_1 = require_combineLatest();
    var joinAllInternals_1 = require_joinAllInternals();
    function combineLatestAll(project) {
      return joinAllInternals_1.joinAllInternals(combineLatest_1.combineLatest, project);
    }
    exports2.combineLatestAll = combineLatestAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineAll.js
var require_combineAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.combineAll = void 0;
    var combineLatestAll_1 = require_combineLatestAll();
    exports2.combineAll = combineLatestAll_1.combineLatestAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js
var require_combineLatest2 = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.combineLatest = void 0;
    var combineLatest_1 = require_combineLatest();
    var lift_1 = require_lift();
    var argsOrArgArray_1 = require_argsOrArgArray();
    var mapOneOrManyArgs_1 = require_mapOneOrManyArgs();
    var pipe_1 = require_pipe();
    var args_1 = require_args();
    function combineLatest() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var resultSelector = args_1.popResultSelector(args);
      return resultSelector ? pipe_1.pipe(combineLatest.apply(void 0, __spreadArray([], __read(args))), mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)) : lift_1.operate(function(source, subscriber) {
        combineLatest_1.combineLatestInit(__spreadArray([source], __read(argsOrArgArray_1.argsOrArgArray(args))))(subscriber);
      });
    }
    exports2.combineLatest = combineLatest;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js
var require_combineLatestWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.combineLatestWith = void 0;
    var combineLatest_1 = require_combineLatest2();
    function combineLatestWith() {
      var otherSources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        otherSources[_i] = arguments[_i];
      }
      return combineLatest_1.combineLatest.apply(void 0, __spreadArray([], __read(otherSources)));
    }
    exports2.combineLatestWith = combineLatestWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatMap.js
var require_concatMap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatMap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concatMap = void 0;
    var mergeMap_1 = require_mergeMap();
    var isFunction_1 = require_isFunction();
    function concatMap(project, resultSelector) {
      return isFunction_1.isFunction(resultSelector) ? mergeMap_1.mergeMap(project, resultSelector, 1) : mergeMap_1.mergeMap(project, 1);
    }
    exports2.concatMap = concatMap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js
var require_concatMapTo = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concatMapTo = void 0;
    var concatMap_1 = require_concatMap();
    var isFunction_1 = require_isFunction();
    function concatMapTo(innerObservable, resultSelector) {
      return isFunction_1.isFunction(resultSelector) ? concatMap_1.concatMap(function() {
        return innerObservable;
      }, resultSelector) : concatMap_1.concatMap(function() {
        return innerObservable;
      });
    }
    exports2.concatMapTo = concatMapTo;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concat.js
var require_concat2 = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concat.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concat = void 0;
    var lift_1 = require_lift();
    var concatAll_1 = require_concatAll();
    var args_1 = require_args();
    var from_1 = require_from();
    function concat() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(args);
      return lift_1.operate(function(source, subscriber) {
        concatAll_1.concatAll()(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
      });
    }
    exports2.concat = concat;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatWith.js
var require_concatWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/concatWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.concatWith = void 0;
    var concat_1 = require_concat2();
    function concatWith() {
      var otherSources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        otherSources[_i] = arguments[_i];
      }
      return concat_1.concat.apply(void 0, __spreadArray([], __read(otherSources)));
    }
    exports2.concatWith = concatWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js
var require_fromSubscribable = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.fromSubscribable = void 0;
    var Observable_1 = require_Observable();
    function fromSubscribable(subscribable) {
      return new Observable_1.Observable(function(subscriber) {
        return subscribable.subscribe(subscriber);
      });
    }
    exports2.fromSubscribable = fromSubscribable;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/connect.js
var require_connect = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/connect.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.connect = void 0;
    var Subject_1 = require_Subject();
    var innerFrom_1 = require_innerFrom();
    var lift_1 = require_lift();
    var fromSubscribable_1 = require_fromSubscribable();
    var DEFAULT_CONFIG = {
      connector: function() {
        return new Subject_1.Subject();
      }
    };
    function connect(selector, config) {
      if (config === void 0) {
        config = DEFAULT_CONFIG;
      }
      var connector = config.connector;
      return lift_1.operate(function(source, subscriber) {
        var subject = connector();
        innerFrom_1.innerFrom(selector(fromSubscribable_1.fromSubscribable(subject))).subscribe(subscriber);
        subscriber.add(source.subscribe(subject));
      });
    }
    exports2.connect = connect;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/count.js
var require_count = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/count.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.count = void 0;
    var reduce_1 = require_reduce();
    function count(predicate) {
      return reduce_1.reduce(function(total, value, i3) {
        return !predicate || predicate(value, i3) ? total + 1 : total;
      }, 0);
    }
    exports2.count = count;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/debounce.js
var require_debounce = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/debounce.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.debounce = void 0;
    var lift_1 = require_lift();
    var noop_1 = require_noop();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function debounce(durationSelector) {
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        var lastValue = null;
        var durationSubscriber = null;
        var emit = function() {
          durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
          durationSubscriber = null;
          if (hasValue) {
            hasValue = false;
            var value = lastValue;
            lastValue = null;
            subscriber.next(value);
          }
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
          hasValue = true;
          lastValue = value;
          durationSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, emit, noop_1.noop);
          innerFrom_1.innerFrom(durationSelector(value)).subscribe(durationSubscriber);
        }, function() {
          emit();
          subscriber.complete();
        }, void 0, function() {
          lastValue = durationSubscriber = null;
        }));
      });
    }
    exports2.debounce = debounce;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js
var require_debounceTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.debounceTime = void 0;
    var async_1 = require_async();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function debounceTime(dueTime, scheduler) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      return lift_1.operate(function(source, subscriber) {
        var activeTask = null;
        var lastValue = null;
        var lastTime = null;
        var emit = function() {
          if (activeTask) {
            activeTask.unsubscribe();
            activeTask = null;
            var value = lastValue;
            lastValue = null;
            subscriber.next(value);
          }
        };
        function emitWhenIdle() {
          var targetTime = lastTime + dueTime;
          var now = scheduler.now();
          if (now < targetTime) {
            activeTask = this.schedule(void 0, targetTime - now);
            subscriber.add(activeTask);
            return;
          }
          emit();
        }
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          lastValue = value;
          lastTime = scheduler.now();
          if (!activeTask) {
            activeTask = scheduler.schedule(emitWhenIdle, dueTime);
            subscriber.add(activeTask);
          }
        }, function() {
          emit();
          subscriber.complete();
        }, void 0, function() {
          lastValue = activeTask = null;
        }));
      });
    }
    exports2.debounceTime = debounceTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js
var require_defaultIfEmpty = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.defaultIfEmpty = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function defaultIfEmpty(defaultValue) {
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          hasValue = true;
          subscriber.next(value);
        }, function() {
          if (!hasValue) {
            subscriber.next(defaultValue);
          }
          subscriber.complete();
        }));
      });
    }
    exports2.defaultIfEmpty = defaultIfEmpty;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/take.js
var require_take = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/take.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.take = void 0;
    var empty_1 = require_empty();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function take(count) {
      return count <= 0 ? function() {
        return empty_1.EMPTY;
      } : lift_1.operate(function(source, subscriber) {
        var seen = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          if (++seen <= count) {
            subscriber.next(value);
            if (count <= seen) {
              subscriber.complete();
            }
          }
        }));
      });
    }
    exports2.take = take;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js
var require_ignoreElements = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ignoreElements = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    function ignoreElements() {
      return lift_1.operate(function(source, subscriber) {
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, noop_1.noop));
      });
    }
    exports2.ignoreElements = ignoreElements;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mapTo.js
var require_mapTo = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mapTo.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mapTo = void 0;
    var map_1 = require_map();
    function mapTo(value) {
      return map_1.map(function() {
        return value;
      });
    }
    exports2.mapTo = mapTo;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js
var require_delayWhen = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.delayWhen = void 0;
    var concat_1 = require_concat();
    var take_1 = require_take();
    var ignoreElements_1 = require_ignoreElements();
    var mapTo_1 = require_mapTo();
    var mergeMap_1 = require_mergeMap();
    var innerFrom_1 = require_innerFrom();
    function delayWhen(delayDurationSelector, subscriptionDelay) {
      if (subscriptionDelay) {
        return function(source) {
          return concat_1.concat(subscriptionDelay.pipe(take_1.take(1), ignoreElements_1.ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
        };
      }
      return mergeMap_1.mergeMap(function(value, index) {
        return innerFrom_1.innerFrom(delayDurationSelector(value, index)).pipe(take_1.take(1), mapTo_1.mapTo(value));
      });
    }
    exports2.delayWhen = delayWhen;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/delay.js
var require_delay = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/delay.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.delay = void 0;
    var async_1 = require_async();
    var delayWhen_1 = require_delayWhen();
    var timer_1 = require_timer();
    function delay(due, scheduler) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      var duration = timer_1.timer(due, scheduler);
      return delayWhen_1.delayWhen(function() {
        return duration;
      });
    }
    exports2.delay = delay;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js
var require_dematerialize = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.dematerialize = void 0;
    var Notification_1 = require_Notification();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function dematerialize() {
      return lift_1.operate(function(source, subscriber) {
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(notification) {
          return Notification_1.observeNotification(notification, subscriber);
        }));
      });
    }
    exports2.dematerialize = dematerialize;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinct.js
var require_distinct = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinct.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.distinct = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    var innerFrom_1 = require_innerFrom();
    function distinct(keySelector, flushes) {
      return lift_1.operate(function(source, subscriber) {
        var distinctKeys = /* @__PURE__ */ new Set();
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var key = keySelector ? keySelector(value) : value;
          if (!distinctKeys.has(key)) {
            distinctKeys.add(key);
            subscriber.next(value);
          }
        }));
        flushes && innerFrom_1.innerFrom(flushes).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          return distinctKeys.clear();
        }, noop_1.noop));
      });
    }
    exports2.distinct = distinct;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js
var require_distinctUntilChanged = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.distinctUntilChanged = void 0;
    var identity_1 = require_identity();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function distinctUntilChanged(comparator, keySelector) {
      if (keySelector === void 0) {
        keySelector = identity_1.identity;
      }
      comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
      return lift_1.operate(function(source, subscriber) {
        var previousKey;
        var first = true;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var currentKey = keySelector(value);
          if (first || !comparator(previousKey, currentKey)) {
            first = false;
            previousKey = currentKey;
            subscriber.next(value);
          }
        }));
      });
    }
    exports2.distinctUntilChanged = distinctUntilChanged;
    function defaultCompare(a, b3) {
      return a === b3;
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js
var require_distinctUntilKeyChanged = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.distinctUntilKeyChanged = void 0;
    var distinctUntilChanged_1 = require_distinctUntilChanged();
    function distinctUntilKeyChanged(key, compare) {
      return distinctUntilChanged_1.distinctUntilChanged(function(x3, y3) {
        return compare ? compare(x3[key], y3[key]) : x3[key] === y3[key];
      });
    }
    exports2.distinctUntilKeyChanged = distinctUntilKeyChanged;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js
var require_throwIfEmpty = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.throwIfEmpty = void 0;
    var EmptyError_1 = require_EmptyError();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function throwIfEmpty(errorFactory) {
      if (errorFactory === void 0) {
        errorFactory = defaultErrorFactory;
      }
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          hasValue = true;
          subscriber.next(value);
        }, function() {
          return hasValue ? subscriber.complete() : subscriber.error(errorFactory());
        }));
      });
    }
    exports2.throwIfEmpty = throwIfEmpty;
    function defaultErrorFactory() {
      return new EmptyError_1.EmptyError();
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/elementAt.js
var require_elementAt = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/elementAt.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.elementAt = void 0;
    var ArgumentOutOfRangeError_1 = require_ArgumentOutOfRangeError();
    var filter_1 = require_filter();
    var throwIfEmpty_1 = require_throwIfEmpty();
    var defaultIfEmpty_1 = require_defaultIfEmpty();
    var take_1 = require_take();
    function elementAt(index, defaultValue) {
      if (index < 0) {
        throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError();
      }
      var hasDefaultValue = arguments.length >= 2;
      return function(source) {
        return source.pipe(filter_1.filter(function(v3, i3) {
          return i3 === index;
        }), take_1.take(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function() {
          return new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError();
        }));
      };
    }
    exports2.elementAt = elementAt;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/endWith.js
var require_endWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/endWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.endWith = void 0;
    var concat_1 = require_concat();
    var of_1 = require_of();
    function endWith() {
      var values = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        values[_i] = arguments[_i];
      }
      return function(source) {
        return concat_1.concat(source, of_1.of.apply(void 0, __spreadArray([], __read(values))));
      };
    }
    exports2.endWith = endWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/every.js
var require_every = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/every.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.every = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function every(predicate, thisArg) {
      return lift_1.operate(function(source, subscriber) {
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          if (!predicate.call(thisArg, value, index++, source)) {
            subscriber.next(false);
            subscriber.complete();
          }
        }, function() {
          subscriber.next(true);
          subscriber.complete();
        }));
      });
    }
    exports2.every = every;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js
var require_exhaustMap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.exhaustMap = void 0;
    var map_1 = require_map();
    var innerFrom_1 = require_innerFrom();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function exhaustMap(project, resultSelector) {
      if (resultSelector) {
        return function(source) {
          return source.pipe(exhaustMap(function(a, i3) {
            return innerFrom_1.innerFrom(project(a, i3)).pipe(map_1.map(function(b3, ii) {
              return resultSelector(a, b3, i3, ii);
            }));
          }));
        };
      }
      return lift_1.operate(function(source, subscriber) {
        var index = 0;
        var innerSub = null;
        var isComplete = false;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(outerValue) {
          if (!innerSub) {
            innerSub = OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
              innerSub = null;
              isComplete && subscriber.complete();
            });
            innerFrom_1.innerFrom(project(outerValue, index++)).subscribe(innerSub);
          }
        }, function() {
          isComplete = true;
          !innerSub && subscriber.complete();
        }));
      });
    }
    exports2.exhaustMap = exhaustMap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js
var require_exhaustAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.exhaustAll = void 0;
    var exhaustMap_1 = require_exhaustMap();
    var identity_1 = require_identity();
    function exhaustAll() {
      return exhaustMap_1.exhaustMap(identity_1.identity);
    }
    exports2.exhaustAll = exhaustAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaust.js
var require_exhaust = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.exhaust = void 0;
    var exhaustAll_1 = require_exhaustAll();
    exports2.exhaust = exhaustAll_1.exhaustAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/expand.js
var require_expand = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/expand.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.expand = void 0;
    var lift_1 = require_lift();
    var mergeInternals_1 = require_mergeInternals();
    function expand(project, concurrent, scheduler) {
      if (concurrent === void 0) {
        concurrent = Infinity;
      }
      concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
      return lift_1.operate(function(source, subscriber) {
        return mergeInternals_1.mergeInternals(source, subscriber, project, concurrent, void 0, true, scheduler);
      });
    }
    exports2.expand = expand;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/finalize.js
var require_finalize = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/finalize.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.finalize = void 0;
    var lift_1 = require_lift();
    function finalize(callback) {
      return lift_1.operate(function(source, subscriber) {
        try {
          source.subscribe(subscriber);
        } finally {
          subscriber.add(callback);
        }
      });
    }
    exports2.finalize = finalize;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/find.js
var require_find = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/find.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.createFind = exports2.find = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function find(predicate, thisArg) {
      return lift_1.operate(createFind(predicate, thisArg, "value"));
    }
    exports2.find = find;
    function createFind(predicate, thisArg, emit) {
      var findIndex = emit === "index";
      return function(source, subscriber) {
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var i3 = index++;
          if (predicate.call(thisArg, value, i3, source)) {
            subscriber.next(findIndex ? i3 : value);
            subscriber.complete();
          }
        }, function() {
          subscriber.next(findIndex ? -1 : void 0);
          subscriber.complete();
        }));
      };
    }
    exports2.createFind = createFind;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/findIndex.js
var require_findIndex = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/findIndex.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.findIndex = void 0;
    var lift_1 = require_lift();
    var find_1 = require_find();
    function findIndex(predicate, thisArg) {
      return lift_1.operate(find_1.createFind(predicate, thisArg, "index"));
    }
    exports2.findIndex = findIndex;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/first.js
var require_first = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/first.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.first = void 0;
    var EmptyError_1 = require_EmptyError();
    var filter_1 = require_filter();
    var take_1 = require_take();
    var defaultIfEmpty_1 = require_defaultIfEmpty();
    var throwIfEmpty_1 = require_throwIfEmpty();
    var identity_1 = require_identity();
    function first(predicate, defaultValue) {
      var hasDefaultValue = arguments.length >= 2;
      return function(source) {
        return source.pipe(predicate ? filter_1.filter(function(v3, i3) {
          return predicate(v3, i3, source);
        }) : identity_1.identity, take_1.take(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function() {
          return new EmptyError_1.EmptyError();
        }));
      };
    }
    exports2.first = first;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/groupBy.js
var require_groupBy = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.groupBy = void 0;
    var Observable_1 = require_Observable();
    var innerFrom_1 = require_innerFrom();
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function groupBy(keySelector, elementOrOptions, duration, connector) {
      return lift_1.operate(function(source, subscriber) {
        var element;
        if (!elementOrOptions || typeof elementOrOptions === "function") {
          element = elementOrOptions;
        } else {
          duration = elementOrOptions.duration, element = elementOrOptions.element, connector = elementOrOptions.connector;
        }
        var groups = /* @__PURE__ */ new Map();
        var notify = function(cb) {
          groups.forEach(cb);
          cb(subscriber);
        };
        var handleError = function(err) {
          return notify(function(consumer) {
            return consumer.error(err);
          });
        };
        var activeGroups = 0;
        var teardownAttempted = false;
        var groupBySourceSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
          try {
            var key_1 = keySelector(value);
            var group_1 = groups.get(key_1);
            if (!group_1) {
              groups.set(key_1, group_1 = connector ? connector() : new Subject_1.Subject());
              var grouped = createGroupedObservable(key_1, group_1);
              subscriber.next(grouped);
              if (duration) {
                var durationSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(group_1, function() {
                  group_1.complete();
                  durationSubscriber_1 === null || durationSubscriber_1 === void 0 ? void 0 : durationSubscriber_1.unsubscribe();
                }, void 0, void 0, function() {
                  return groups.delete(key_1);
                });
                groupBySourceSubscriber.add(innerFrom_1.innerFrom(duration(grouped)).subscribe(durationSubscriber_1));
              }
            }
            group_1.next(element ? element(value) : value);
          } catch (err) {
            handleError(err);
          }
        }, function() {
          return notify(function(consumer) {
            return consumer.complete();
          });
        }, handleError, function() {
          return groups.clear();
        }, function() {
          teardownAttempted = true;
          return activeGroups === 0;
        });
        source.subscribe(groupBySourceSubscriber);
        function createGroupedObservable(key, groupSubject) {
          var result = new Observable_1.Observable(function(groupSubscriber) {
            activeGroups++;
            var innerSub = groupSubject.subscribe(groupSubscriber);
            return function() {
              innerSub.unsubscribe();
              --activeGroups === 0 && teardownAttempted && groupBySourceSubscriber.unsubscribe();
            };
          });
          result.key = key;
          return result;
        }
      });
    }
    exports2.groupBy = groupBy;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js
var require_isEmpty = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isEmpty = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function isEmpty() {
      return lift_1.operate(function(source, subscriber) {
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          subscriber.next(false);
          subscriber.complete();
        }, function() {
          subscriber.next(true);
          subscriber.complete();
        }));
      });
    }
    exports2.isEmpty = isEmpty;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeLast.js
var require_takeLast = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeLast.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.takeLast = void 0;
    var empty_1 = require_empty();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function takeLast(count) {
      return count <= 0 ? function() {
        return empty_1.EMPTY;
      } : lift_1.operate(function(source, subscriber) {
        var buffer = [];
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          buffer.push(value);
          count < buffer.length && buffer.shift();
        }, function() {
          var e_1, _a;
          try {
            for (var buffer_1 = __values(buffer), buffer_1_1 = buffer_1.next(); !buffer_1_1.done; buffer_1_1 = buffer_1.next()) {
              var value = buffer_1_1.value;
              subscriber.next(value);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (buffer_1_1 && !buffer_1_1.done && (_a = buffer_1.return)) _a.call(buffer_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          subscriber.complete();
        }, void 0, function() {
          buffer = null;
        }));
      });
    }
    exports2.takeLast = takeLast;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/last.js
var require_last = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/last.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.last = void 0;
    var EmptyError_1 = require_EmptyError();
    var filter_1 = require_filter();
    var takeLast_1 = require_takeLast();
    var throwIfEmpty_1 = require_throwIfEmpty();
    var defaultIfEmpty_1 = require_defaultIfEmpty();
    var identity_1 = require_identity();
    function last(predicate, defaultValue) {
      var hasDefaultValue = arguments.length >= 2;
      return function(source) {
        return source.pipe(predicate ? filter_1.filter(function(v3, i3) {
          return predicate(v3, i3, source);
        }) : identity_1.identity, takeLast_1.takeLast(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function() {
          return new EmptyError_1.EmptyError();
        }));
      };
    }
    exports2.last = last;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/materialize.js
var require_materialize = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/materialize.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.materialize = void 0;
    var Notification_1 = require_Notification();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function materialize() {
      return lift_1.operate(function(source, subscriber) {
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          subscriber.next(Notification_1.Notification.createNext(value));
        }, function() {
          subscriber.next(Notification_1.Notification.createComplete());
          subscriber.complete();
        }, function(err) {
          subscriber.next(Notification_1.Notification.createError(err));
          subscriber.complete();
        }));
      });
    }
    exports2.materialize = materialize;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/max.js
var require_max = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/max.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.max = void 0;
    var reduce_1 = require_reduce();
    var isFunction_1 = require_isFunction();
    function max(comparer) {
      return reduce_1.reduce(isFunction_1.isFunction(comparer) ? function(x3, y3) {
        return comparer(x3, y3) > 0 ? x3 : y3;
      } : function(x3, y3) {
        return x3 > y3 ? x3 : y3;
      });
    }
    exports2.max = max;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/flatMap.js
var require_flatMap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/flatMap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.flatMap = void 0;
    var mergeMap_1 = require_mergeMap();
    exports2.flatMap = mergeMap_1.mergeMap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js
var require_mergeMapTo = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeMapTo = void 0;
    var mergeMap_1 = require_mergeMap();
    var isFunction_1 = require_isFunction();
    function mergeMapTo(innerObservable, resultSelector, concurrent) {
      if (concurrent === void 0) {
        concurrent = Infinity;
      }
      if (isFunction_1.isFunction(resultSelector)) {
        return mergeMap_1.mergeMap(function() {
          return innerObservable;
        }, resultSelector, concurrent);
      }
      if (typeof resultSelector === "number") {
        concurrent = resultSelector;
      }
      return mergeMap_1.mergeMap(function() {
        return innerObservable;
      }, concurrent);
    }
    exports2.mergeMapTo = mergeMapTo;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js
var require_mergeScan = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeScan = void 0;
    var lift_1 = require_lift();
    var mergeInternals_1 = require_mergeInternals();
    function mergeScan(accumulator, seed, concurrent) {
      if (concurrent === void 0) {
        concurrent = Infinity;
      }
      return lift_1.operate(function(source, subscriber) {
        var state = seed;
        return mergeInternals_1.mergeInternals(source, subscriber, function(value, index) {
          return accumulator(state, value, index);
        }, concurrent, function(value) {
          state = value;
        }, false, void 0, function() {
          return state = null;
        });
      });
    }
    exports2.mergeScan = mergeScan;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/merge.js
var require_merge2 = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/merge.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.merge = void 0;
    var lift_1 = require_lift();
    var mergeAll_1 = require_mergeAll();
    var args_1 = require_args();
    var from_1 = require_from();
    function merge() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(args);
      var concurrent = args_1.popNumber(args, Infinity);
      return lift_1.operate(function(source, subscriber) {
        mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
      });
    }
    exports2.merge = merge;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js
var require_mergeWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.mergeWith = void 0;
    var merge_1 = require_merge2();
    function mergeWith() {
      var otherSources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        otherSources[_i] = arguments[_i];
      }
      return merge_1.merge.apply(void 0, __spreadArray([], __read(otherSources)));
    }
    exports2.mergeWith = mergeWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/min.js
var require_min = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/min.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.min = void 0;
    var reduce_1 = require_reduce();
    var isFunction_1 = require_isFunction();
    function min(comparer) {
      return reduce_1.reduce(isFunction_1.isFunction(comparer) ? function(x3, y3) {
        return comparer(x3, y3) < 0 ? x3 : y3;
      } : function(x3, y3) {
        return x3 < y3 ? x3 : y3;
      });
    }
    exports2.min = min;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/multicast.js
var require_multicast = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/multicast.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.multicast = void 0;
    var ConnectableObservable_1 = require_ConnectableObservable();
    var isFunction_1 = require_isFunction();
    var connect_1 = require_connect();
    function multicast(subjectOrSubjectFactory, selector) {
      var subjectFactory = isFunction_1.isFunction(subjectOrSubjectFactory) ? subjectOrSubjectFactory : function() {
        return subjectOrSubjectFactory;
      };
      if (isFunction_1.isFunction(selector)) {
        return connect_1.connect(selector, {
          connector: subjectFactory
        });
      }
      return function(source) {
        return new ConnectableObservable_1.ConnectableObservable(source, subjectFactory);
      };
    }
    exports2.multicast = multicast;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js
var require_onErrorResumeNextWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.onErrorResumeNext = exports2.onErrorResumeNextWith = void 0;
    var argsOrArgArray_1 = require_argsOrArgArray();
    var onErrorResumeNext_1 = require_onErrorResumeNext();
    function onErrorResumeNextWith() {
      var sources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        sources[_i] = arguments[_i];
      }
      var nextSources = argsOrArgArray_1.argsOrArgArray(sources);
      return function(source) {
        return onErrorResumeNext_1.onErrorResumeNext.apply(void 0, __spreadArray([source], __read(nextSources)));
      };
    }
    exports2.onErrorResumeNextWith = onErrorResumeNextWith;
    exports2.onErrorResumeNext = onErrorResumeNextWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/pairwise.js
var require_pairwise = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/pairwise.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.pairwise = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function pairwise() {
      return lift_1.operate(function(source, subscriber) {
        var prev;
        var hasPrev = false;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var p = prev;
          prev = value;
          hasPrev && subscriber.next([p, value]);
          hasPrev = true;
        }));
      });
    }
    exports2.pairwise = pairwise;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/pluck.js
var require_pluck = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/pluck.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.pluck = void 0;
    var map_1 = require_map();
    function pluck() {
      var properties = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        properties[_i] = arguments[_i];
      }
      var length = properties.length;
      if (length === 0) {
        throw new Error("list of properties cannot be empty.");
      }
      return map_1.map(function(x3) {
        var currentProp = x3;
        for (var i3 = 0; i3 < length; i3++) {
          var p = currentProp === null || currentProp === void 0 ? void 0 : currentProp[properties[i3]];
          if (typeof p !== "undefined") {
            currentProp = p;
          } else {
            return void 0;
          }
        }
        return currentProp;
      });
    }
    exports2.pluck = pluck;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publish.js
var require_publish = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publish.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.publish = void 0;
    var Subject_1 = require_Subject();
    var multicast_1 = require_multicast();
    var connect_1 = require_connect();
    function publish(selector) {
      return selector ? function(source) {
        return connect_1.connect(selector)(source);
      } : function(source) {
        return multicast_1.multicast(new Subject_1.Subject())(source);
      };
    }
    exports2.publish = publish;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js
var require_publishBehavior = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.publishBehavior = void 0;
    var BehaviorSubject_1 = require_BehaviorSubject();
    var ConnectableObservable_1 = require_ConnectableObservable();
    function publishBehavior(initialValue) {
      return function(source) {
        var subject = new BehaviorSubject_1.BehaviorSubject(initialValue);
        return new ConnectableObservable_1.ConnectableObservable(source, function() {
          return subject;
        });
      };
    }
    exports2.publishBehavior = publishBehavior;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishLast.js
var require_publishLast = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishLast.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.publishLast = void 0;
    var AsyncSubject_1 = require_AsyncSubject();
    var ConnectableObservable_1 = require_ConnectableObservable();
    function publishLast() {
      return function(source) {
        var subject = new AsyncSubject_1.AsyncSubject();
        return new ConnectableObservable_1.ConnectableObservable(source, function() {
          return subject;
        });
      };
    }
    exports2.publishLast = publishLast;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js
var require_publishReplay = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.publishReplay = void 0;
    var ReplaySubject_1 = require_ReplaySubject();
    var multicast_1 = require_multicast();
    var isFunction_1 = require_isFunction();
    function publishReplay(bufferSize, windowTime, selectorOrScheduler, timestampProvider) {
      if (selectorOrScheduler && !isFunction_1.isFunction(selectorOrScheduler)) {
        timestampProvider = selectorOrScheduler;
      }
      var selector = isFunction_1.isFunction(selectorOrScheduler) ? selectorOrScheduler : void 0;
      return function(source) {
        return multicast_1.multicast(new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, timestampProvider), selector)(source);
      };
    }
    exports2.publishReplay = publishReplay;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/raceWith.js
var require_raceWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/raceWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.raceWith = void 0;
    var race_1 = require_race();
    var lift_1 = require_lift();
    var identity_1 = require_identity();
    function raceWith() {
      var otherSources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        otherSources[_i] = arguments[_i];
      }
      return !otherSources.length ? identity_1.identity : lift_1.operate(function(source, subscriber) {
        race_1.raceInit(__spreadArray([source], __read(otherSources)))(subscriber);
      });
    }
    exports2.raceWith = raceWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/repeat.js
var require_repeat = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/repeat.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.repeat = void 0;
    var empty_1 = require_empty();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    var timer_1 = require_timer();
    function repeat(countOrConfig) {
      var _a;
      var count = Infinity;
      var delay;
      if (countOrConfig != null) {
        if (typeof countOrConfig === "object") {
          _a = countOrConfig.count, count = _a === void 0 ? Infinity : _a, delay = countOrConfig.delay;
        } else {
          count = countOrConfig;
        }
      }
      return count <= 0 ? function() {
        return empty_1.EMPTY;
      } : lift_1.operate(function(source, subscriber) {
        var soFar = 0;
        var sourceSub;
        var resubscribe = function() {
          sourceSub === null || sourceSub === void 0 ? void 0 : sourceSub.unsubscribe();
          sourceSub = null;
          if (delay != null) {
            var notifier = typeof delay === "number" ? timer_1.timer(delay) : innerFrom_1.innerFrom(delay(soFar));
            var notifierSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
              notifierSubscriber_1.unsubscribe();
              subscribeToSource();
            });
            notifier.subscribe(notifierSubscriber_1);
          } else {
            subscribeToSource();
          }
        };
        var subscribeToSource = function() {
          var syncUnsub = false;
          sourceSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
            if (++soFar < count) {
              if (sourceSub) {
                resubscribe();
              } else {
                syncUnsub = true;
              }
            } else {
              subscriber.complete();
            }
          }));
          if (syncUnsub) {
            resubscribe();
          }
        };
        subscribeToSource();
      });
    }
    exports2.repeat = repeat;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js
var require_repeatWhen = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.repeatWhen = void 0;
    var innerFrom_1 = require_innerFrom();
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function repeatWhen(notifier) {
      return lift_1.operate(function(source, subscriber) {
        var innerSub;
        var syncResub = false;
        var completions$;
        var isNotifierComplete = false;
        var isMainComplete = false;
        var checkComplete = function() {
          return isMainComplete && isNotifierComplete && (subscriber.complete(), true);
        };
        var getCompletionSubject = function() {
          if (!completions$) {
            completions$ = new Subject_1.Subject();
            innerFrom_1.innerFrom(notifier(completions$)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
              if (innerSub) {
                subscribeForRepeatWhen();
              } else {
                syncResub = true;
              }
            }, function() {
              isNotifierComplete = true;
              checkComplete();
            }));
          }
          return completions$;
        };
        var subscribeForRepeatWhen = function() {
          isMainComplete = false;
          innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
            isMainComplete = true;
            !checkComplete() && getCompletionSubject().next();
          }));
          if (syncResub) {
            innerSub.unsubscribe();
            innerSub = null;
            syncResub = false;
            subscribeForRepeatWhen();
          }
        };
        subscribeForRepeatWhen();
      });
    }
    exports2.repeatWhen = repeatWhen;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/retry.js
var require_retry = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/retry.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.retry = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var identity_1 = require_identity();
    var timer_1 = require_timer();
    var innerFrom_1 = require_innerFrom();
    function retry(configOrCount) {
      if (configOrCount === void 0) {
        configOrCount = Infinity;
      }
      var config;
      if (configOrCount && typeof configOrCount === "object") {
        config = configOrCount;
      } else {
        config = {
          count: configOrCount
        };
      }
      var _a = config.count, count = _a === void 0 ? Infinity : _a, delay = config.delay, _b = config.resetOnSuccess, resetOnSuccess = _b === void 0 ? false : _b;
      return count <= 0 ? identity_1.identity : lift_1.operate(function(source, subscriber) {
        var soFar = 0;
        var innerSub;
        var subscribeForRetry = function() {
          var syncUnsub = false;
          innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
            if (resetOnSuccess) {
              soFar = 0;
            }
            subscriber.next(value);
          }, void 0, function(err) {
            if (soFar++ < count) {
              var resub_1 = function() {
                if (innerSub) {
                  innerSub.unsubscribe();
                  innerSub = null;
                  subscribeForRetry();
                } else {
                  syncUnsub = true;
                }
              };
              if (delay != null) {
                var notifier = typeof delay === "number" ? timer_1.timer(delay) : innerFrom_1.innerFrom(delay(err, soFar));
                var notifierSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
                  notifierSubscriber_1.unsubscribe();
                  resub_1();
                }, function() {
                  subscriber.complete();
                });
                notifier.subscribe(notifierSubscriber_1);
              } else {
                resub_1();
              }
            } else {
              subscriber.error(err);
            }
          }));
          if (syncUnsub) {
            innerSub.unsubscribe();
            innerSub = null;
            subscribeForRetry();
          }
        };
        subscribeForRetry();
      });
    }
    exports2.retry = retry;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js
var require_retryWhen = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.retryWhen = void 0;
    var innerFrom_1 = require_innerFrom();
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function retryWhen(notifier) {
      return lift_1.operate(function(source, subscriber) {
        var innerSub;
        var syncResub = false;
        var errors$;
        var subscribeForRetryWhen = function() {
          innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, function(err) {
            if (!errors$) {
              errors$ = new Subject_1.Subject();
              innerFrom_1.innerFrom(notifier(errors$)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
                return innerSub ? subscribeForRetryWhen() : syncResub = true;
              }));
            }
            if (errors$) {
              errors$.next(err);
            }
          }));
          if (syncResub) {
            innerSub.unsubscribe();
            innerSub = null;
            syncResub = false;
            subscribeForRetryWhen();
          }
        };
        subscribeForRetryWhen();
      });
    }
    exports2.retryWhen = retryWhen;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sample.js
var require_sample = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sample.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.sample = void 0;
    var innerFrom_1 = require_innerFrom();
    var lift_1 = require_lift();
    var noop_1 = require_noop();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function sample(notifier) {
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        var lastValue = null;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          hasValue = true;
          lastValue = value;
        }));
        innerFrom_1.innerFrom(notifier).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          if (hasValue) {
            hasValue = false;
            var value = lastValue;
            lastValue = null;
            subscriber.next(value);
          }
        }, noop_1.noop));
      });
    }
    exports2.sample = sample;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js
var require_sampleTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.sampleTime = void 0;
    var async_1 = require_async();
    var sample_1 = require_sample();
    var interval_1 = require_interval();
    function sampleTime(period, scheduler) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      return sample_1.sample(interval_1.interval(period, scheduler));
    }
    exports2.sampleTime = sampleTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/scan.js
var require_scan = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/scan.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.scan = void 0;
    var lift_1 = require_lift();
    var scanInternals_1 = require_scanInternals();
    function scan(accumulator, seed) {
      return lift_1.operate(scanInternals_1.scanInternals(accumulator, seed, arguments.length >= 2, true));
    }
    exports2.scan = scan;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js
var require_sequenceEqual = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.sequenceEqual = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function sequenceEqual(compareTo, comparator) {
      if (comparator === void 0) {
        comparator = function(a, b3) {
          return a === b3;
        };
      }
      return lift_1.operate(function(source, subscriber) {
        var aState = createState();
        var bState = createState();
        var emit = function(isEqual) {
          subscriber.next(isEqual);
          subscriber.complete();
        };
        var createSubscriber = function(selfState, otherState) {
          var sequenceEqualSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(a) {
            var buffer = otherState.buffer, complete = otherState.complete;
            if (buffer.length === 0) {
              complete ? emit(false) : selfState.buffer.push(a);
            } else {
              !comparator(a, buffer.shift()) && emit(false);
            }
          }, function() {
            selfState.complete = true;
            var complete = otherState.complete, buffer = otherState.buffer;
            complete && emit(buffer.length === 0);
            sequenceEqualSubscriber === null || sequenceEqualSubscriber === void 0 ? void 0 : sequenceEqualSubscriber.unsubscribe();
          });
          return sequenceEqualSubscriber;
        };
        source.subscribe(createSubscriber(aState, bState));
        innerFrom_1.innerFrom(compareTo).subscribe(createSubscriber(bState, aState));
      });
    }
    exports2.sequenceEqual = sequenceEqual;
    function createState() {
      return {
        buffer: [],
        complete: false
      };
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/share.js
var require_share = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/share.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.share = void 0;
    var innerFrom_1 = require_innerFrom();
    var Subject_1 = require_Subject();
    var Subscriber_1 = require_Subscriber();
    var lift_1 = require_lift();
    function share(options) {
      if (options === void 0) {
        options = {};
      }
      var _a = options.connector, connector = _a === void 0 ? function() {
        return new Subject_1.Subject();
      } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;
      return function(wrapperSource) {
        var connection;
        var resetConnection;
        var subject;
        var refCount = 0;
        var hasCompleted = false;
        var hasErrored = false;
        var cancelReset = function() {
          resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
          resetConnection = void 0;
        };
        var reset = function() {
          cancelReset();
          connection = subject = void 0;
          hasCompleted = hasErrored = false;
        };
        var resetAndUnsubscribe = function() {
          var conn = connection;
          reset();
          conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
        };
        return lift_1.operate(function(source, subscriber) {
          refCount++;
          if (!hasErrored && !hasCompleted) {
            cancelReset();
          }
          var dest = subject = subject !== null && subject !== void 0 ? subject : connector();
          subscriber.add(function() {
            refCount--;
            if (refCount === 0 && !hasErrored && !hasCompleted) {
              resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);
            }
          });
          dest.subscribe(subscriber);
          if (!connection && refCount > 0) {
            connection = new Subscriber_1.SafeSubscriber({
              next: function(value) {
                return dest.next(value);
              },
              error: function(err) {
                hasErrored = true;
                cancelReset();
                resetConnection = handleReset(reset, resetOnError, err);
                dest.error(err);
              },
              complete: function() {
                hasCompleted = true;
                cancelReset();
                resetConnection = handleReset(reset, resetOnComplete);
                dest.complete();
              }
            });
            innerFrom_1.innerFrom(source).subscribe(connection);
          }
        })(wrapperSource);
      };
    }
    exports2.share = share;
    function handleReset(reset, on) {
      var args = [];
      for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
      }
      if (on === true) {
        reset();
        return;
      }
      if (on === false) {
        return;
      }
      var onSubscriber = new Subscriber_1.SafeSubscriber({
        next: function() {
          onSubscriber.unsubscribe();
          reset();
        }
      });
      return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);
    }
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js
var require_shareReplay = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.shareReplay = void 0;
    var ReplaySubject_1 = require_ReplaySubject();
    var share_1 = require_share();
    function shareReplay(configOrBufferSize, windowTime, scheduler) {
      var _a, _b, _c;
      var bufferSize;
      var refCount = false;
      if (configOrBufferSize && typeof configOrBufferSize === "object") {
        _a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler;
      } else {
        bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;
      }
      return share_1.share({
        connector: function() {
          return new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler);
        },
        resetOnError: true,
        resetOnComplete: false,
        resetOnRefCountZero: refCount
      });
    }
    exports2.shareReplay = shareReplay;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/single.js
var require_single = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/single.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.single = void 0;
    var EmptyError_1 = require_EmptyError();
    var SequenceError_1 = require_SequenceError();
    var NotFoundError_1 = require_NotFoundError();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function single(predicate) {
      return lift_1.operate(function(source, subscriber) {
        var hasValue = false;
        var singleValue;
        var seenValue = false;
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          seenValue = true;
          if (!predicate || predicate(value, index++, source)) {
            hasValue && subscriber.error(new SequenceError_1.SequenceError("Too many matching values"));
            hasValue = true;
            singleValue = value;
          }
        }, function() {
          if (hasValue) {
            subscriber.next(singleValue);
            subscriber.complete();
          } else {
            subscriber.error(seenValue ? new NotFoundError_1.NotFoundError("No matching values") : new EmptyError_1.EmptyError());
          }
        }));
      });
    }
    exports2.single = single;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skip.js
var require_skip = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skip.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.skip = void 0;
    var filter_1 = require_filter();
    function skip(count) {
      return filter_1.filter(function(_, index) {
        return count <= index;
      });
    }
    exports2.skip = skip;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipLast.js
var require_skipLast = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipLast.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.skipLast = void 0;
    var identity_1 = require_identity();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function skipLast(skipCount) {
      return skipCount <= 0 ? identity_1.identity : lift_1.operate(function(source, subscriber) {
        var ring = new Array(skipCount);
        var seen = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var valueIndex = seen++;
          if (valueIndex < skipCount) {
            ring[valueIndex] = value;
          } else {
            var index = valueIndex % skipCount;
            var oldValue = ring[index];
            ring[index] = value;
            subscriber.next(oldValue);
          }
        }));
        return function() {
          ring = null;
        };
      });
    }
    exports2.skipLast = skipLast;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js
var require_skipUntil = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.skipUntil = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    var noop_1 = require_noop();
    function skipUntil(notifier) {
      return lift_1.operate(function(source, subscriber) {
        var taking = false;
        var skipSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          skipSubscriber === null || skipSubscriber === void 0 ? void 0 : skipSubscriber.unsubscribe();
          taking = true;
        }, noop_1.noop);
        innerFrom_1.innerFrom(notifier).subscribe(skipSubscriber);
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return taking && subscriber.next(value);
        }));
      });
    }
    exports2.skipUntil = skipUntil;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js
var require_skipWhile = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.skipWhile = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function skipWhile(predicate) {
      return lift_1.operate(function(source, subscriber) {
        var taking = false;
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return (taking || (taking = !predicate(value, index++))) && subscriber.next(value);
        }));
      });
    }
    exports2.skipWhile = skipWhile;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/startWith.js
var require_startWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/startWith.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.startWith = void 0;
    var concat_1 = require_concat();
    var args_1 = require_args();
    var lift_1 = require_lift();
    function startWith() {
      var values = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        values[_i] = arguments[_i];
      }
      var scheduler = args_1.popScheduler(values);
      return lift_1.operate(function(source, subscriber) {
        (scheduler ? concat_1.concat(values, source, scheduler) : concat_1.concat(values, source)).subscribe(subscriber);
      });
    }
    exports2.startWith = startWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js
var require_switchMap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchMap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.switchMap = void 0;
    var innerFrom_1 = require_innerFrom();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function switchMap(project, resultSelector) {
      return lift_1.operate(function(source, subscriber) {
        var innerSubscriber = null;
        var index = 0;
        var isComplete = false;
        var checkComplete = function() {
          return isComplete && !innerSubscriber && subscriber.complete();
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
          var innerIndex = 0;
          var outerIndex = index++;
          innerFrom_1.innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(innerValue) {
            return subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue);
          }, function() {
            innerSubscriber = null;
            checkComplete();
          }));
        }, function() {
          isComplete = true;
          checkComplete();
        }));
      });
    }
    exports2.switchMap = switchMap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchAll.js
var require_switchAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.switchAll = void 0;
    var switchMap_1 = require_switchMap();
    var identity_1 = require_identity();
    function switchAll() {
      return switchMap_1.switchMap(identity_1.identity);
    }
    exports2.switchAll = switchAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js
var require_switchMapTo = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.switchMapTo = void 0;
    var switchMap_1 = require_switchMap();
    var isFunction_1 = require_isFunction();
    function switchMapTo(innerObservable, resultSelector) {
      return isFunction_1.isFunction(resultSelector) ? switchMap_1.switchMap(function() {
        return innerObservable;
      }, resultSelector) : switchMap_1.switchMap(function() {
        return innerObservable;
      });
    }
    exports2.switchMapTo = switchMapTo;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchScan.js
var require_switchScan = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/switchScan.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.switchScan = void 0;
    var switchMap_1 = require_switchMap();
    var lift_1 = require_lift();
    function switchScan(accumulator, seed) {
      return lift_1.operate(function(source, subscriber) {
        var state = seed;
        switchMap_1.switchMap(function(value, index) {
          return accumulator(state, value, index);
        }, function(_, innerValue) {
          return state = innerValue, innerValue;
        })(source).subscribe(subscriber);
        return function() {
          state = null;
        };
      });
    }
    exports2.switchScan = switchScan;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js
var require_takeUntil = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.takeUntil = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    var noop_1 = require_noop();
    function takeUntil(notifier) {
      return lift_1.operate(function(source, subscriber) {
        innerFrom_1.innerFrom(notifier).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          return subscriber.complete();
        }, noop_1.noop));
        !subscriber.closed && source.subscribe(subscriber);
      });
    }
    exports2.takeUntil = takeUntil;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js
var require_takeWhile = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.takeWhile = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function takeWhile(predicate, inclusive) {
      if (inclusive === void 0) {
        inclusive = false;
      }
      return lift_1.operate(function(source, subscriber) {
        var index = 0;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var result = predicate(value, index++);
          (result || inclusive) && subscriber.next(value);
          !result && subscriber.complete();
        }));
      });
    }
    exports2.takeWhile = takeWhile;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/tap.js
var require_tap = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/tap.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.tap = void 0;
    var isFunction_1 = require_isFunction();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var identity_1 = require_identity();
    function tap(observerOrNext, error, complete) {
      var tapObserver = isFunction_1.isFunction(observerOrNext) || error || complete ? { next: observerOrNext, error, complete } : observerOrNext;
      return tapObserver ? lift_1.operate(function(source, subscriber) {
        var _a;
        (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
        var isUnsub = true;
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var _a2;
          (_a2 = tapObserver.next) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, value);
          subscriber.next(value);
        }, function() {
          var _a2;
          isUnsub = false;
          (_a2 = tapObserver.complete) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver);
          subscriber.complete();
        }, function(err) {
          var _a2;
          isUnsub = false;
          (_a2 = tapObserver.error) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, err);
          subscriber.error(err);
        }, function() {
          var _a2, _b;
          if (isUnsub) {
            (_a2 = tapObserver.unsubscribe) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver);
          }
          (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
        }));
      }) : identity_1.identity;
    }
    exports2.tap = tap;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throttle.js
var require_throttle = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throttle.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.throttle = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function throttle(durationSelector, config) {
      return lift_1.operate(function(source, subscriber) {
        var _a = config !== null && config !== void 0 ? config : {}, _b = _a.leading, leading = _b === void 0 ? true : _b, _c = _a.trailing, trailing = _c === void 0 ? false : _c;
        var hasValue = false;
        var sendValue = null;
        var throttled = null;
        var isComplete = false;
        var endThrottling = function() {
          throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();
          throttled = null;
          if (trailing) {
            send();
            isComplete && subscriber.complete();
          }
        };
        var cleanupThrottling = function() {
          throttled = null;
          isComplete && subscriber.complete();
        };
        var startThrottle = function(value) {
          return throttled = innerFrom_1.innerFrom(durationSelector(value)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling));
        };
        var send = function() {
          if (hasValue) {
            hasValue = false;
            var value = sendValue;
            sendValue = null;
            subscriber.next(value);
            !isComplete && startThrottle(value);
          }
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          hasValue = true;
          sendValue = value;
          !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));
        }, function() {
          isComplete = true;
          !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();
        }));
      });
    }
    exports2.throttle = throttle;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js
var require_throttleTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.throttleTime = void 0;
    var async_1 = require_async();
    var throttle_1 = require_throttle();
    var timer_1 = require_timer();
    function throttleTime(duration, scheduler, config) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      var duration$ = timer_1.timer(duration, scheduler);
      return throttle_1.throttle(function() {
        return duration$;
      }, config);
    }
    exports2.throttleTime = throttleTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js
var require_timeInterval = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.TimeInterval = exports2.timeInterval = void 0;
    var async_1 = require_async();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function timeInterval(scheduler) {
      if (scheduler === void 0) {
        scheduler = async_1.asyncScheduler;
      }
      return lift_1.operate(function(source, subscriber) {
        var last = scheduler.now();
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var now = scheduler.now();
          var interval = now - last;
          last = now;
          subscriber.next(new TimeInterval(value, interval));
        }));
      });
    }
    exports2.timeInterval = timeInterval;
    var TimeInterval = /* @__PURE__ */ function() {
      function TimeInterval2(value, interval) {
        this.value = value;
        this.interval = interval;
      }
      return TimeInterval2;
    }();
    exports2.TimeInterval = TimeInterval;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js
var require_timeoutWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.timeoutWith = void 0;
    var async_1 = require_async();
    var isDate_1 = require_isDate();
    var timeout_1 = require_timeout();
    function timeoutWith(due, withObservable, scheduler) {
      var first;
      var each;
      var _with;
      scheduler = scheduler !== null && scheduler !== void 0 ? scheduler : async_1.async;
      if (isDate_1.isValidDate(due)) {
        first = due;
      } else if (typeof due === "number") {
        each = due;
      }
      if (withObservable) {
        _with = function() {
          return withObservable;
        };
      } else {
        throw new TypeError("No observable provided to switch to");
      }
      if (first == null && each == null) {
        throw new TypeError("No timeout provided.");
      }
      return timeout_1.timeout({
        first,
        each,
        scheduler,
        with: _with
      });
    }
    exports2.timeoutWith = timeoutWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timestamp.js
var require_timestamp = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timestamp.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.timestamp = void 0;
    var dateTimestampProvider_1 = require_dateTimestampProvider();
    var map_1 = require_map();
    function timestamp(timestampProvider) {
      if (timestampProvider === void 0) {
        timestampProvider = dateTimestampProvider_1.dateTimestampProvider;
      }
      return map_1.map(function(value) {
        return { value, timestamp: timestampProvider.now() };
      });
    }
    exports2.timestamp = timestamp;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/window.js
var require_window = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/window.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.window = void 0;
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    var innerFrom_1 = require_innerFrom();
    function window2(windowBoundaries) {
      return lift_1.operate(function(source, subscriber) {
        var windowSubject = new Subject_1.Subject();
        subscriber.next(windowSubject.asObservable());
        var errorHandler = function(err) {
          windowSubject.error(err);
          subscriber.error(err);
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value);
        }, function() {
          windowSubject.complete();
          subscriber.complete();
        }, errorHandler));
        innerFrom_1.innerFrom(windowBoundaries).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
          windowSubject.complete();
          subscriber.next(windowSubject = new Subject_1.Subject());
        }, noop_1.noop, errorHandler));
        return function() {
          windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.unsubscribe();
          windowSubject = null;
        };
      });
    }
    exports2.window = window2;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowCount.js
var require_windowCount = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowCount.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.windowCount = void 0;
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    function windowCount(windowSize, startWindowEvery) {
      if (startWindowEvery === void 0) {
        startWindowEvery = 0;
      }
      var startEvery = startWindowEvery > 0 ? startWindowEvery : windowSize;
      return lift_1.operate(function(source, subscriber) {
        var windows = [new Subject_1.Subject()];
        var starts = [];
        var count = 0;
        subscriber.next(windows[0].asObservable());
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var e_1, _a;
          try {
            for (var windows_1 = __values(windows), windows_1_1 = windows_1.next(); !windows_1_1.done; windows_1_1 = windows_1.next()) {
              var window_1 = windows_1_1.value;
              window_1.next(value);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (windows_1_1 && !windows_1_1.done && (_a = windows_1.return)) _a.call(windows_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          var c3 = count - windowSize + 1;
          if (c3 >= 0 && c3 % startEvery === 0) {
            windows.shift().complete();
          }
          if (++count % startEvery === 0) {
            var window_2 = new Subject_1.Subject();
            windows.push(window_2);
            subscriber.next(window_2.asObservable());
          }
        }, function() {
          while (windows.length > 0) {
            windows.shift().complete();
          }
          subscriber.complete();
        }, function(err) {
          while (windows.length > 0) {
            windows.shift().error(err);
          }
          subscriber.error(err);
        }, function() {
          starts = null;
          windows = null;
        }));
      });
    }
    exports2.windowCount = windowCount;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowTime.js
var require_windowTime = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowTime.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.windowTime = void 0;
    var Subject_1 = require_Subject();
    var async_1 = require_async();
    var Subscription_1 = require_Subscription();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var arrRemove_1 = require_arrRemove();
    var args_1 = require_args();
    var executeSchedule_1 = require_executeSchedule();
    function windowTime(windowTimeSpan) {
      var _a, _b;
      var otherArgs = [];
      for (var _i = 1; _i < arguments.length; _i++) {
        otherArgs[_i - 1] = arguments[_i];
      }
      var scheduler = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler;
      var windowCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
      var maxWindowSize = otherArgs[1] || Infinity;
      return lift_1.operate(function(source, subscriber) {
        var windowRecords = [];
        var restartOnClose = false;
        var closeWindow = function(record) {
          var window2 = record.window, subs = record.subs;
          window2.complete();
          subs.unsubscribe();
          arrRemove_1.arrRemove(windowRecords, record);
          restartOnClose && startWindow();
        };
        var startWindow = function() {
          if (windowRecords) {
            var subs = new Subscription_1.Subscription();
            subscriber.add(subs);
            var window_1 = new Subject_1.Subject();
            var record_1 = {
              window: window_1,
              subs,
              seen: 0
            };
            windowRecords.push(record_1);
            subscriber.next(window_1.asObservable());
            executeSchedule_1.executeSchedule(subs, scheduler, function() {
              return closeWindow(record_1);
            }, windowTimeSpan);
          }
        };
        if (windowCreationInterval !== null && windowCreationInterval >= 0) {
          executeSchedule_1.executeSchedule(subscriber, scheduler, startWindow, windowCreationInterval, true);
        } else {
          restartOnClose = true;
        }
        startWindow();
        var loop = function(cb) {
          return windowRecords.slice().forEach(cb);
        };
        var terminate = function(cb) {
          loop(function(_a2) {
            var window2 = _a2.window;
            return cb(window2);
          });
          cb(subscriber);
          subscriber.unsubscribe();
        };
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          loop(function(record) {
            record.window.next(value);
            maxWindowSize <= ++record.seen && closeWindow(record);
          });
        }, function() {
          return terminate(function(consumer) {
            return consumer.complete();
          });
        }, function(err) {
          return terminate(function(consumer) {
            return consumer.error(err);
          });
        }));
        return function() {
          windowRecords = null;
        };
      });
    }
    exports2.windowTime = windowTime;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js
var require_windowToggle = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js"(exports2) {
    "use strict";
    var __values = exports2 && exports2.__values || function(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.windowToggle = void 0;
    var Subject_1 = require_Subject();
    var Subscription_1 = require_Subscription();
    var lift_1 = require_lift();
    var innerFrom_1 = require_innerFrom();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var noop_1 = require_noop();
    var arrRemove_1 = require_arrRemove();
    function windowToggle(openings, closingSelector) {
      return lift_1.operate(function(source, subscriber) {
        var windows = [];
        var handleError = function(err) {
          while (0 < windows.length) {
            windows.shift().error(err);
          }
          subscriber.error(err);
        };
        innerFrom_1.innerFrom(openings).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(openValue) {
          var window2 = new Subject_1.Subject();
          windows.push(window2);
          var closingSubscription = new Subscription_1.Subscription();
          var closeWindow = function() {
            arrRemove_1.arrRemove(windows, window2);
            window2.complete();
            closingSubscription.unsubscribe();
          };
          var closingNotifier;
          try {
            closingNotifier = innerFrom_1.innerFrom(closingSelector(openValue));
          } catch (err) {
            handleError(err);
            return;
          }
          subscriber.next(window2.asObservable());
          closingSubscription.add(closingNotifier.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, closeWindow, noop_1.noop, handleError)));
        }, noop_1.noop));
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          var e_1, _a;
          var windowsCopy = windows.slice();
          try {
            for (var windowsCopy_1 = __values(windowsCopy), windowsCopy_1_1 = windowsCopy_1.next(); !windowsCopy_1_1.done; windowsCopy_1_1 = windowsCopy_1.next()) {
              var window_1 = windowsCopy_1_1.value;
              window_1.next(value);
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (windowsCopy_1_1 && !windowsCopy_1_1.done && (_a = windowsCopy_1.return)) _a.call(windowsCopy_1);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
        }, function() {
          while (0 < windows.length) {
            windows.shift().complete();
          }
          subscriber.complete();
        }, handleError, function() {
          while (0 < windows.length) {
            windows.shift().unsubscribe();
          }
        }));
      });
    }
    exports2.windowToggle = windowToggle;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js
var require_windowWhen = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.windowWhen = void 0;
    var Subject_1 = require_Subject();
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    function windowWhen(closingSelector) {
      return lift_1.operate(function(source, subscriber) {
        var window2;
        var closingSubscriber;
        var handleError = function(err) {
          window2.error(err);
          subscriber.error(err);
        };
        var openWindow = function() {
          closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
          window2 === null || window2 === void 0 ? void 0 : window2.complete();
          window2 = new Subject_1.Subject();
          subscriber.next(window2.asObservable());
          var closingNotifier;
          try {
            closingNotifier = innerFrom_1.innerFrom(closingSelector());
          } catch (err) {
            handleError(err);
            return;
          }
          closingNotifier.subscribe(closingSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, openWindow, openWindow, handleError));
        };
        openWindow();
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          return window2.next(value);
        }, function() {
          window2.complete();
          subscriber.complete();
        }, handleError, function() {
          closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
          window2 = null;
        }));
      });
    }
    exports2.windowWhen = windowWhen;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js
var require_withLatestFrom = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.withLatestFrom = void 0;
    var lift_1 = require_lift();
    var OperatorSubscriber_1 = require_OperatorSubscriber();
    var innerFrom_1 = require_innerFrom();
    var identity_1 = require_identity();
    var noop_1 = require_noop();
    var args_1 = require_args();
    function withLatestFrom() {
      var inputs = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        inputs[_i] = arguments[_i];
      }
      var project = args_1.popResultSelector(inputs);
      return lift_1.operate(function(source, subscriber) {
        var len = inputs.length;
        var otherValues = new Array(len);
        var hasValue = inputs.map(function() {
          return false;
        });
        var ready = false;
        var _loop_1 = function(i5) {
          innerFrom_1.innerFrom(inputs[i5]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
            otherValues[i5] = value;
            if (!ready && !hasValue[i5]) {
              hasValue[i5] = true;
              (ready = hasValue.every(identity_1.identity)) && (hasValue = null);
            }
          }, noop_1.noop));
        };
        for (var i3 = 0; i3 < len; i3++) {
          _loop_1(i3);
        }
        source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
          if (ready) {
            var values = __spreadArray([value], __read(otherValues));
            subscriber.next(project ? project.apply(void 0, __spreadArray([], __read(values))) : values);
          }
        }));
      });
    }
    exports2.withLatestFrom = withLatestFrom;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zipAll.js
var require_zipAll = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zipAll.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.zipAll = void 0;
    var zip_1 = require_zip();
    var joinAllInternals_1 = require_joinAllInternals();
    function zipAll(project) {
      return joinAllInternals_1.joinAllInternals(zip_1.zip, project);
    }
    exports2.zipAll = zipAll;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zip.js
var require_zip2 = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zip.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.zip = void 0;
    var zip_1 = require_zip();
    var lift_1 = require_lift();
    function zip() {
      var sources = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        sources[_i] = arguments[_i];
      }
      return lift_1.operate(function(source, subscriber) {
        zip_1.zip.apply(void 0, __spreadArray([source], __read(sources))).subscribe(subscriber);
      });
    }
    exports2.zip = zip;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zipWith.js
var require_zipWith = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/zipWith.js"(exports2) {
    "use strict";
    var __read = exports2 && exports2.__read || function(o, n3) {
      var m = typeof Symbol === "function" && o[Symbol.iterator];
      if (!m) return o;
      var i3 = m.call(o), r3, ar = [], e3;
      try {
        while ((n3 === void 0 || n3-- > 0) && !(r3 = i3.next()).done) ar.push(r3.value);
      } catch (error) {
        e3 = { error };
      } finally {
        try {
          if (r3 && !r3.done && (m = i3["return"])) m.call(i3);
        } finally {
          if (e3) throw e3.error;
        }
      }
      return ar;
    };
    var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) {
      for (var i3 = 0, il = from.length, j3 = to.length; i3 < il; i3++, j3++)
        to[j3] = from[i3];
      return to;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.zipWith = void 0;
    var zip_1 = require_zip2();
    function zipWith() {
      var otherInputs = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        otherInputs[_i] = arguments[_i];
      }
      return zip_1.zip.apply(void 0, __spreadArray([], __read(otherInputs)));
    }
    exports2.zipWith = zipWith;
  }
});

// ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/index.js
var require_cjs = __commonJS({
  "../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/index.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k22) {
      if (k22 === void 0) k22 = k;
      Object.defineProperty(o, k22, { enumerable: true, get: function() {
        return m[k];
      } });
    } : function(o, m, k, k22) {
      if (k22 === void 0) k22 = k;
      o[k22] = m[k];
    });
    var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.interval = exports2.iif = exports2.generate = exports2.fromEventPattern = exports2.fromEvent = exports2.from = exports2.forkJoin = exports2.empty = exports2.defer = exports2.connectable = exports2.concat = exports2.combineLatest = exports2.bindNodeCallback = exports2.bindCallback = exports2.UnsubscriptionError = exports2.TimeoutError = exports2.SequenceError = exports2.ObjectUnsubscribedError = exports2.NotFoundError = exports2.EmptyError = exports2.ArgumentOutOfRangeError = exports2.firstValueFrom = exports2.lastValueFrom = exports2.isObservable = exports2.identity = exports2.noop = exports2.pipe = exports2.NotificationKind = exports2.Notification = exports2.Subscriber = exports2.Subscription = exports2.Scheduler = exports2.VirtualAction = exports2.VirtualTimeScheduler = exports2.animationFrameScheduler = exports2.animationFrame = exports2.queueScheduler = exports2.queue = exports2.asyncScheduler = exports2.async = exports2.asapScheduler = exports2.asap = exports2.AsyncSubject = exports2.ReplaySubject = exports2.BehaviorSubject = exports2.Subject = exports2.animationFrames = exports2.observable = exports2.ConnectableObservable = exports2.Observable = void 0;
    exports2.filter = exports2.expand = exports2.exhaustMap = exports2.exhaustAll = exports2.exhaust = exports2.every = exports2.endWith = exports2.elementAt = exports2.distinctUntilKeyChanged = exports2.distinctUntilChanged = exports2.distinct = exports2.dematerialize = exports2.delayWhen = exports2.delay = exports2.defaultIfEmpty = exports2.debounceTime = exports2.debounce = exports2.count = exports2.connect = exports2.concatWith = exports2.concatMapTo = exports2.concatMap = exports2.concatAll = exports2.combineLatestWith = exports2.combineLatestAll = exports2.combineAll = exports2.catchError = exports2.bufferWhen = exports2.bufferToggle = exports2.bufferTime = exports2.bufferCount = exports2.buffer = exports2.auditTime = exports2.audit = exports2.config = exports2.NEVER = exports2.EMPTY = exports2.scheduled = exports2.zip = exports2.using = exports2.timer = exports2.throwError = exports2.range = exports2.race = exports2.partition = exports2.pairs = exports2.onErrorResumeNext = exports2.of = exports2.never = exports2.merge = void 0;
    exports2.switchMap = exports2.switchAll = exports2.subscribeOn = exports2.startWith = exports2.skipWhile = exports2.skipUntil = exports2.skipLast = exports2.skip = exports2.single = exports2.shareReplay = exports2.share = exports2.sequenceEqual = exports2.scan = exports2.sampleTime = exports2.sample = exports2.refCount = exports2.retryWhen = exports2.retry = exports2.repeatWhen = exports2.repeat = exports2.reduce = exports2.raceWith = exports2.publishReplay = exports2.publishLast = exports2.publishBehavior = exports2.publish = exports2.pluck = exports2.pairwise = exports2.onErrorResumeNextWith = exports2.observeOn = exports2.multicast = exports2.min = exports2.mergeWith = exports2.mergeScan = exports2.mergeMapTo = exports2.mergeMap = exports2.flatMap = exports2.mergeAll = exports2.max = exports2.materialize = exports2.mapTo = exports2.map = exports2.last = exports2.isEmpty = exports2.ignoreElements = exports2.groupBy = exports2.first = exports2.findIndex = exports2.find = exports2.finalize = void 0;
    exports2.zipWith = exports2.zipAll = exports2.withLatestFrom = exports2.windowWhen = exports2.windowToggle = exports2.windowTime = exports2.windowCount = exports2.window = exports2.toArray = exports2.timestamp = exports2.timeoutWith = exports2.timeout = exports2.timeInterval = exports2.throwIfEmpty = exports2.throttleTime = exports2.throttle = exports2.tap = exports2.takeWhile = exports2.takeUntil = exports2.takeLast = exports2.take = exports2.switchScan = exports2.switchMapTo = void 0;
    var Observable_1 = require_Observable();
    Object.defineProperty(exports2, "Observable", { enumerable: true, get: function() {
      return Observable_1.Observable;
    } });
    var ConnectableObservable_1 = require_ConnectableObservable();
    Object.defineProperty(exports2, "ConnectableObservable", { enumerable: true, get: function() {
      return ConnectableObservable_1.ConnectableObservable;
    } });
    var observable_1 = require_observable();
    Object.defineProperty(exports2, "observable", { enumerable: true, get: function() {
      return observable_1.observable;
    } });
    var animationFrames_1 = require_animationFrames();
    Object.defineProperty(exports2, "animationFrames", { enumerable: true, get: function() {
      return animationFrames_1.animationFrames;
    } });
    var Subject_1 = require_Subject();
    Object.defineProperty(exports2, "Subject", { enumerable: true, get: function() {
      return Subject_1.Subject;
    } });
    var BehaviorSubject_1 = require_BehaviorSubject();
    Object.defineProperty(exports2, "BehaviorSubject", { enumerable: true, get: function() {
      return BehaviorSubject_1.BehaviorSubject;
    } });
    var ReplaySubject_1 = require_ReplaySubject();
    Object.defineProperty(exports2, "ReplaySubject", { enumerable: true, get: function() {
      return ReplaySubject_1.ReplaySubject;
    } });
    var AsyncSubject_1 = require_AsyncSubject();
    Object.defineProperty(exports2, "AsyncSubject", { enumerable: true, get: function() {
      return AsyncSubject_1.AsyncSubject;
    } });
    var asap_1 = require_asap();
    Object.defineProperty(exports2, "asap", { enumerable: true, get: function() {
      return asap_1.asap;
    } });
    Object.defineProperty(exports2, "asapScheduler", { enumerable: true, get: function() {
      return asap_1.asapScheduler;
    } });
    var async_1 = require_async();
    Object.defineProperty(exports2, "async", { enumerable: true, get: function() {
      return async_1.async;
    } });
    Object.defineProperty(exports2, "asyncScheduler", { enumerable: true, get: function() {
      return async_1.asyncScheduler;
    } });
    var queue_1 = require_queue();
    Object.defineProperty(exports2, "queue", { enumerable: true, get: function() {
      return queue_1.queue;
    } });
    Object.defineProperty(exports2, "queueScheduler", { enumerable: true, get: function() {
      return queue_1.queueScheduler;
    } });
    var animationFrame_1 = require_animationFrame();
    Object.defineProperty(exports2, "animationFrame", { enumerable: true, get: function() {
      return animationFrame_1.animationFrame;
    } });
    Object.defineProperty(exports2, "animationFrameScheduler", { enumerable: true, get: function() {
      return animationFrame_1.animationFrameScheduler;
    } });
    var VirtualTimeScheduler_1 = require_VirtualTimeScheduler();
    Object.defineProperty(exports2, "VirtualTimeScheduler", { enumerable: true, get: function() {
      return VirtualTimeScheduler_1.VirtualTimeScheduler;
    } });
    Object.defineProperty(exports2, "VirtualAction", { enumerable: true, get: function() {
      return VirtualTimeScheduler_1.VirtualAction;
    } });
    var Scheduler_1 = require_Scheduler();
    Object.defineProperty(exports2, "Scheduler", { enumerable: true, get: function() {
      return Scheduler_1.Scheduler;
    } });
    var Subscription_1 = require_Subscription();
    Object.defineProperty(exports2, "Subscription", { enumerable: true, get: function() {
      return Subscription_1.Subscription;
    } });
    var Subscriber_1 = require_Subscriber();
    Object.defineProperty(exports2, "Subscriber", { enumerable: true, get: function() {
      return Subscriber_1.Subscriber;
    } });
    var Notification_1 = require_Notification();
    Object.defineProperty(exports2, "Notification", { enumerable: true, get: function() {
      return Notification_1.Notification;
    } });
    Object.defineProperty(exports2, "NotificationKind", { enumerable: true, get: function() {
      return Notification_1.NotificationKind;
    } });
    var pipe_1 = require_pipe();
    Object.defineProperty(exports2, "pipe", { enumerable: true, get: function() {
      return pipe_1.pipe;
    } });
    var noop_1 = require_noop();
    Object.defineProperty(exports2, "noop", { enumerable: true, get: function() {
      return noop_1.noop;
    } });
    var identity_1 = require_identity();
    Object.defineProperty(exports2, "identity", { enumerable: true, get: function() {
      return identity_1.identity;
    } });
    var isObservable_1 = require_isObservable();
    Object.defineProperty(exports2, "isObservable", { enumerable: true, get: function() {
      return isObservable_1.isObservable;
    } });
    var lastValueFrom_1 = require_lastValueFrom();
    Object.defineProperty(exports2, "lastValueFrom", { enumerable: true, get: function() {
      return lastValueFrom_1.lastValueFrom;
    } });
    var firstValueFrom_1 = require_firstValueFrom();
    Object.defineProperty(exports2, "firstValueFrom", { enumerable: true, get: function() {
      return firstValueFrom_1.firstValueFrom;
    } });
    var ArgumentOutOfRangeError_1 = require_ArgumentOutOfRangeError();
    Object.defineProperty(exports2, "ArgumentOutOfRangeError", { enumerable: true, get: function() {
      return ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
    } });
    var EmptyError_1 = require_EmptyError();
    Object.defineProperty(exports2, "EmptyError", { enumerable: true, get: function() {
      return EmptyError_1.EmptyError;
    } });
    var NotFoundError_1 = require_NotFoundError();
    Object.defineProperty(exports2, "NotFoundError", { enumerable: true, get: function() {
      return NotFoundError_1.NotFoundError;
    } });
    var ObjectUnsubscribedError_1 = require_ObjectUnsubscribedError();
    Object.defineProperty(exports2, "ObjectUnsubscribedError", { enumerable: true, get: function() {
      return ObjectUnsubscribedError_1.ObjectUnsubscribedError;
    } });
    var SequenceError_1 = require_SequenceError();
    Object.defineProperty(exports2, "SequenceError", { enumerable: true, get: function() {
      return SequenceError_1.SequenceError;
    } });
    var timeout_1 = require_timeout();
    Object.defineProperty(exports2, "TimeoutError", { enumerable: true, get: function() {
      return timeout_1.TimeoutError;
    } });
    var UnsubscriptionError_1 = require_UnsubscriptionError();
    Object.defineProperty(exports2, "UnsubscriptionError", { enumerable: true, get: function() {
      return UnsubscriptionError_1.UnsubscriptionError;
    } });
    var bindCallback_1 = require_bindCallback();
    Object.defineProperty(exports2, "bindCallback", { enumerable: true, get: function() {
      return bindCallback_1.bindCallback;
    } });
    var bindNodeCallback_1 = require_bindNodeCallback();
    Object.defineProperty(exports2, "bindNodeCallback", { enumerable: true, get: function() {
      return bindNodeCallback_1.bindNodeCallback;
    } });
    var combineLatest_1 = require_combineLatest();
    Object.defineProperty(exports2, "combineLatest", { enumerable: true, get: function() {
      return combineLatest_1.combineLatest;
    } });
    var concat_1 = require_concat();
    Object.defineProperty(exports2, "concat", { enumerable: true, get: function() {
      return concat_1.concat;
    } });
    var connectable_1 = require_connectable();
    Object.defineProperty(exports2, "connectable", { enumerable: true, get: function() {
      return connectable_1.connectable;
    } });
    var defer_1 = require_defer();
    Object.defineProperty(exports2, "defer", { enumerable: true, get: function() {
      return defer_1.defer;
    } });
    var empty_1 = require_empty();
    Object.defineProperty(exports2, "empty", { enumerable: true, get: function() {
      return empty_1.empty;
    } });
    var forkJoin_1 = require_forkJoin();
    Object.defineProperty(exports2, "forkJoin", { enumerable: true, get: function() {
      return forkJoin_1.forkJoin;
    } });
    var from_1 = require_from();
    Object.defineProperty(exports2, "from", { enumerable: true, get: function() {
      return from_1.from;
    } });
    var fromEvent_1 = require_fromEvent();
    Object.defineProperty(exports2, "fromEvent", { enumerable: true, get: function() {
      return fromEvent_1.fromEvent;
    } });
    var fromEventPattern_1 = require_fromEventPattern();
    Object.defineProperty(exports2, "fromEventPattern", { enumerable: true, get: function() {
      return fromEventPattern_1.fromEventPattern;
    } });
    var generate_1 = require_generate();
    Object.defineProperty(exports2, "generate", { enumerable: true, get: function() {
      return generate_1.generate;
    } });
    var iif_1 = require_iif();
    Object.defineProperty(exports2, "iif", { enumerable: true, get: function() {
      return iif_1.iif;
    } });
    var interval_1 = require_interval();
    Object.defineProperty(exports2, "interval", { enumerable: true, get: function() {
      return interval_1.interval;
    } });
    var merge_1 = require_merge();
    Object.defineProperty(exports2, "merge", { enumerable: true, get: function() {
      return merge_1.merge;
    } });
    var never_1 = require_never();
    Object.defineProperty(exports2, "never", { enumerable: true, get: function() {
      return never_1.never;
    } });
    var of_1 = require_of();
    Object.defineProperty(exports2, "of", { enumerable: true, get: function() {
      return of_1.of;
    } });
    var onErrorResumeNext_1 = require_onErrorResumeNext();
    Object.defineProperty(exports2, "onErrorResumeNext", { enumerable: true, get: function() {
      return onErrorResumeNext_1.onErrorResumeNext;
    } });
    var pairs_1 = require_pairs();
    Object.defineProperty(exports2, "pairs", { enumerable: true, get: function() {
      return pairs_1.pairs;
    } });
    var partition_1 = require_partition();
    Object.defineProperty(exports2, "partition", { enumerable: true, get: function() {
      return partition_1.partition;
    } });
    var race_1 = require_race();
    Object.defineProperty(exports2, "race", { enumerable: true, get: function() {
      return race_1.race;
    } });
    var range_1 = require_range();
    Object.defineProperty(exports2, "range", { enumerable: true, get: function() {
      return range_1.range;
    } });
    var throwError_1 = require_throwError();
    Object.defineProperty(exports2, "throwError", { enumerable: true, get: function() {
      return throwError_1.throwError;
    } });
    var timer_1 = require_timer();
    Object.defineProperty(exports2, "timer", { enumerable: true, get: function() {
      return timer_1.timer;
    } });
    var using_1 = require_using();
    Object.defineProperty(exports2, "using", { enumerable: true, get: function() {
      return using_1.using;
    } });
    var zip_1 = require_zip();
    Object.defineProperty(exports2, "zip", { enumerable: true, get: function() {
      return zip_1.zip;
    } });
    var scheduled_1 = require_scheduled();
    Object.defineProperty(exports2, "scheduled", { enumerable: true, get: function() {
      return scheduled_1.scheduled;
    } });
    var empty_2 = require_empty();
    Object.defineProperty(exports2, "EMPTY", { enumerable: true, get: function() {
      return empty_2.EMPTY;
    } });
    var never_2 = require_never();
    Object.defineProperty(exports2, "NEVER", { enumerable: true, get: function() {
      return never_2.NEVER;
    } });
    __exportStar(require_types(), exports2);
    var config_1 = require_config();
    Object.defineProperty(exports2, "config", { enumerable: true, get: function() {
      return config_1.config;
    } });
    var audit_1 = require_audit();
    Object.defineProperty(exports2, "audit", { enumerable: true, get: function() {
      return audit_1.audit;
    } });
    var auditTime_1 = require_auditTime();
    Object.defineProperty(exports2, "auditTime", { enumerable: true, get: function() {
      return auditTime_1.auditTime;
    } });
    var buffer_1 = require_buffer();
    Object.defineProperty(exports2, "buffer", { enumerable: true, get: function() {
      return buffer_1.buffer;
    } });
    var bufferCount_1 = require_bufferCount();
    Object.defineProperty(exports2, "bufferCount", { enumerable: true, get: function() {
      return bufferCount_1.bufferCount;
    } });
    var bufferTime_1 = require_bufferTime();
    Object.defineProperty(exports2, "bufferTime", { enumerable: true, get: function() {
      return bufferTime_1.bufferTime;
    } });
    var bufferToggle_1 = require_bufferToggle();
    Object.defineProperty(exports2, "bufferToggle", { enumerable: true, get: function() {
      return bufferToggle_1.bufferToggle;
    } });
    var bufferWhen_1 = require_bufferWhen();
    Object.defineProperty(exports2, "bufferWhen", { enumerable: true, get: function() {
      return bufferWhen_1.bufferWhen;
    } });
    var catchError_1 = require_catchError();
    Object.defineProperty(exports2, "catchError", { enumerable: true, get: function() {
      return catchError_1.catchError;
    } });
    var combineAll_1 = require_combineAll();
    Object.defineProperty(exports2, "combineAll", { enumerable: true, get: function() {
      return combineAll_1.combineAll;
    } });
    var combineLatestAll_1 = require_combineLatestAll();
    Object.defineProperty(exports2, "combineLatestAll", { enumerable: true, get: function() {
      return combineLatestAll_1.combineLatestAll;
    } });
    var combineLatestWith_1 = require_combineLatestWith();
    Object.defineProperty(exports2, "combineLatestWith", { enumerable: true, get: function() {
      return combineLatestWith_1.combineLatestWith;
    } });
    var concatAll_1 = require_concatAll();
    Object.defineProperty(exports2, "concatAll", { enumerable: true, get: function() {
      return concatAll_1.concatAll;
    } });
    var concatMap_1 = require_concatMap();
    Object.defineProperty(exports2, "concatMap", { enumerable: true, get: function() {
      return concatMap_1.concatMap;
    } });
    var concatMapTo_1 = require_concatMapTo();
    Object.defineProperty(exports2, "concatMapTo", { enumerable: true, get: function() {
      return concatMapTo_1.concatMapTo;
    } });
    var concatWith_1 = require_concatWith();
    Object.defineProperty(exports2, "concatWith", { enumerable: true, get: function() {
      return concatWith_1.concatWith;
    } });
    var connect_1 = require_connect();
    Object.defineProperty(exports2, "connect", { enumerable: true, get: function() {
      return connect_1.connect;
    } });
    var count_1 = require_count();
    Object.defineProperty(exports2, "count", { enumerable: true, get: function() {
      return count_1.count;
    } });
    var debounce_1 = require_debounce();
    Object.defineProperty(exports2, "debounce", { enumerable: true, get: function() {
      return debounce_1.debounce;
    } });
    var debounceTime_1 = require_debounceTime();
    Object.defineProperty(exports2, "debounceTime", { enumerable: true, get: function() {
      return debounceTime_1.debounceTime;
    } });
    var defaultIfEmpty_1 = require_defaultIfEmpty();
    Object.defineProperty(exports2, "defaultIfEmpty", { enumerable: true, get: function() {
      return defaultIfEmpty_1.defaultIfEmpty;
    } });
    var delay_1 = require_delay();
    Object.defineProperty(exports2, "delay", { enumerable: true, get: function() {
      return delay_1.delay;
    } });
    var delayWhen_1 = require_delayWhen();
    Object.defineProperty(exports2, "delayWhen", { enumerable: true, get: function() {
      return delayWhen_1.delayWhen;
    } });
    var dematerialize_1 = require_dematerialize();
    Object.defineProperty(exports2, "dematerialize", { enumerable: true, get: function() {
      return dematerialize_1.dematerialize;
    } });
    var distinct_1 = require_distinct();
    Object.defineProperty(exports2, "distinct", { enumerable: true, get: function() {
      return distinct_1.distinct;
    } });
    var distinctUntilChanged_1 = require_distinctUntilChanged();
    Object.defineProperty(exports2, "distinctUntilChanged", { enumerable: true, get: function() {
      return distinctUntilChanged_1.distinctUntilChanged;
    } });
    var distinctUntilKeyChanged_1 = require_distinctUntilKeyChanged();
    Object.defineProperty(exports2, "distinctUntilKeyChanged", { enumerable: true, get: function() {
      return distinctUntilKeyChanged_1.distinctUntilKeyChanged;
    } });
    var elementAt_1 = require_elementAt();
    Object.defineProperty(exports2, "elementAt", { enumerable: true, get: function() {
      return elementAt_1.elementAt;
    } });
    var endWith_1 = require_endWith();
    Object.defineProperty(exports2, "endWith", { enumerable: true, get: function() {
      return endWith_1.endWith;
    } });
    var every_1 = require_every();
    Object.defineProperty(exports2, "every", { enumerable: true, get: function() {
      return every_1.every;
    } });
    var exhaust_1 = require_exhaust();
    Object.defineProperty(exports2, "exhaust", { enumerable: true, get: function() {
      return exhaust_1.exhaust;
    } });
    var exhaustAll_1 = require_exhaustAll();
    Object.defineProperty(exports2, "exhaustAll", { enumerable: true, get: function() {
      return exhaustAll_1.exhaustAll;
    } });
    var exhaustMap_1 = require_exhaustMap();
    Object.defineProperty(exports2, "exhaustMap", { enumerable: true, get: function() {
      return exhaustMap_1.exhaustMap;
    } });
    var expand_1 = require_expand();
    Object.defineProperty(exports2, "expand", { enumerable: true, get: function() {
      return expand_1.expand;
    } });
    var filter_1 = require_filter();
    Object.defineProperty(exports2, "filter", { enumerable: true, get: function() {
      return filter_1.filter;
    } });
    var finalize_1 = require_finalize();
    Object.defineProperty(exports2, "finalize", { enumerable: true, get: function() {
      return finalize_1.finalize;
    } });
    var find_1 = require_find();
    Object.defineProperty(exports2, "find", { enumerable: true, get: function() {
      return find_1.find;
    } });
    var findIndex_1 = require_findIndex();
    Object.defineProperty(exports2, "findIndex", { enumerable: true, get: function() {
      return findIndex_1.findIndex;
    } });
    var first_1 = require_first();
    Object.defineProperty(exports2, "first", { enumerable: true, get: function() {
      return first_1.first;
    } });
    var groupBy_1 = require_groupBy();
    Object.defineProperty(exports2, "groupBy", { enumerable: true, get: function() {
      return groupBy_1.groupBy;
    } });
    var ignoreElements_1 = require_ignoreElements();
    Object.defineProperty(exports2, "ignoreElements", { enumerable: true, get: function() {
      return ignoreElements_1.ignoreElements;
    } });
    var isEmpty_1 = require_isEmpty();
    Object.defineProperty(exports2, "isEmpty", { enumerable: true, get: function() {
      return isEmpty_1.isEmpty;
    } });
    var last_1 = require_last();
    Object.defineProperty(exports2, "last", { enumerable: true, get: function() {
      return last_1.last;
    } });
    var map_1 = require_map();
    Object.defineProperty(exports2, "map", { enumerable: true, get: function() {
      return map_1.map;
    } });
    var mapTo_1 = require_mapTo();
    Object.defineProperty(exports2, "mapTo", { enumerable: true, get: function() {
      return mapTo_1.mapTo;
    } });
    var materialize_1 = require_materialize();
    Object.defineProperty(exports2, "materialize", { enumerable: true, get: function() {
      return materialize_1.materialize;
    } });
    var max_1 = require_max();
    Object.defineProperty(exports2, "max", { enumerable: true, get: function() {
      return max_1.max;
    } });
    var mergeAll_1 = require_mergeAll();
    Object.defineProperty(exports2, "mergeAll", { enumerable: true, get: function() {
      return mergeAll_1.mergeAll;
    } });
    var flatMap_1 = require_flatMap();
    Object.defineProperty(exports2, "flatMap", { enumerable: true, get: function() {
      return flatMap_1.flatMap;
    } });
    var mergeMap_1 = require_mergeMap();
    Object.defineProperty(exports2, "mergeMap", { enumerable: true, get: function() {
      return mergeMap_1.mergeMap;
    } });
    var mergeMapTo_1 = require_mergeMapTo();
    Object.defineProperty(exports2, "mergeMapTo", { enumerable: true, get: function() {
      return mergeMapTo_1.mergeMapTo;
    } });
    var mergeScan_1 = require_mergeScan();
    Object.defineProperty(exports2, "mergeScan", { enumerable: true, get: function() {
      return mergeScan_1.mergeScan;
    } });
    var mergeWith_1 = require_mergeWith();
    Object.defineProperty(exports2, "mergeWith", { enumerable: true, get: function() {
      return mergeWith_1.mergeWith;
    } });
    var min_1 = require_min();
    Object.defineProperty(exports2, "min", { enumerable: true, get: function() {
      return min_1.min;
    } });
    var multicast_1 = require_multicast();
    Object.defineProperty(exports2, "multicast", { enumerable: true, get: function() {
      return multicast_1.multicast;
    } });
    var observeOn_1 = require_observeOn();
    Object.defineProperty(exports2, "observeOn", { enumerable: true, get: function() {
      return observeOn_1.observeOn;
    } });
    var onErrorResumeNextWith_1 = require_onErrorResumeNextWith();
    Object.defineProperty(exports2, "onErrorResumeNextWith", { enumerable: true, get: function() {
      return onErrorResumeNextWith_1.onErrorResumeNextWith;
    } });
    var pairwise_1 = require_pairwise();
    Object.defineProperty(exports2, "pairwise", { enumerable: true, get: function() {
      return pairwise_1.pairwise;
    } });
    var pluck_1 = require_pluck();
    Object.defineProperty(exports2, "pluck", { enumerable: true, get: function() {
      return pluck_1.pluck;
    } });
    var publish_1 = require_publish();
    Object.defineProperty(exports2, "publish", { enumerable: true, get: function() {
      return publish_1.publish;
    } });
    var publishBehavior_1 = require_publishBehavior();
    Object.defineProperty(exports2, "publishBehavior", { enumerable: true, get: function() {
      return publishBehavior_1.publishBehavior;
    } });
    var publishLast_1 = require_publishLast();
    Object.defineProperty(exports2, "publishLast", { enumerable: true, get: function() {
      return publishLast_1.publishLast;
    } });
    var publishReplay_1 = require_publishReplay();
    Object.defineProperty(exports2, "publishReplay", { enumerable: true, get: function() {
      return publishReplay_1.publishReplay;
    } });
    var raceWith_1 = require_raceWith();
    Object.defineProperty(exports2, "raceWith", { enumerable: true, get: function() {
      return raceWith_1.raceWith;
    } });
    var reduce_1 = require_reduce();
    Object.defineProperty(exports2, "reduce", { enumerable: true, get: function() {
      return reduce_1.reduce;
    } });
    var repeat_1 = require_repeat();
    Object.defineProperty(exports2, "repeat", { enumerable: true, get: function() {
      return repeat_1.repeat;
    } });
    var repeatWhen_1 = require_repeatWhen();
    Object.defineProperty(exports2, "repeatWhen", { enumerable: true, get: function() {
      return repeatWhen_1.repeatWhen;
    } });
    var retry_1 = require_retry();
    Object.defineProperty(exports2, "retry", { enumerable: true, get: function() {
      return retry_1.retry;
    } });
    var retryWhen_1 = require_retryWhen();
    Object.defineProperty(exports2, "retryWhen", { enumerable: true, get: function() {
      return retryWhen_1.retryWhen;
    } });
    var refCount_1 = require_refCount();
    Object.defineProperty(exports2, "refCount", { enumerable: true, get: function() {
      return refCount_1.refCount;
    } });
    var sample_1 = require_sample();
    Object.defineProperty(exports2, "sample", { enumerable: true, get: function() {
      return sample_1.sample;
    } });
    var sampleTime_1 = require_sampleTime();
    Object.defineProperty(exports2, "sampleTime", { enumerable: true, get: function() {
      return sampleTime_1.sampleTime;
    } });
    var scan_1 = require_scan();
    Object.defineProperty(exports2, "scan", { enumerable: true, get: function() {
      return scan_1.scan;
    } });
    var sequenceEqual_1 = require_sequenceEqual();
    Object.defineProperty(exports2, "sequenceEqual", { enumerable: true, get: function() {
      return sequenceEqual_1.sequenceEqual;
    } });
    var share_1 = require_share();
    Object.defineProperty(exports2, "share", { enumerable: true, get: function() {
      return share_1.share;
    } });
    var shareReplay_1 = require_shareReplay();
    Object.defineProperty(exports2, "shareReplay", { enumerable: true, get: function() {
      return shareReplay_1.shareReplay;
    } });
    var single_1 = require_single();
    Object.defineProperty(exports2, "single", { enumerable: true, get: function() {
      return single_1.single;
    } });
    var skip_1 = require_skip();
    Object.defineProperty(exports2, "skip", { enumerable: true, get: function() {
      return skip_1.skip;
    } });
    var skipLast_1 = require_skipLast();
    Object.defineProperty(exports2, "skipLast", { enumerable: true, get: function() {
      return skipLast_1.skipLast;
    } });
    var skipUntil_1 = require_skipUntil();
    Object.defineProperty(exports2, "skipUntil", { enumerable: true, get: function() {
      return skipUntil_1.skipUntil;
    } });
    var skipWhile_1 = require_skipWhile();
    Object.defineProperty(exports2, "skipWhile", { enumerable: true, get: function() {
      return skipWhile_1.skipWhile;
    } });
    var startWith_1 = require_startWith();
    Object.defineProperty(exports2, "startWith", { enumerable: true, get: function() {
      return startWith_1.startWith;
    } });
    var subscribeOn_1 = require_subscribeOn();
    Object.defineProperty(exports2, "subscribeOn", { enumerable: true, get: function() {
      return subscribeOn_1.subscribeOn;
    } });
    var switchAll_1 = require_switchAll();
    Object.defineProperty(exports2, "switchAll", { enumerable: true, get: function() {
      return switchAll_1.switchAll;
    } });
    var switchMap_1 = require_switchMap();
    Object.defineProperty(exports2, "switchMap", { enumerable: true, get: function() {
      return switchMap_1.switchMap;
    } });
    var switchMapTo_1 = require_switchMapTo();
    Object.defineProperty(exports2, "switchMapTo", { enumerable: true, get: function() {
      return switchMapTo_1.switchMapTo;
    } });
    var switchScan_1 = require_switchScan();
    Object.defineProperty(exports2, "switchScan", { enumerable: true, get: function() {
      return switchScan_1.switchScan;
    } });
    var take_1 = require_take();
    Object.defineProperty(exports2, "take", { enumerable: true, get: function() {
      return take_1.take;
    } });
    var takeLast_1 = require_takeLast();
    Object.defineProperty(exports2, "takeLast", { enumerable: true, get: function() {
      return takeLast_1.takeLast;
    } });
    var takeUntil_1 = require_takeUntil();
    Object.defineProperty(exports2, "takeUntil", { enumerable: true, get: function() {
      return takeUntil_1.takeUntil;
    } });
    var takeWhile_1 = require_takeWhile();
    Object.defineProperty(exports2, "takeWhile", { enumerable: true, get: function() {
      return takeWhile_1.takeWhile;
    } });
    var tap_1 = require_tap();
    Object.defineProperty(exports2, "tap", { enumerable: true, get: function() {
      return tap_1.tap;
    } });
    var throttle_1 = require_throttle();
    Object.defineProperty(exports2, "throttle", { enumerable: true, get: function() {
      return throttle_1.throttle;
    } });
    var throttleTime_1 = require_throttleTime();
    Object.defineProperty(exports2, "throttleTime", { enumerable: true, get: function() {
      return throttleTime_1.throttleTime;
    } });
    var throwIfEmpty_1 = require_throwIfEmpty();
    Object.defineProperty(exports2, "throwIfEmpty", { enumerable: true, get: function() {
      return throwIfEmpty_1.throwIfEmpty;
    } });
    var timeInterval_1 = require_timeInterval();
    Object.defineProperty(exports2, "timeInterval", { enumerable: true, get: function() {
      return timeInterval_1.timeInterval;
    } });
    var timeout_2 = require_timeout();
    Object.defineProperty(exports2, "timeout", { enumerable: true, get: function() {
      return timeout_2.timeout;
    } });
    var timeoutWith_1 = require_timeoutWith();
    Object.defineProperty(exports2, "timeoutWith", { enumerable: true, get: function() {
      return timeoutWith_1.timeoutWith;
    } });
    var timestamp_1 = require_timestamp();
    Object.defineProperty(exports2, "timestamp", { enumerable: true, get: function() {
      return timestamp_1.timestamp;
    } });
    var toArray_1 = require_toArray();
    Object.defineProperty(exports2, "toArray", { enumerable: true, get: function() {
      return toArray_1.toArray;
    } });
    var window_1 = require_window();
    Object.defineProperty(exports2, "window", { enumerable: true, get: function() {
      return window_1.window;
    } });
    var windowCount_1 = require_windowCount();
    Object.defineProperty(exports2, "windowCount", { enumerable: true, get: function() {
      return windowCount_1.windowCount;
    } });
    var windowTime_1 = require_windowTime();
    Object.defineProperty(exports2, "windowTime", { enumerable: true, get: function() {
      return windowTime_1.windowTime;
    } });
    var windowToggle_1 = require_windowToggle();
    Object.defineProperty(exports2, "windowToggle", { enumerable: true, get: function() {
      return windowToggle_1.windowToggle;
    } });
    var windowWhen_1 = require_windowWhen();
    Object.defineProperty(exports2, "windowWhen", { enumerable: true, get: function() {
      return windowWhen_1.windowWhen;
    } });
    var withLatestFrom_1 = require_withLatestFrom();
    Object.defineProperty(exports2, "withLatestFrom", { enumerable: true, get: function() {
      return withLatestFrom_1.withLatestFrom;
    } });
    var zipAll_1 = require_zipAll();
    Object.defineProperty(exports2, "zipAll", { enumerable: true, get: function() {
      return zipAll_1.zipAll;
    } });
    var zipWith_1 = require_zipWith();
    Object.defineProperty(exports2, "zipWith", { enumerable: true, get: function() {
      return zipWith_1.zipWith;
    } });
  }
});

// ../../../packages/types/dist/src/agent/index.js
function isStateEvent(event) {
  const stateTypes = [
    "conversation_queued",
    "conversation_start",
    "conversation_thinking",
    "conversation_responding",
    "conversation_end",
    "conversation_interrupted",
    "tool_planned",
    "tool_executing",
    "tool_completed",
    "tool_failed",
    "error_occurred"
  ];
  return stateTypes.includes(event.type);
}
var init_agent = __esm({
  "../../../packages/types/dist/src/agent/index.js"() {
    "use strict";
  }
});

// ../../../packages/agent/dist/index.js
function combineProcessors(processors) {
  return (state, event) => {
    const newState = {};
    const allOutputs = [];
    for (const key in processors) {
      const processor = processors[key];
      const subState = state[key];
      const [newSubState, outputs] = processor(subState, event);
      newState[key] = newSubState;
      allOutputs.push(...outputs);
    }
    return [newState, allOutputs];
  };
}
function combineInitialStates(initialStates) {
  return () => {
    const state = {};
    for (const key in initialStates) {
      state[key] = initialStates[key]();
    }
    return state;
  };
}
function createInitialMessageAssemblerState() {
  return {
    currentMessageId: null,
    messageStartTime: null,
    pendingContents: {},
    pendingToolCalls: {}
  };
}
function generateId() {
  return `msg_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
}
function handleMessageStart(state, event) {
  const data = event.data;
  return [
    {
      ...state,
      currentMessageId: data.messageId,
      messageStartTime: event.timestamp,
      pendingContents: {}
    },
    []
  ];
}
function handleTextDelta(state, event) {
  const data = event.data;
  const index = 0;
  const existingContent = state.pendingContents[index];
  const pendingContent = existingContent?.type === "text" ? {
    ...existingContent,
    textDeltas: [...existingContent.textDeltas || [], data.text]
  } : {
    type: "text",
    index,
    textDeltas: [data.text]
  };
  return [
    {
      ...state,
      pendingContents: {
        ...state.pendingContents,
        [index]: pendingContent
      }
    },
    []
  ];
}
function handleToolUseStart(state, event) {
  const data = event.data;
  const index = 1;
  const pendingContent = {
    type: "tool_use",
    index,
    toolId: data.toolCallId,
    toolName: data.toolName,
    toolInputJson: ""
  };
  return [
    {
      ...state,
      pendingContents: {
        ...state.pendingContents,
        [index]: pendingContent
      }
    },
    []
  ];
}
function handleInputJsonDelta(state, event) {
  const data = event.data;
  const index = 1;
  const existingContent = state.pendingContents[index];
  if (!existingContent || existingContent.type !== "tool_use") {
    return [state, []];
  }
  const pendingContent = {
    ...existingContent,
    toolInputJson: (existingContent.toolInputJson || "") + data.partialJson
  };
  return [
    {
      ...state,
      pendingContents: {
        ...state.pendingContents,
        [index]: pendingContent
      }
    },
    []
  ];
}
function handleToolUseStop(state, _event) {
  const index = 1;
  const pendingContent = state.pendingContents[index];
  if (!pendingContent || pendingContent.type !== "tool_use") {
    return [state, []];
  }
  const toolId = pendingContent.toolId || "";
  const toolName = pendingContent.toolName || "";
  let toolInput = {};
  try {
    toolInput = pendingContent.toolInputJson ? JSON.parse(pendingContent.toolInputJson) : {};
  } catch {
    toolInput = {};
  }
  const toolCall = {
    type: "tool-call",
    id: toolId,
    name: toolName,
    input: toolInput
  };
  const messageId = generateId();
  const timestamp = Date.now();
  const toolCallMessage = {
    id: messageId,
    role: "assistant",
    subtype: "tool-call",
    toolCall,
    timestamp,
    parentId: state.currentMessageId || void 0
  };
  const toolCallMessageEvent = {
    type: "tool_call_message",
    timestamp,
    data: toolCallMessage
  };
  const { [index]: _, ...remainingContents } = state.pendingContents;
  return [
    {
      ...state,
      pendingContents: remainingContents,
      pendingToolCalls: {
        ...state.pendingToolCalls,
        [toolId]: { id: toolId, name: toolName }
      }
    },
    [toolCallMessageEvent]
  ];
}
function handleToolResult(state, event) {
  const data = event.data;
  const { toolCallId, result, isError } = data;
  const pendingToolCall = state.pendingToolCalls[toolCallId];
  const toolName = pendingToolCall?.name || "unknown";
  const toolResult = {
    type: "tool-result",
    id: toolCallId,
    name: toolName,
    output: {
      type: isError ? "error-text" : "text",
      value: typeof result === "string" ? result : JSON.stringify(result)
    }
  };
  const messageId = generateId();
  const timestamp = Date.now();
  const toolResultMessage = {
    id: messageId,
    role: "tool",
    subtype: "tool-result",
    toolCallId,
    toolResult,
    timestamp
  };
  const toolResultMessageEvent = {
    type: "tool_result_message",
    timestamp,
    data: toolResultMessage
  };
  const { [toolCallId]: _, ...remainingToolCalls } = state.pendingToolCalls;
  return [
    {
      ...state,
      pendingToolCalls: remainingToolCalls
    },
    [toolResultMessageEvent]
  ];
}
function handleMessageStop(state, event) {
  const data = event.data;
  if (!state.currentMessageId) {
    return [state, []];
  }
  const textParts = [];
  const sortedContents = Object.values(state.pendingContents).sort((a, b3) => a.index - b3.index);
  for (const pending of sortedContents) {
    if (pending.type === "text" && pending.textDeltas) {
      textParts.push(pending.textDeltas.join(""));
    }
  }
  const textContent = textParts.join("");
  const stopReason = data.stopReason;
  if (!textContent || textContent.trim().length === 0) {
    const shouldPreserveToolCalls2 = stopReason === "tool_use";
    return [
      {
        ...createInitialMessageAssemblerState(),
        pendingToolCalls: shouldPreserveToolCalls2 ? state.pendingToolCalls : {}
      },
      []
    ];
  }
  const contentParts = [
    {
      type: "text",
      text: textContent
    }
  ];
  const timestamp = state.messageStartTime || Date.now();
  const assistantMessage = {
    id: state.currentMessageId,
    role: "assistant",
    subtype: "assistant",
    content: contentParts,
    timestamp
  };
  const assistantEvent = {
    type: "assistant_message",
    timestamp,
    data: assistantMessage
  };
  const shouldPreserveToolCalls = stopReason === "tool_use";
  return [
    {
      ...createInitialMessageAssemblerState(),
      pendingToolCalls: shouldPreserveToolCalls ? state.pendingToolCalls : {}
    },
    [assistantEvent]
  ];
}
function handleErrorReceived(_state, event) {
  const data = event.data;
  const messageId = generateId();
  const timestamp = Date.now();
  const errorMessage = {
    id: messageId,
    role: "error",
    subtype: "error",
    content: data.message,
    errorCode: data.errorCode,
    timestamp
  };
  const errorMessageEvent = {
    type: "error_message",
    timestamp,
    data: errorMessage
  };
  return [createInitialMessageAssemblerState(), [errorMessageEvent]];
}
function createInitialStateEventProcessorContext() {
  return {};
}
function handleMessageStart2(context, event) {
  const data = event.data;
  const conversationStartEvent = {
    type: "conversation_start",
    timestamp: Date.now(),
    data: {
      messageId: data.messageId
    }
  };
  return [context, [conversationStartEvent]];
}
function handleMessageDelta(context) {
  return [context, []];
}
function handleMessageStop2(context, event) {
  const data = event.data;
  const stopReason = data.stopReason;
  logger22.info("message_stop received", { stopReason });
  if (stopReason === "tool_use") {
    logger22.info("Skipping conversation_end (tool_use in progress)");
    return [context, []];
  }
  logger22.info("Emitting conversation_end", { stopReason });
  const conversationEndEvent = {
    type: "conversation_end",
    timestamp: Date.now(),
    data: {
      reason: "completed"
    }
  };
  return [context, [conversationEndEvent]];
}
function handleTextDelta2(context) {
  const respondingEvent = {
    type: "conversation_responding",
    timestamp: Date.now(),
    data: {}
  };
  return [context, [respondingEvent]];
}
function handleToolUseStart2(context, event) {
  const data = event.data;
  const outputs = [];
  const toolPlannedEvent = {
    type: "tool_planned",
    timestamp: Date.now(),
    data: {
      toolId: data.toolCallId,
      toolName: data.toolName
    }
  };
  outputs.push(toolPlannedEvent);
  const toolExecutingEvent = {
    type: "tool_executing",
    timestamp: Date.now(),
    data: {
      toolId: data.toolCallId,
      toolName: data.toolName,
      input: {}
    }
  };
  outputs.push(toolExecutingEvent);
  return [context, outputs];
}
function handleToolUseStop2(context) {
  return [context, []];
}
function handleErrorReceived2(context, event) {
  const data = event.data;
  const errorOccurredEvent = {
    type: "error_occurred",
    timestamp: Date.now(),
    data: {
      code: data.errorCode || "unknown_error",
      message: data.message,
      recoverable: true
    }
  };
  return [context, [errorOccurredEvent]];
}
function createInitialTurnTrackerState() {
  return {
    pendingTurn: null,
    costPerInputToken: 3e-6,
    costPerOutputToken: 15e-6
  };
}
function generateId2() {
  return `turn_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
}
function handleUserMessage(state, event) {
  const data = event.data;
  const turnId = generateId2();
  const contentText = typeof data.content === "string" ? data.content : "";
  const pendingTurn = {
    turnId,
    messageId: data.id,
    content: contentText,
    requestedAt: event.timestamp
  };
  const turnRequestEvent = {
    type: "turn_request",
    timestamp: Date.now(),
    data: {
      turnId,
      messageId: data.id,
      content: contentText,
      timestamp: event.timestamp
    }
  };
  return [
    {
      ...state,
      pendingTurn
    },
    [turnRequestEvent]
  ];
}
function handleMessageStop3(state, event) {
  if (!state.pendingTurn) {
    return [state, []];
  }
  const data = event.data;
  const stopReason = data.stopReason;
  if (stopReason === "end_turn" || stopReason === "max_tokens" || stopReason === "stop_sequence") {
    return completeTurn(state, event.timestamp);
  }
  return [state, []];
}
function completeTurn(state, completedAt) {
  if (!state.pendingTurn) {
    return [state, []];
  }
  const { turnId, messageId, requestedAt } = state.pendingTurn;
  const duration = completedAt - requestedAt;
  const usage = { inputTokens: 0, outputTokens: 0 };
  const turnResponseEvent = {
    type: "turn_response",
    timestamp: Date.now(),
    data: {
      turnId,
      messageId,
      duration,
      usage,
      timestamp: completedAt
    }
  };
  return [
    {
      ...state,
      pendingTurn: null
    },
    [turnResponseEvent]
  ];
}
function generateAgentId() {
  return `agent_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
}
function createAgent(options) {
  return new SimpleAgent(options);
}
var MemoryStore, logger3, messageAssemblerProcessor, logger22, stateEventProcessor, turnTrackerProcessor, agentProcessor, createInitialAgentEngineState, logger32, MealyMachine, logger4, AgentStateMachine, logger5, SimpleMessageQueue, SimpleAgent;
var init_dist2 = __esm({
  "../../../packages/agent/dist/index.js"() {
    init_dist();
    init_dist();
    init_dist();
    init_agent();
    init_dist();
    init_dist();
    MemoryStore = class {
      states = /* @__PURE__ */ new Map();
      get(id) {
        return this.states.get(id);
      }
      set(id, state) {
        this.states.set(id, state);
      }
      delete(id) {
        this.states.delete(id);
      }
      has(id) {
        return this.states.has(id);
      }
      clear() {
        this.states.clear();
      }
      get size() {
        return this.states.size;
      }
      keys() {
        return this.states.keys();
      }
    };
    logger3 = createLogger("engine/Mealy");
    messageAssemblerProcessor = (state, input) => {
      switch (input.type) {
        case "message_start":
          return handleMessageStart(state, input);
        case "text_delta":
          return handleTextDelta(state, input);
        case "tool_use_start":
          return handleToolUseStart(state, input);
        case "input_json_delta":
          return handleInputJsonDelta(state, input);
        case "tool_use_stop":
          return handleToolUseStop(state, input);
        case "tool_result":
          return handleToolResult(state, input);
        case "message_stop":
          return handleMessageStop(state, input);
        case "error_received":
          return handleErrorReceived(state, input);
        default:
          return [state, []];
      }
    };
    logger22 = createLogger("engine/stateEventProcessor");
    stateEventProcessor = (context, input) => {
      logger22.debug(`[Stream Event] ${input.type}`, {
        context,
        eventData: "data" in input ? input.data : void 0
      });
      switch (input.type) {
        case "message_start":
          return handleMessageStart2(context, input);
        case "message_delta":
          return handleMessageDelta(context);
        case "message_stop":
          return handleMessageStop2(context, input);
        case "text_delta":
          return handleTextDelta2(context);
        case "tool_use_start":
          return handleToolUseStart2(context, input);
        case "tool_use_stop":
          return handleToolUseStop2(context);
        case "error_received":
          return handleErrorReceived2(context, input);
        default:
          logger22.debug(`[Stream Event] ${input.type} (unhandled)`);
          return [context, []];
      }
    };
    turnTrackerProcessor = (state, input) => {
      switch (input.type) {
        case "user_message":
          return handleUserMessage(state, input);
        case "message_stop":
          return handleMessageStop3(state, input);
        case "assistant_message":
          return [state, []];
        default:
          return [state, []];
      }
    };
    agentProcessor = combineProcessors({
      messageAssembler: messageAssemblerProcessor,
      stateEventProcessor,
      turnTracker: turnTrackerProcessor
    });
    createInitialAgentEngineState = combineInitialStates({
      messageAssembler: createInitialMessageAssemblerState,
      stateEventProcessor: createInitialStateEventProcessorContext,
      turnTracker: createInitialTurnTrackerState
    });
    logger32 = createLogger("engine/MealyMachine");
    MealyMachine = class {
      store;
      constructor() {
        this.store = new MemoryStore();
        logger32.debug("MealyMachine initialized");
      }
      process(agentId, event) {
        const eventType = event.type || "unknown";
        logger32.debug("Processing event", { agentId, eventType });
        const isNewState = !this.store.has(agentId);
        let state = this.store.get(agentId) ?? createInitialAgentEngineState();
        if (isNewState) {
          logger32.debug("Created initial state for agent", { agentId });
        }
        const allOutputs = [];
        allOutputs.push(event);
        const [newState, outputs] = agentProcessor(state, event);
        state = newState;
        for (const output of outputs) {
          allOutputs.push(output);
          const [chainedState, chainedOutputs] = this.processChained(state, output);
          state = chainedState;
          allOutputs.push(...chainedOutputs);
        }
        this.store.set(agentId, state);
        if (outputs.length > 0) {
          logger32.debug("Produced outputs", {
            agentId,
            inputEvent: eventType,
            outputCount: allOutputs.length,
            processorOutputs: outputs.length
          });
        }
        return allOutputs;
      }
      processChained(state, event) {
        const [newState, outputs] = agentProcessor(state, event);
        if (outputs.length === 0) {
          return [newState, []];
        }
        const allOutputs = [...outputs];
        let currentState = newState;
        for (const output of outputs) {
          const [chainedState, chainedOutputs] = this.processChained(currentState, output);
          currentState = chainedState;
          allOutputs.push(...chainedOutputs);
        }
        return [currentState, allOutputs];
      }
      clearState(agentId) {
        logger32.debug("Clearing state", { agentId });
        this.store.delete(agentId);
      }
      hasState(agentId) {
        return this.store.has(agentId);
      }
    };
    logger4 = createLogger("agent/AgentStateMachine");
    AgentStateMachine = class {
      _state = "idle";
      handlers = /* @__PURE__ */ new Set();
      get state() {
        return this._state;
      }
      process(event) {
        if (!isStateEvent(event)) {
          return;
        }
        const prev = this._state;
        const next = this.mapEventToState(event);
        if (next !== null && prev !== next) {
          this._state = next;
          logger4.debug("State transition", {
            eventType: event.type,
            from: prev,
            to: next
          });
          this.notifyHandlers({ prev, current: next });
        }
      }
      onStateChange(handler) {
        this.handlers.add(handler);
        return () => {
          this.handlers.delete(handler);
        };
      }
      reset() {
        const prev = this._state;
        this._state = "idle";
        if (prev !== "idle") {
          this.notifyHandlers({ prev, current: "idle" });
        }
        this.handlers.clear();
      }
      mapEventToState(event) {
        switch (event.type) {
          case "conversation_start":
            return "thinking";
          case "conversation_thinking":
            return "thinking";
          case "conversation_responding":
            return "responding";
          case "conversation_end":
            return "idle";
          case "conversation_interrupted":
            return "idle";
          case "tool_planned":
            return "planning_tool";
          case "tool_executing":
            return "awaiting_tool_result";
          case "tool_completed":
            return "responding";
          case "tool_failed":
            return "responding";
          case "error_occurred":
            return "error";
          default:
            return null;
        }
      }
      notifyHandlers(change) {
        for (const handler of this.handlers) {
          try {
            handler(change);
          } catch (error) {
            logger4.error("State change handler error", {
              from: change.prev,
              to: change.current,
              error
            });
          }
        }
      }
    };
    logger5 = createLogger("agent/SimpleAgent");
    SimpleMessageQueue = class {
      queue = [];
      get length() {
        return this.queue.length;
      }
      get isEmpty() {
        return this.queue.length === 0;
      }
      enqueue(message) {
        this.queue.push(message);
      }
      dequeue() {
        return this.queue.shift();
      }
      clear() {
        this.queue = [];
      }
    };
    SimpleAgent = class {
      agentId;
      createdAt;
      messageQueue;
      _messageQueue = new SimpleMessageQueue();
      driver;
      presenter;
      machine;
      stateMachine;
      handlers = /* @__PURE__ */ new Set();
      typeHandlers = /* @__PURE__ */ new Map();
      readyHandlers = /* @__PURE__ */ new Set();
      destroyHandlers = /* @__PURE__ */ new Set();
      middlewares = [];
      interceptors = [];
      isProcessing = false;
      constructor(options) {
        this.agentId = generateAgentId();
        this.createdAt = Date.now();
        this.messageQueue = this._messageQueue;
        this.driver = options.driver;
        this.presenter = options.presenter;
        this.machine = new MealyMachine();
        this.stateMachine = new AgentStateMachine();
      }
      get state() {
        return this.stateMachine.state;
      }
      async receive(message) {
        console.log("[SimpleAgent.receive] CALLED with message:", typeof message === "string" ? message : message.content);
        const userMessage = typeof message === "string" ? {
          id: `msg_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
          role: "user",
          subtype: "user",
          content: message,
          timestamp: Date.now()
        } : message;
        this._messageQueue.enqueue(userMessage);
        console.log("[SimpleAgent.receive] Message queued, isProcessing:", this.isProcessing);
        if (this.isProcessing) {
          return new Promise((resolve4, reject) => {
            userMessage._resolve = resolve4;
            userMessage._reject = reject;
          });
        }
        console.log("[SimpleAgent.receive] Starting processQueue");
        await this.processQueue();
      }
      async processQueue() {
        if (this.isProcessing)
          return;
        this.isProcessing = true;
        console.log("[SimpleAgent.processQueue] Starting, queue size:", this._messageQueue.length);
        while (!this._messageQueue.isEmpty) {
          const message = this._messageQueue.dequeue();
          if (!message)
            break;
          console.log("[SimpleAgent.processQueue] Processing message:", message.id);
          try {
            await this.processMessage(message);
            if (message._resolve) {
              message._resolve();
            }
          } catch (error) {
            if (message._reject) {
              message._reject(error);
            }
            throw error;
          }
        }
        this.isProcessing = false;
        console.log("[SimpleAgent.processQueue] Finished");
      }
      async processMessage(message) {
        console.log("[SimpleAgent.processMessage] START, message:", message.id);
        let processedMessage = message;
        for (const middleware of this.middlewares) {
          let nextCalled = false;
          await middleware(processedMessage, async (msg) => {
            nextCalled = true;
            processedMessage = msg;
          });
          if (!nextCalled) {
            console.log("[SimpleAgent.processMessage] Middleware blocked message");
            return;
          }
        }
        console.log("[SimpleAgent.processMessage] Getting driver stream...");
        const driverStream = this.driver.receive(processedMessage);
        console.log("[SimpleAgent.processMessage] Driver stream:", driverStream);
        try {
          console.log("[SimpleAgent.processMessage] Starting for-await loop...");
          for await (const streamEvent of driverStream) {
            this.handleStreamEvent(streamEvent);
          }
          console.log("[SimpleAgent.processMessage] For-await loop completed");
        } catch (error) {
          console.log("[SimpleAgent.processMessage] ERROR:", error);
          throw error;
        }
        console.log("[SimpleAgent.processMessage] END");
      }
      handleStreamEvent(event) {
        logger5.info("handleStreamEvent", { type: event.type });
        const outputs = this.machine.process(this.agentId, event);
        logger5.info("MealyMachine outputs", {
          count: outputs.length,
          types: outputs.map((o) => o.type)
        });
        for (const output of outputs) {
          this.stateMachine.process(output);
          this.emitOutput(output);
        }
      }
      emitOutput(output) {
        let currentOutput = output;
        const runInterceptor = (index, out) => {
          if (index >= this.interceptors.length) {
            currentOutput = out;
            return;
          }
          this.interceptors[index](out, (nextOut) => {
            runInterceptor(index + 1, nextOut);
          });
        };
        runInterceptor(0, output);
        if (!currentOutput)
          return;
        this.presenter.present(this.agentId, currentOutput);
        for (const handler of this.handlers) {
          try {
            handler(currentOutput);
          } catch (e3) {
            console.error("Event handler error:", e3);
          }
        }
        const typeSet = this.typeHandlers.get(currentOutput.type);
        if (typeSet) {
          for (const handler of typeSet) {
            try {
              handler(currentOutput);
            } catch (e3) {
              console.error("Event handler error:", e3);
            }
          }
        }
      }
      on(typeOrHandler, handler) {
        if (typeof typeOrHandler === "function") {
          this.handlers.add(typeOrHandler);
          return () => this.handlers.delete(typeOrHandler);
        }
        if (typeof typeOrHandler === "object" && !Array.isArray(typeOrHandler)) {
          const unsubscribes = [];
          for (const [type, h22] of Object.entries(typeOrHandler)) {
            if (h22) {
              unsubscribes.push(this.on(type, h22));
            }
          }
          return () => unsubscribes.forEach((u) => u());
        }
        const types = Array.isArray(typeOrHandler) ? typeOrHandler : [typeOrHandler];
        const h3 = handler;
        for (const type of types) {
          if (!this.typeHandlers.has(type)) {
            this.typeHandlers.set(type, /* @__PURE__ */ new Set());
          }
          this.typeHandlers.get(type).add(h3);
        }
        return () => {
          for (const type of types) {
            this.typeHandlers.get(type)?.delete(h3);
          }
        };
      }
      onStateChange(handler) {
        return this.stateMachine.onStateChange(handler);
      }
      react(handlers) {
        const eventHandlerMap = {};
        for (const [key, handler] of Object.entries(handlers)) {
          if (handler && key.startsWith("on")) {
            const eventType = key.slice(2).replace(/([A-Z])/g, "_$1").toLowerCase().slice(1);
            eventHandlerMap[eventType] = handler;
          }
        }
        return this.on(eventHandlerMap);
      }
      onReady(handler) {
        try {
          handler();
        } catch (e3) {
          console.error("onReady handler error:", e3);
        }
        this.readyHandlers.add(handler);
        return () => this.readyHandlers.delete(handler);
      }
      onDestroy(handler) {
        this.destroyHandlers.add(handler);
        return () => this.destroyHandlers.delete(handler);
      }
      use(middleware) {
        this.middlewares.push(middleware);
        return () => {
          const index = this.middlewares.indexOf(middleware);
          if (index >= 0) {
            this.middlewares.splice(index, 1);
          }
        };
      }
      intercept(interceptor) {
        this.interceptors.push(interceptor);
        return () => {
          const index = this.interceptors.indexOf(interceptor);
          if (index >= 0) {
            this.interceptors.splice(index, 1);
          }
        };
      }
      interrupt() {
        if (this.state === "idle") {
          return;
        }
        this.driver.interrupt();
      }
      async destroy() {
        if (this.state !== "idle") {
          this.interrupt();
        }
        for (const handler of this.destroyHandlers) {
          try {
            handler();
          } catch (e3) {
            console.error("onDestroy handler error:", e3);
          }
        }
        this.machine.clearState(this.agentId);
        this.stateMachine.reset();
        this._messageQueue.clear();
        this.handlers.clear();
        this.typeHandlers.clear();
        this.readyHandlers.clear();
        this.destroyHandlers.clear();
        this.middlewares.length = 0;
        this.interceptors.length = 0;
      }
    };
  }
});

// ../../../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.2.31_zod@4.3.5/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
function F6(X = UK) {
  let Q = new AbortController();
  return (0, import_events.setMaxListeners)(X, Q.signal), Q;
}
function DK(X) {
  var Q = NK.call(X, e6), $ = X[e6];
  try {
    X[e6] = void 0;
    var Y = true;
  } catch (J) {
  }
  var W = OK.call(X);
  if (Y) if (Q) X[e6] = $;
  else delete X[e6];
  return W;
}
function MK(X) {
  return wK.call(X);
}
function IK(X) {
  if (X == null) return X === void 0 ? RK : jK;
  return D7 && D7 in Object(X) ? N7(X) : O7(X);
}
function EK(X) {
  var Q = typeof X;
  return X != null && (Q == "object" || Q == "function");
}
function CK(X) {
  if (!z4(X)) return false;
  var Q = A7(X);
  return Q == PK || Q == SK || Q == bK || Q == ZK;
}
function vK(X) {
  return !!M7 && M7 in X;
}
function xK(X) {
  if (X != null) {
    try {
      return _K.call(X);
    } catch (Q) {
    }
    try {
      return X + "";
    } catch (Q) {
    }
  }
  return "";
}
function cK(X) {
  if (!z4(X) || j7(X)) return false;
  var Q = w7(X) ? mK : gK;
  return Q.test(R7(X));
}
function pK(X, Q) {
  return X == null ? void 0 : X[Q];
}
function dK(X, Q) {
  var $ = E7(X, Q);
  return I7($) ? $ : void 0;
}
function nK() {
  this.__data__ = q1 ? q1(null) : {}, this.size = 0;
}
function rK(X) {
  var Q = this.has(X) && delete this.__data__[X];
  return this.size -= Q ? 1 : 0, Q;
}
function sK(X) {
  var Q = this.__data__;
  if (q1) {
    var $ = Q[X];
    return $ === oK ? void 0 : $;
  }
  return aK.call(Q, X) ? Q[X] : void 0;
}
function QU(X) {
  var Q = this.__data__;
  return q1 ? Q[X] !== void 0 : XU.call(Q, X);
}
function YU(X, Q) {
  var $ = this.__data__;
  return this.size += this.has(X) ? 0 : 1, $[X] = q1 && Q === void 0 ? $U : Q, this;
}
function D6(X) {
  var Q = -1, $ = X == null ? 0 : X.length;
  this.clear();
  while (++Q < $) {
    var Y = X[Q];
    this.set(Y[0], Y[1]);
  }
}
function WU() {
  this.__data__ = [], this.size = 0;
}
function JU(X, Q) {
  return X === Q || X !== X && Q !== Q;
}
function GU(X, Q) {
  var $ = X.length;
  while ($--) if (v7(X[$][0], Q)) return $;
  return -1;
}
function zU(X) {
  var Q = this.__data__, $ = Z1(Q, X);
  if ($ < 0) return false;
  var Y = Q.length - 1;
  if ($ == Y) Q.pop();
  else BU.call(Q, $, 1);
  return --this.size, true;
}
function KU(X) {
  var Q = this.__data__, $ = Z1(Q, X);
  return $ < 0 ? void 0 : Q[$][1];
}
function UU(X) {
  return Z1(this.__data__, X) > -1;
}
function VU(X, Q) {
  var $ = this.__data__, Y = Z1($, X);
  if (Y < 0) ++this.size, $.push([X, Q]);
  else $[Y][1] = Q;
  return this;
}
function A6(X) {
  var Q = -1, $ = X == null ? 0 : X.length;
  this.clear();
  while (++Q < $) {
    var Y = X[Q];
    this.set(Y[0], Y[1]);
  }
}
function qU() {
  this.size = 0, this.__data__ = { hash: new W9(), map: new (f7 || g7)(), string: new W9() };
}
function FU(X) {
  var Q = typeof X;
  return Q == "string" || Q == "number" || Q == "symbol" || Q == "boolean" ? X !== "__proto__" : X === null;
}
function NU(X, Q) {
  var $ = X.__data__;
  return u7(Q) ? $[typeof Q == "string" ? "string" : "hash"] : $.map;
}
function OU(X) {
  var Q = C1(this, X).delete(X);
  return this.size -= Q ? 1 : 0, Q;
}
function DU(X) {
  return C1(this, X).get(X);
}
function AU(X) {
  return C1(this, X).has(X);
}
function wU(X, Q) {
  var $ = C1(this, X), Y = $.size;
  return $.set(X, Q), this.size += $.size == Y ? 0 : 1, this;
}
function w6(X) {
  var Q = -1, $ = X == null ? 0 : X.length;
  this.clear();
  while (++Q < $) {
    var Y = X[Q];
    this.set(Y[0], Y[1]);
  }
}
function G9(X, Q) {
  if (typeof X != "function" || Q != null && typeof Q != "function") throw TypeError(MU);
  var $ = function() {
    var Y = arguments, W = Q ? Q.apply(this, Y) : Y[0], J = $.cache;
    if (J.has(W)) return J.get(W);
    var G = X.apply(this, Y);
    return $.cache = J.set(W, G) || J, G;
  };
  return $.cache = new (G9.Cache || J9)(), $;
}
function jU(X, Q) {
  if (X.destroyed) return;
  X.write(Q);
}
function d7(X) {
  jU(process.stderr, X);
}
function RU(X) {
  let Q = [], $ = X.match(/^MCP server ["']([^"']+)["']/);
  if ($ && $[1]) Q.push("mcp"), Q.push($[1].toLowerCase());
  else {
    let J = X.match(/^([^:[]+):/);
    if (J && J[1]) Q.push(J[1].trim().toLowerCase());
  }
  let Y = X.match(/^\[([^\]]+)]/);
  if (Y && Y[1]) Q.push(Y[1].trim().toLowerCase());
  if (X.toLowerCase().includes("1p event:")) Q.push("1p");
  let W = X.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);
  if (W && W[1]) {
    let J = W[1].trim().toLowerCase();
    if (J.length < 30 && !J.includes(" ")) Q.push(J);
  }
  return Array.from(new Set(Q));
}
function IU(X, Q) {
  if (!Q) return true;
  if (X.length === 0) return false;
  if (Q.isExclusive) return !X.some(($) => Q.exclude.includes($));
  else return X.some(($) => Q.include.includes($));
}
function n7(X, Q) {
  if (!Q) return true;
  let $ = RU(X);
  return IU($, Q);
}
function V4() {
  return process.env.CLAUDE_CONFIG_DIR ?? (0, import_path2.join)((0, import_os.homedir)(), ".claude");
}
function H9(X) {
  if (!X) return false;
  if (typeof X === "boolean") return X;
  let Q = X.toLowerCase().trim();
  return ["1", "true", "yes", "on"].includes(Q);
}
function r7(X) {
  return { name: X, default: 3e4, validate: (Q) => {
    if (!Q) return { effective: 3e4, status: "valid" };
    let $ = parseInt(Q, 10);
    if (isNaN($) || $ <= 0) return { effective: 3e4, status: "invalid", message: `Invalid value "${Q}" (using default: 30000)` };
    if ($ > 15e4) return { effective: 15e4, status: "capped", message: `Capped from ${$} to 150000` };
    return { effective: $, status: "valid" };
  } };
}
function ZU() {
  let X = "";
  if (typeof process < "u" && typeof process.cwd === "function" && typeof import_fs.realpathSync === "function") X = (0, import_fs.realpathSync)((0, import_process.cwd)());
  return { originalCwd: X, projectRoot: X, totalCostUSD: 0, totalAPIDuration: 0, totalAPIDurationWithoutRetries: 0, totalToolDuration: 0, startTime: Date.now(), lastInteractionTime: Date.now(), totalLinesAdded: 0, totalLinesRemoved: 0, hasUnknownModelCost: false, cwd: X, modelUsage: {}, mainLoopModelOverride: void 0, initialMainLoopModel: null, modelStrings: null, isInteractive: false, clientType: "cli", sessionIngressToken: void 0, oauthTokenFromFd: void 0, apiKeyFromFd: void 0, flagSettingsPath: void 0, allowedSettingSources: ["userSettings", "projectSettings", "localSettings", "flagSettings", "policySettings"], meter: null, sessionCounter: null, locCounter: null, prCounter: null, commitCounter: null, costCounter: null, tokenCounter: null, codeEditToolDecisionCounter: null, activeTimeCounter: null, sessionId: (0, import_crypto.randomUUID)(), parentSessionId: void 0, loggerProvider: null, eventLogger: null, meterProvider: null, tracerProvider: null, agentColorMap: /* @__PURE__ */ new Map(), agentColorIndex: 0, envVarValidators: [o7, t7], lastAPIRequest: null, inMemoryErrorLog: [], inlinePlugins: [], useCoworkPlugins: false, sessionBypassPermissionsMode: false, sessionTrustAccepted: false, sessionPersistenceDisabled: false, hasExitedPlanMode: false, needsPlanModeExitAttachment: false, hasExitedDelegateMode: false, needsDelegateModeExitAttachment: false, lspRecommendationShownThisSession: false, initJsonSchema: null, registeredHooks: null, planSlugCache: /* @__PURE__ */ new Map(), teleportedSessionInfo: null, invokedSkills: /* @__PURE__ */ new Map(), slowOperations: [], promptCacheBreaks: [], sdkBetas: void 0, mainThreadAgentType: void 0, isRemoteMode: false, directConnectServerUrl: void 0, additionalDirectoriesForClaudeMd: [], resumedTranscriptPath: null };
}
function s7() {
  return CU.sessionId;
}
function e7({ writeFn: X, flushIntervalMs: Q = 1e3, maxBufferSize: $ = 100, immediateMode: Y = false }) {
  let W = [], J = null;
  function G() {
    if (J) clearTimeout(J), J = null;
  }
  function H() {
    if (W.length === 0) return;
    X(W.join("")), W = [], G();
  }
  function B() {
    if (!J) J = setTimeout(H, Q);
  }
  return { write(z) {
    if (Y) {
      X(z);
      return;
    }
    if (W.push(z), B(), W.length >= $) H();
  }, flush: H, dispose() {
    H();
  } };
}
function QW(X) {
  return XW.add(X), () => XW.delete(X);
}
function kU(X) {
  if (X === null) return "null";
  if (X === void 0) return "undefined";
  if (Array.isArray(X)) return `Array[${X.length}]`;
  if (typeof X === "object") return `Object{${Object.keys(X).length} keys}`;
  if (typeof X === "string") return `string(${X.length} chars)`;
  return typeof X;
}
function $W(X, Q) {
  let $ = performance.now();
  try {
    return Q();
  } finally {
    performance.now() - $ > B9;
  }
}
function Z0(X, Q, $) {
  let Y = kU(X);
  return $W(`JSON.stringify(${Y})`, () => JSON.stringify(X, Q, $));
}
function _U(X) {
  if (typeof process > "u" || typeof process.versions > "u" || typeof process.versions.node > "u") return false;
  let Q = TU();
  return n7(X, Q);
}
function yU() {
  if (!q4) q4 = e7({ writeFn: (X) => {
    let Q = GW();
    if (!n0().existsSync((0, import_path3.dirname)(Q))) n0().mkdirSync((0, import_path3.dirname)(Q));
    n0().appendFileSync(Q, X), gU();
  }, flushIntervalMs: 1e3, maxBufferSize: 100, immediateMode: vU() }), QW(async () => q4?.dispose());
  return q4;
}
function v1(X, { level: Q } = { level: "debug" }) {
  if (!_U(X)) return;
  if (xU && X.includes(`
`)) X = Z0(X);
  let Y = `${(/* @__PURE__ */ new Date()).toISOString()} [${Q.toUpperCase()}] ${X.trim()}
`;
  if (WW()) {
    d7(Y);
    return;
  }
  yU().write(Y);
}
function GW() {
  return JW() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? (0, import_path3.join)(V4(), "debug", `${s7()}.txt`);
}
function F0(X, Q) {
  let $ = performance.now();
  try {
    return Q();
  } finally {
    performance.now() - $ > B9;
  }
}
function n0() {
  return dU;
}
function M6() {
  return process.versions.bun !== void 0;
}
function sU() {
  if (BW) return F4;
  if (BW = true, !process.env.DEBUG_CLAUDE_AGENT_SDK) return null;
  let X = (0, import_path4.join)(V4(), "debug");
  if (F4 = (0, import_path4.join)(X, `sdk-${(0, import_crypto2.randomUUID)()}.txt`), !(0, import_fs2.existsSync)(X)) (0, import_fs2.mkdirSync)(X, { recursive: true });
  return process.stderr.write(`SDK debug logs: ${F4}
`), F4;
}
function N1(X) {
  let Q = sU();
  if (!Q) return;
  let Y = `${(/* @__PURE__ */ new Date()).toISOString()} ${X}
`;
  (0, import_fs2.appendFileSync)(Q, Y);
}
function zW(X, Q) {
  let $ = { ...X };
  if (Q) {
    let Y = { sandbox: Q };
    if ($.settings) try {
      Y = { ...L4($.settings), sandbox: Q };
    } catch {
    }
    $.settings = Z0(Y);
  }
  return $;
}
function QV(X) {
  return ![".js", ".mjs", ".tsx", ".ts", ".jsx"].some(($) => X.endsWith($));
}
function YX() {
  return JV;
}
function b(X, Q) {
  let $ = YX(), Y = N4({ issueData: Q, data: X.data, path: X.path, errorMaps: [X.common.contextualErrorMap, X.schemaErrorMap, $, $ === T1 ? void 0 : T1].filter((W) => !!W) });
  X.common.issues.push(Y);
}
function l(X) {
  if (!X) return {};
  let { errorMap: Q, invalid_type_error: $, required_error: Y, description: W } = X;
  if (Q && ($ || Y)) throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  if (Q) return { errorMap: Q, description: W };
  return { errorMap: (G, H) => {
    let { message: B } = X;
    if (G.code === "invalid_enum_value") return { message: B ?? H.defaultError };
    if (typeof H.data > "u") return { message: B ?? Y ?? H.defaultError };
    if (G.code !== "invalid_type") return { message: H.defaultError };
    return { message: B ?? $ ?? H.defaultError };
  }, description: W };
}
function FW(X) {
  let Q = "[0-5]\\d";
  if (X.precision) Q = `${Q}\\.\\d{${X.precision}}`;
  else if (X.precision == null) Q = `${Q}(\\.\\d+)?`;
  let $ = X.precision ? "+" : "?";
  return `([01]\\d|2[0-3]):[0-5]\\d(:${Q})${$}`;
}
function jV(X) {
  return new RegExp(`^${FW(X)}$`);
}
function RV(X) {
  let Q = `${qW}T${FW(X)}`, $ = [];
  if ($.push(X.local ? "Z?" : "Z"), X.offset) $.push("([+-]\\d{2}:?\\d{2})");
  return Q = `${Q}(${$.join("|")})`, new RegExp(`^${Q}$`);
}
function IV(X, Q) {
  if ((Q === "v4" || !Q) && FV.test(X)) return true;
  if ((Q === "v6" || !Q) && OV.test(X)) return true;
  return false;
}
function EV(X, Q) {
  if (!UV.test(X)) return false;
  try {
    let [$] = X.split(".");
    if (!$) return false;
    let Y = $.replace(/-/g, "+").replace(/_/g, "/").padEnd($.length + (4 - $.length % 4) % 4, "="), W = JSON.parse(atob(Y));
    if (typeof W !== "object" || W === null) return false;
    if ("typ" in W && W?.typ !== "JWT") return false;
    if (!W.alg) return false;
    if (Q && W.alg !== Q) return false;
    return true;
  } catch {
    return false;
  }
}
function bV(X, Q) {
  if ((Q === "v4" || !Q) && NV.test(X)) return true;
  if ((Q === "v6" || !Q) && DV.test(X)) return true;
  return false;
}
function PV(X, Q) {
  let $ = (X.toString().split(".")[1] || "").length, Y = (Q.toString().split(".")[1] || "").length, W = $ > Y ? $ : Y, J = Number.parseInt(X.toFixed(W).replace(".", "")), G = Number.parseInt(Q.toFixed(W).replace(".", ""));
  return J % G / 10 ** W;
}
function R6(X) {
  if (X instanceof V0) {
    let Q = {};
    for (let $ in X.shape) {
      let Y = X.shape[$];
      Q[$] = J1.create(R6(Y));
    }
    return new V0({ ...X._def, shape: () => Q });
  } else if (X instanceof W1) return new W1({ ...X._def, type: R6(X.element) });
  else if (X instanceof J1) return J1.create(R6(X.unwrap()));
  else if (X instanceof _1) return _1.create(R6(X.unwrap()));
  else if (X instanceof M1) return M1.create(X.items.map((Q) => R6(Q)));
  else return X;
}
function N9(X, Q) {
  let $ = O1(X), Y = O1(Q);
  if (X === Q) return { valid: true, data: X };
  else if ($ === I.object && Y === I.object) {
    let W = n.objectKeys(Q), J = n.objectKeys(X).filter((H) => W.indexOf(H) !== -1), G = { ...X, ...Q };
    for (let H of J) {
      let B = N9(X[H], Q[H]);
      if (!B.valid) return { valid: false };
      G[H] = B.data;
    }
    return { valid: true, data: G };
  } else if ($ === I.array && Y === I.array) {
    if (X.length !== Q.length) return { valid: false };
    let W = [];
    for (let J = 0; J < X.length; J++) {
      let G = X[J], H = Q[J], B = N9(G, H);
      if (!B.valid) return { valid: false };
      W.push(B.data);
    }
    return { valid: true, data: W };
  } else if ($ === I.date && Y === I.date && +X === +Q) return { valid: true, data: X };
  else return { valid: false };
}
function NW(X, Q) {
  return new s1({ values: X, typeName: j.ZodEnum, ...l(Q) });
}
function O(X, Q, $) {
  function Y(H, B) {
    var z;
    Object.defineProperty(H, "_zod", { value: H._zod ?? {}, enumerable: false }), (z = H._zod).traits ?? (z.traits = /* @__PURE__ */ new Set()), H._zod.traits.add(X), Q(H, B);
    for (let K in G.prototype) if (!(K in H)) Object.defineProperty(H, K, { value: G.prototype[K].bind(H) });
    H._zod.constr = G, H._zod.def = B;
  }
  let W = $?.Parent ?? Object;
  class J extends W {
  }
  Object.defineProperty(J, "name", { value: X });
  function G(H) {
    var B;
    let z = $?.Parent ? new J() : this;
    Y(z, H), (B = z._zod).deferred ?? (B.deferred = []);
    for (let K of z._zod.deferred) K();
    return z;
  }
  return Object.defineProperty(G, "init", { value: Y }), Object.defineProperty(G, Symbol.hasInstance, { value: (H) => {
    if ($?.Parent && H instanceof $.Parent) return true;
    return H?._zod?.traits?.has(X);
  } }), Object.defineProperty(G, "name", { value: X }), G;
}
function u0(X) {
  if (X) Object.assign(E4, X);
  return E4;
}
function CV(X) {
  return X;
}
function kV(X) {
  return X;
}
function vV(X) {
}
function TV(X) {
  throw Error();
}
function _V(X) {
}
function DX(X) {
  let Q = Object.values(X).filter((Y) => typeof Y === "number");
  return Object.entries(X).filter(([Y, W]) => Q.indexOf(+Y) === -1).map(([Y, W]) => W);
}
function b4(X, Q = "|") {
  return X.map(($) => S4($)).join(Q);
}
function w9(X, Q) {
  if (typeof Q === "bigint") return Q.toString();
  return Q;
}
function AX(X) {
  return { get value() {
    {
      let $ = X();
      return Object.defineProperty(this, "value", { value: $ }), $;
    }
    throw Error("cached value already set");
  } };
}
function wX(X) {
  return X === null || X === void 0;
}
function MX(X) {
  let Q = X.startsWith("^") ? 1 : 0, $ = X.endsWith("$") ? X.length - 1 : X.length;
  return X.slice(Q, $);
}
function M9(X, Q) {
  let $ = (X.toString().split(".")[1] || "").length, Y = (Q.toString().split(".")[1] || "").length, W = $ > Y ? $ : Y, J = Number.parseInt(X.toFixed(W).replace(".", "")), G = Number.parseInt(Q.toFixed(W).replace(".", ""));
  return J % G / 10 ** W;
}
function Y0(X, Q, $) {
  Object.defineProperty(X, Q, { get() {
    {
      let W = $();
      return X[Q] = W, W;
    }
    throw Error("cached value already set");
  }, set(W) {
    Object.defineProperty(X, Q, { value: W });
  }, configurable: true });
}
function j9(X, Q, $) {
  Object.defineProperty(X, Q, { value: $, writable: true, enumerable: true, configurable: true });
}
function xV(X, Q) {
  if (!Q) return X;
  return Q.reduce(($, Y) => $?.[Y], X);
}
function yV(X) {
  let Q = Object.keys(X), $ = Q.map((Y) => X[Y]);
  return Promise.all($).then((Y) => {
    let W = {};
    for (let J = 0; J < Q.length; J++) W[Q[J]] = Y[J];
    return W;
  });
}
function gV(X = 10) {
  let $ = "";
  for (let Y = 0; Y < X; Y++) $ += "abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random() * 26)];
  return $;
}
function e1(X) {
  return JSON.stringify(X);
}
function S6(X) {
  return typeof X === "object" && X !== null && !Array.isArray(X);
}
function Z6(X) {
  if (S6(X) === false) return false;
  let Q = X.constructor;
  if (Q === void 0) return true;
  let $ = Q.prototype;
  if (S6($) === false) return false;
  if (Object.prototype.hasOwnProperty.call($, "isPrototypeOf") === false) return false;
  return true;
}
function fV(X) {
  let Q = 0;
  for (let $ in X) if (Object.prototype.hasOwnProperty.call(X, $)) Q++;
  return Q;
}
function y1(X) {
  return X.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function l0(X, Q, $) {
  let Y = new X._zod.constr(Q ?? X._zod.def);
  if (!Q || $?.parent) Y._zod.parent = X;
  return Y;
}
function y(X) {
  let Q = X;
  if (!Q) return {};
  if (typeof Q === "string") return { error: () => Q };
  if (Q?.message !== void 0) {
    if (Q?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
    Q.error = Q.message;
  }
  if (delete Q.message, typeof Q.error === "string") return { ...Q, error: () => Q.error };
  return Q;
}
function uV(X) {
  let Q;
  return new Proxy({}, { get($, Y, W) {
    return Q ?? (Q = X()), Reflect.get(Q, Y, W);
  }, set($, Y, W, J) {
    return Q ?? (Q = X()), Reflect.set(Q, Y, W, J);
  }, has($, Y) {
    return Q ?? (Q = X()), Reflect.has(Q, Y);
  }, deleteProperty($, Y) {
    return Q ?? (Q = X()), Reflect.deleteProperty(Q, Y);
  }, ownKeys($) {
    return Q ?? (Q = X()), Reflect.ownKeys(Q);
  }, getOwnPropertyDescriptor($, Y) {
    return Q ?? (Q = X()), Reflect.getOwnPropertyDescriptor(Q, Y);
  }, defineProperty($, Y, W) {
    return Q ?? (Q = X()), Reflect.defineProperty(Q, Y, W);
  } });
}
function S4(X) {
  if (typeof X === "bigint") return X.toString() + "n";
  if (typeof X === "string") return `"${X}"`;
  return `${X}`;
}
function E9(X) {
  return Object.keys(X).filter((Q) => {
    return X[Q]._zod.optin === "optional" && X[Q]._zod.optout === "optional";
  });
}
function lV(X, Q) {
  let $ = {}, Y = X._zod.def;
  for (let W in Q) {
    if (!(W in Y.shape)) throw Error(`Unrecognized key: "${W}"`);
    if (!Q[W]) continue;
    $[W] = Y.shape[W];
  }
  return l0(X, { ...X._zod.def, shape: $, checks: [] });
}
function mV(X, Q) {
  let $ = { ...X._zod.def.shape }, Y = X._zod.def;
  for (let W in Q) {
    if (!(W in Y.shape)) throw Error(`Unrecognized key: "${W}"`);
    if (!Q[W]) continue;
    delete $[W];
  }
  return l0(X, { ...X._zod.def, shape: $, checks: [] });
}
function cV(X, Q) {
  if (!Z6(Q)) throw Error("Invalid input to extend: expected a plain object");
  let $ = { ...X._zod.def, get shape() {
    let Y = { ...X._zod.def.shape, ...Q };
    return j9(this, "shape", Y), Y;
  }, checks: [] };
  return l0(X, $);
}
function pV(X, Q) {
  return l0(X, { ...X._zod.def, get shape() {
    let $ = { ...X._zod.def.shape, ...Q._zod.def.shape };
    return j9(this, "shape", $), $;
  }, catchall: Q._zod.def.catchall, checks: [] });
}
function dV(X, Q, $) {
  let Y = Q._zod.def.shape, W = { ...Y };
  if ($) for (let J in $) {
    if (!(J in Y)) throw Error(`Unrecognized key: "${J}"`);
    if (!$[J]) continue;
    W[J] = X ? new X({ type: "optional", innerType: Y[J] }) : Y[J];
  }
  else for (let J in Y) W[J] = X ? new X({ type: "optional", innerType: Y[J] }) : Y[J];
  return l0(Q, { ...Q._zod.def, shape: W, checks: [] });
}
function iV(X, Q, $) {
  let Y = Q._zod.def.shape, W = { ...Y };
  if ($) for (let J in $) {
    if (!(J in W)) throw Error(`Unrecognized key: "${J}"`);
    if (!$[J]) continue;
    W[J] = new X({ type: "nonoptional", innerType: Y[J] });
  }
  else for (let J in Y) W[J] = new X({ type: "nonoptional", innerType: Y[J] });
  return l0(Q, { ...Q._zod.def, shape: W, checks: [] });
}
function X6(X, Q = 0) {
  for (let $ = Q; $ < X.issues.length; $++) if (X.issues[$]?.continue !== true) return true;
  return false;
}
function H1(X, Q) {
  return Q.map(($) => {
    var Y;
    return (Y = $).path ?? (Y.path = []), $.path.unshift(X), $;
  });
}
function OX(X) {
  return typeof X === "string" ? X : X?.message;
}
function o0(X, Q, $) {
  let Y = { ...X, path: X.path ?? [] };
  if (!X.message) {
    let W = OX(X.inst?._zod.def?.error?.(X)) ?? OX(Q?.error?.(X)) ?? OX($.customError?.(X)) ?? OX($.localeError?.(X)) ?? "Invalid input";
    Y.message = W;
  }
  if (delete Y.inst, delete Y.continue, !Q?.reportInput) delete Y.input;
  return Y;
}
function wW(X) {
  if (X instanceof Set) return "set";
  if (X instanceof Map) return "map";
  if (X instanceof File) return "file";
  return "unknown";
}
function jX(X) {
  if (Array.isArray(X)) return "array";
  if (typeof X === "string") return "string";
  return "unknown";
}
function P9(...X) {
  let [Q, $, Y] = X;
  if (typeof Q === "string") return { message: Q, code: "custom", input: $, inst: Y };
  return { ...Q };
}
function nV(X) {
  return Object.entries(X).filter(([Q, $]) => {
    return Number.isNaN(Number.parseInt(Q, 10));
  }).map((Q) => Q[1]);
}
function S9(X, Q = ($) => $.message) {
  let $ = {}, Y = [];
  for (let W of X.issues) if (W.path.length > 0) $[W.path[0]] = $[W.path[0]] || [], $[W.path[0]].push(Q(W));
  else Y.push(Q(W));
  return { formErrors: Y, fieldErrors: $ };
}
function Z9(X, Q) {
  let $ = Q || function(J) {
    return J.message;
  }, Y = { _errors: [] }, W = (J) => {
    for (let G of J.issues) if (G.code === "invalid_union" && G.errors.length) G.errors.map((H) => W({ issues: H }));
    else if (G.code === "invalid_key") W({ issues: G.issues });
    else if (G.code === "invalid_element") W({ issues: G.issues });
    else if (G.path.length === 0) Y._errors.push($(G));
    else {
      let H = Y, B = 0;
      while (B < G.path.length) {
        let z = G.path[B];
        if (B !== G.path.length - 1) H[z] = H[z] || { _errors: [] };
        else H[z] = H[z] || { _errors: [] }, H[z]._errors.push($(G));
        H = H[z], B++;
      }
    }
  };
  return W(X), Y;
}
function vW() {
  return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
}
function mW(X) {
  return typeof X.precision === "number" ? X.precision === -1 ? "(?:[01]\\d|2[0-3]):[0-5]\\d" : X.precision === 0 ? "(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d" : `(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${X.precision}}` : "(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?";
}
function cW(X) {
  return new RegExp(`^${mW(X)}$`);
}
function pW(X) {
  let Q = mW({ precision: X.precision }), $ = ["Z"];
  if (X.local) $.push("");
  if (X.offset) $.push("([+-]\\d{2}:\\d{2})");
  let Y = `${Q}(?:${$.join("|")})`;
  return new RegExp(`^${uW}T(?:${Y})$`);
}
function bJ(X) {
  if (X === "") return true;
  if (X.length % 4 !== 0) return false;
  try {
    return atob(X), true;
  } catch {
    return false;
  }
}
function oV(X) {
  if (!g9.test(X)) return false;
  let Q = X.replace(/[-_]/g, (Y) => Y === "-" ? "+" : "/"), $ = Q.padEnd(Math.ceil(Q.length / 4) * 4, "=");
  return bJ($);
}
function tV(X, Q = null) {
  try {
    let $ = X.split(".");
    if ($.length !== 3) return false;
    let [Y] = $;
    if (!Y) return false;
    let W = JSON.parse(atob(Y));
    if ("typ" in W && W?.typ !== "JWT") return false;
    if (!W.alg) return false;
    if (Q && (!("alg" in W) || W.alg !== Q)) return false;
    return true;
  } catch {
    return false;
  }
}
function LJ(X, Q, $) {
  if (X.issues.length) Q.issues.push(...H1($, X.issues));
  Q.value[$] = X.value;
}
function k4(X, Q, $) {
  if (X.issues.length) Q.issues.push(...H1($, X.issues));
  Q.value[$] = X.value;
}
function qJ(X, Q, $, Y) {
  if (X.issues.length) if (Y[$] === void 0) if ($ in Y) Q.value[$] = void 0;
  else Q.value[$] = X.value;
  else Q.issues.push(...H1($, X.issues));
  else if (X.value === void 0) {
    if ($ in Y) Q.value[$] = void 0;
  } else Q.value[$] = X.value;
}
function FJ(X, Q, $, Y) {
  for (let W of X) if (W.issues.length === 0) return Q.value = W.value, Q;
  return Q.issues.push({ code: "invalid_union", input: Q.value, inst: $, errors: X.map((W) => W.issues.map((J) => o0(J, Y, u0()))) }), Q;
}
function l9(X, Q) {
  if (X === Q) return { valid: true, data: X };
  if (X instanceof Date && Q instanceof Date && +X === +Q) return { valid: true, data: X };
  if (Z6(X) && Z6(Q)) {
    let $ = Object.keys(Q), Y = Object.keys(X).filter((J) => $.indexOf(J) !== -1), W = { ...X, ...Q };
    for (let J of Y) {
      let G = l9(X[J], Q[J]);
      if (!G.valid) return { valid: false, mergeErrorPath: [J, ...G.mergeErrorPath] };
      W[J] = G.data;
    }
    return { valid: true, data: W };
  }
  if (Array.isArray(X) && Array.isArray(Q)) {
    if (X.length !== Q.length) return { valid: false, mergeErrorPath: [] };
    let $ = [];
    for (let Y = 0; Y < X.length; Y++) {
      let W = X[Y], J = Q[Y], G = l9(W, J);
      if (!G.valid) return { valid: false, mergeErrorPath: [Y, ...G.mergeErrorPath] };
      $.push(G.data);
    }
    return { valid: true, data: $ };
  }
  return { valid: false, mergeErrorPath: [] };
}
function NJ(X, Q, $) {
  if (Q.issues.length) X.issues.push(...Q.issues);
  if ($.issues.length) X.issues.push(...$.issues);
  if (X6(X)) return X;
  let Y = l9(Q.value, $.value);
  if (!Y.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);
  return X.value = Y.data, X;
}
function OJ(X, Q) {
  if (X.value === void 0) X.value = Q.defaultValue;
  return X;
}
function DJ(X, Q) {
  if (!X.issues.length && X.value === void 0) X.issues.push({ code: "invalid_type", expected: "nonoptional", input: X.value, inst: Q });
  return X;
}
function AJ(X, Q, $) {
  if (X6(X)) return X;
  return Q.out._zod.run({ value: X.value, issues: X.issues }, $);
}
function wJ(X) {
  return X.value = Object.freeze(X.value), X;
}
function MJ(X, Q, $, Y) {
  if (!X) {
    let W = { code: "custom", input: $, inst: Y, path: [...Y._zod.def.path ?? []], continue: !Y._zod.def.abort };
    if (Y._zod.def.params) W.params = Y._zod.def.params;
    Q.issues.push(P9(W));
  }
}
function SQ() {
  return { localeError: sV() };
}
function PJ() {
  return new x4();
}
function ZQ(X, Q) {
  return new X({ type: "string", ...y(Q) });
}
function CQ(X, Q) {
  return new X({ type: "string", format: "email", check: "string_format", abort: false, ...y(Q) });
}
function y4(X, Q) {
  return new X({ type: "string", format: "guid", check: "string_format", abort: false, ...y(Q) });
}
function kQ(X, Q) {
  return new X({ type: "string", format: "uuid", check: "string_format", abort: false, ...y(Q) });
}
function vQ(X, Q) {
  return new X({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v4", ...y(Q) });
}
function TQ(X, Q) {
  return new X({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v6", ...y(Q) });
}
function _Q(X, Q) {
  return new X({ type: "string", format: "uuid", check: "string_format", abort: false, version: "v7", ...y(Q) });
}
function xQ(X, Q) {
  return new X({ type: "string", format: "url", check: "string_format", abort: false, ...y(Q) });
}
function yQ(X, Q) {
  return new X({ type: "string", format: "emoji", check: "string_format", abort: false, ...y(Q) });
}
function gQ(X, Q) {
  return new X({ type: "string", format: "nanoid", check: "string_format", abort: false, ...y(Q) });
}
function fQ(X, Q) {
  return new X({ type: "string", format: "cuid", check: "string_format", abort: false, ...y(Q) });
}
function hQ(X, Q) {
  return new X({ type: "string", format: "cuid2", check: "string_format", abort: false, ...y(Q) });
}
function uQ(X, Q) {
  return new X({ type: "string", format: "ulid", check: "string_format", abort: false, ...y(Q) });
}
function lQ(X, Q) {
  return new X({ type: "string", format: "xid", check: "string_format", abort: false, ...y(Q) });
}
function mQ(X, Q) {
  return new X({ type: "string", format: "ksuid", check: "string_format", abort: false, ...y(Q) });
}
function cQ(X, Q) {
  return new X({ type: "string", format: "ipv4", check: "string_format", abort: false, ...y(Q) });
}
function pQ(X, Q) {
  return new X({ type: "string", format: "ipv6", check: "string_format", abort: false, ...y(Q) });
}
function dQ(X, Q) {
  return new X({ type: "string", format: "cidrv4", check: "string_format", abort: false, ...y(Q) });
}
function iQ(X, Q) {
  return new X({ type: "string", format: "cidrv6", check: "string_format", abort: false, ...y(Q) });
}
function nQ(X, Q) {
  return new X({ type: "string", format: "base64", check: "string_format", abort: false, ...y(Q) });
}
function rQ(X, Q) {
  return new X({ type: "string", format: "base64url", check: "string_format", abort: false, ...y(Q) });
}
function oQ(X, Q) {
  return new X({ type: "string", format: "e164", check: "string_format", abort: false, ...y(Q) });
}
function tQ(X, Q) {
  return new X({ type: "string", format: "jwt", check: "string_format", abort: false, ...y(Q) });
}
function SJ(X, Q) {
  return new X({ type: "string", format: "datetime", check: "string_format", offset: false, local: false, precision: null, ...y(Q) });
}
function ZJ(X, Q) {
  return new X({ type: "string", format: "date", check: "string_format", ...y(Q) });
}
function CJ(X, Q) {
  return new X({ type: "string", format: "time", check: "string_format", precision: null, ...y(Q) });
}
function kJ(X, Q) {
  return new X({ type: "string", format: "duration", check: "string_format", ...y(Q) });
}
function aQ(X, Q) {
  return new X({ type: "number", checks: [], ...y(Q) });
}
function sQ(X, Q) {
  return new X({ type: "number", check: "number_format", abort: false, format: "safeint", ...y(Q) });
}
function eQ(X, Q) {
  return new X({ type: "boolean", ...y(Q) });
}
function X$(X, Q) {
  return new X({ type: "null", ...y(Q) });
}
function Q$(X) {
  return new X({ type: "unknown" });
}
function $$(X, Q) {
  return new X({ type: "never", ...y(Q) });
}
function g4(X, Q) {
  return new f9({ check: "less_than", ...y(Q), value: X, inclusive: false });
}
function bX(X, Q) {
  return new f9({ check: "less_than", ...y(Q), value: X, inclusive: true });
}
function f4(X, Q) {
  return new h9({ check: "greater_than", ...y(Q), value: X, inclusive: false });
}
function PX(X, Q) {
  return new h9({ check: "greater_than", ...y(Q), value: X, inclusive: true });
}
function h4(X, Q) {
  return new eW({ check: "multiple_of", ...y(Q), value: X });
}
function u4(X, Q) {
  return new QJ({ check: "max_length", ...y(Q), maximum: X });
}
function C6(X, Q) {
  return new $J({ check: "min_length", ...y(Q), minimum: X });
}
function l4(X, Q) {
  return new YJ({ check: "length_equals", ...y(Q), length: X });
}
function Y$(X, Q) {
  return new WJ({ check: "string_format", format: "regex", ...y(Q), pattern: X });
}
function W$(X) {
  return new JJ({ check: "string_format", format: "lowercase", ...y(X) });
}
function J$(X) {
  return new GJ({ check: "string_format", format: "uppercase", ...y(X) });
}
function G$(X, Q) {
  return new HJ({ check: "string_format", format: "includes", ...y(Q), includes: X });
}
function H$(X, Q) {
  return new BJ({ check: "string_format", format: "starts_with", ...y(Q), prefix: X });
}
function B$(X, Q) {
  return new zJ({ check: "string_format", format: "ends_with", ...y(Q), suffix: X });
}
function Y6(X) {
  return new KJ({ check: "overwrite", tx: X });
}
function z$(X) {
  return Y6((Q) => Q.normalize(X));
}
function K$() {
  return Y6((X) => X.trim());
}
function U$() {
  return Y6((X) => X.toLowerCase());
}
function V$() {
  return Y6((X) => X.toUpperCase());
}
function vJ(X, Q, $) {
  return new X({ type: "array", element: Q, ...y($) });
}
function L$(X, Q, $) {
  let Y = y($);
  return Y.abort ?? (Y.abort = true), new X({ type: "custom", check: "custom", fn: Q, ...Y });
}
function q$(X, Q, $) {
  return new X({ type: "custom", check: "custom", fn: Q, ...y($) });
}
function D$(X) {
  return SJ(yJ, X);
}
function A$(X) {
  return ZJ(gJ, X);
}
function w$(X) {
  return CJ(fJ, X);
}
function M$(X) {
  return kJ(hJ, X);
}
function D(X) {
  return ZQ(dL, X);
}
function Q0(X) {
  return aQ(oJ, X);
}
function iJ(X) {
  return sQ(zq, X);
}
function M0(X) {
  return eQ(Kq, X);
}
function I$(X) {
  return X$(Uq, X);
}
function N0() {
  return Q$(Vq);
}
function qq(X) {
  return $$(Lq, X);
}
function r(X, Q) {
  return vJ(Fq, X, Q);
}
function E(X, Q) {
  let $ = { type: "object", get shape() {
    return i.assignProp(this, "shape", { ...X }), this.shape;
  }, ...i.normalizeParams(Q) };
  return new tJ($);
}
function c0(X, Q) {
  return new tJ({ type: "object", get shape() {
    return i.assignProp(this, "shape", { ...X }), this.shape;
  }, catchall: N0(), ...i.normalizeParams(Q) });
}
function J0(X, Q) {
  return new aJ({ type: "union", options: X, ...i.normalizeParams(Q) });
}
function E$(X, Q, $) {
  return new Nq({ type: "union", options: Q, discriminator: X, ...i.normalizeParams($) });
}
function i4(X, Q) {
  return new Oq({ type: "intersection", left: X, right: Q });
}
function O0(X, Q, $) {
  return new Dq({ type: "record", keyType: X, valueType: Q, ...i.normalizeParams($) });
}
function j0(X, Q) {
  let $ = Array.isArray(X) ? Object.fromEntries(X.map((Y) => [Y, Y])) : X;
  return new j$({ type: "enum", entries: $, ...i.normalizeParams(Q) });
}
function T(X, Q) {
  return new Aq({ type: "literal", values: Array.isArray(X) ? X : [X], ...i.normalizeParams(Q) });
}
function sJ(X) {
  return new wq({ type: "transform", transform: X });
}
function v(X) {
  return new eJ({ type: "optional", innerType: X });
}
function nJ(X) {
  return new Mq({ type: "nullable", innerType: X });
}
function Rq(X, Q) {
  return new jq({ type: "default", innerType: X, get defaultValue() {
    return typeof Q === "function" ? Q() : Q;
  } });
}
function Eq(X, Q) {
  return new Iq({ type: "prefault", innerType: X, get defaultValue() {
    return typeof Q === "function" ? Q() : Q;
  } });
}
function bq(X, Q) {
  return new X5({ type: "nonoptional", innerType: X, ...i.normalizeParams(Q) });
}
function Sq(X, Q) {
  return new Pq({ type: "catch", innerType: X, catchValue: typeof Q === "function" ? Q : () => Q });
}
function R$(X, Q) {
  return new Zq({ type: "pipe", in: X, out: Q });
}
function kq(X) {
  return new Cq({ type: "readonly", innerType: X });
}
function vq(X, Q) {
  let $ = new w0({ check: "custom", ...i.normalizeParams(Q) });
  return $._zod.check = X, $;
}
function $5(X, Q) {
  return L$(Q5, X ?? (() => true), Q);
}
function Tq(X, Q = {}) {
  return q$(Q5, X, Q);
}
function _q(X, Q) {
  let $ = vq((Y) => {
    return Y.addIssue = (W) => {
      if (typeof W === "string") Y.issues.push(i.issue(W, Y.value, $._zod.def));
      else {
        let J = W;
        if (J.fatal) J.continue = false;
        J.code ?? (J.code = "custom"), J.input ?? (J.input = Y.value), J.inst ?? (J.inst = $), J.continue ?? (J.continue = !$._zod.def.abort), Y.issues.push(i.issue(J));
      }
    }, X(Y.value, Y);
  }, Q);
  return $;
}
function b$(X, Q) {
  return R$(sJ(X), Q);
}
function a_({ prompt: X, options: Q }) {
  let { systemPrompt: $, settingSources: Y, sandbox: W, ...J } = Q ?? {}, G, H;
  if ($ === void 0) G = "";
  else if (typeof $ === "string") G = $;
  else if ($.type === "preset") H = $.append;
  let B = J.pathToClaudeCodeExecutable;
  if (!B) {
    let L6 = (0, import_url.fileURLToPath)(__import_meta_url__), q6 = (0, import_path.join)(L6, "..");
    B = (0, import_path.join)(q6, "cli.js");
  }
  process.env.CLAUDE_AGENT_SDK_VERSION = "0.2.31";
  let { abortController: z = F6(), additionalDirectories: K = [], agent: V, agents: L, allowedTools: U = [], betas: F, canUseTool: q, continue: N, cwd: A, debug: M, debugFile: R, disallowedTools: S = [], tools: C, env: K0, executable: U0 = M6() ? "bun" : "node", executableArgs: s = [], extraArgs: D0 = {}, fallbackModel: q0, enableFileCheckpointing: L1, forkSession: P1, hooks: o1, includePartialMessages: p, persistSession: Q9, maxThinkingTokens: r6, maxTurns: o6, maxBudgetUsd: t6, mcpServers: a6, model: B4, outputFormat: E0, permissionMode: S1 = "default", allowDangerouslySkipPermissions: s6 = false, permissionPromptToolName: az, plugins: sz, resume: ez, resumeSessionAt: XK, stderr: QK, strictMcpConfig: $K } = J, G7 = E0?.type === "json_schema" ? E0.schema : void 0, V6 = K0;
  if (!V6) V6 = { ...process.env };
  if (!V6.CLAUDE_CODE_ENTRYPOINT) V6.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
  if (L1) V6.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING = "true";
  if (!B) throw Error("pathToClaudeCodeExecutable is required");
  let $9 = {}, H7 = /* @__PURE__ */ new Map();
  if (a6) for (let [L6, q6] of Object.entries(a6)) if (q6.type === "sdk" && "instance" in q6) H7.set(L6, q6.instance), $9[L6] = { type: "sdk", name: L6 };
  else $9[L6] = q6;
  let YK = typeof X === "string", B7 = new XX({ abortController: z, additionalDirectories: K, agent: V, betas: F, cwd: A, debug: M, debugFile: R, executable: U0, executableArgs: s, extraArgs: D0, pathToClaudeCodeExecutable: B, env: V6, forkSession: P1, stderr: QK, maxThinkingTokens: r6, maxTurns: o6, maxBudgetUsd: t6, model: B4, fallbackModel: q0, jsonSchema: G7, permissionMode: S1, allowDangerouslySkipPermissions: s6, permissionPromptToolName: az, continueConversation: N, resume: ez, resumeSessionAt: XK, settingSources: Y ?? [], allowedTools: U, disallowedTools: S, tools: C, mcpServers: $9, strictMcpConfig: $K, canUseTool: !!q, hooks: !!o1, includePartialMessages: p, persistSession: Q9, plugins: sz, sandbox: W, spawnClaudeCodeProcess: J.spawnClaudeCodeProcess }), z7 = new $X(B7, YK, q, o1, z, H7, G7, { systemPrompt: G, appendSystemPrompt: H, agents: L });
  if (typeof X === "string") B7.write(Z0({ type: "user", session_id: "", message: { role: "user", content: [{ type: "text", text: X }] }, parent_tool_use_id: null }) + `
`);
  else z7.streamInput(X);
  return z7;
}
var import_path, import_url, import_events, import_child_process, import_readline, h, import_promises, import_path2, import_os, import_path3, import_process, import_fs, import_crypto, import_crypto2, import_fs2, import_path4, import_crypto3, WK, JK, Y9, GK, HK, K7, P, U7, BK, zK, hX, $Y, c, e, R1, lX, cG, KY, UY, mX, W3, d0, L3, O3, DY, w3, cX, iX, v8, nX, _8, t3, s3, GH, VH, qH, OH, EH, PH, TH, xH, gH, hH, mH, pH, iH, rH, tH, sH, d8, $B, WB, GB, BB, yY, gY, OB, wB, jB, SB, kB, hY, yB, lB, cB, dB, nB, oB, eB, Qz, Yz, Jz, Hz, Kz, Lz, Oz, wz, Mz, cY, vz, _z, fz, UK, VK, q7, LK, qK, N6, FK, O6, F7, NK, OK, e6, N7, AK, wK, O7, jK, RK, D7, A7, z4, bK, PK, SK, ZK, w7, kK, K4, M7, j7, TK, _K, R7, yK, gK, fK, hK, uK, lK, mK, I7, E7, U4, iK, q1, b7, P7, oK, tK, aK, S7, eK, XU, Z7, $U, C7, W9, k7, v7, Z1, HU, BU, T7, _7, x7, y7, g7, LU, f7, h7, u7, C1, l7, m7, c7, p7, J9, MU, k1, i7, o7, bb, t7, CU, XW, B9, L4, vU, TU, WW, JW, xU, q4, gU, pU, dU, F1, F4, BW, XX, QX, K9, $X, n, VW, I, O1, w, h0, WV, T1, JV, N4, b0, g, j6, C0, L9, q9, t1, WX, Z, r0, LW, d, GV, HV, BV, zV, KV, UV, VV, LV, qV, F9, FV, NV, OV, DV, AV, wV, qW, MV, A1, I6, E6, O4, GX, D4, HX, BX, A4, a1, w1, w4, W1, V0, zX, D1, O9, KX, M1, M4, j4, b6, JX, UX, VX, s1, LX, P6, G1, J1, _1, qX, FX, R4, w2, D9, I4, NX, M2, j, j2, R2, I2, E2, b2, P2, S2, Z2, C2, k2, v2, T2, _2, x2, OW, y2, g2, f2, h2, u2, l2, m2, c2, p2, d2, i2, n2, r2, o2, t2, a2, s2, e2, XS, SV, ZV, x1, E4, i, P4, R9, hV, I9, DW, b9, AW, MW, jW, Z4, RX, C9, k9, v9, T9, _9, Q6, x9, $6, RW, IW, EW, bW, PW, SW, ZW, CW, y9, kW, TW, _W, xW, yW, gW, g9, fW, hW, uW, lW, dW, iW, nW, rW, oW, tW, aW, w0, sW, f9, h9, eW, XJ, QJ, $J, YJ, IX, WJ, JJ, GJ, HJ, BJ, zJ, KJ, u9, VJ, X0, EX, W0, m9, c9, p9, d9, i9, n9, r9, o9, t9, a9, s9, jJ, RJ, IJ, EJ, e9, XQ, QQ, $Q, YQ, WQ, JQ, GQ, v4, HQ, BQ, zQ, KQ, UQ, VQ, T4, _4, LQ, qQ, FQ, NQ, OQ, DQ, AQ, wQ, MQ, jQ, RQ, IQ, EQ, bQ, PQ, aV, sV, eV, XL, x4, g1, xL, yL, SX, yJ, gJ, fJ, hJ, uJ, GZ, ZX, lJ, mJ, cJ, pJ, z0, rJ, dL, H0, iL, dJ, d4, nL, rL, oL, tL, aL, sL, eL, Xq, Qq, $q, Yq, Wq, Jq, Gq, Hq, Bq, oJ, zq, Kq, Uq, Vq, Lq, Fq, tJ, aJ, Nq, Oq, Dq, j$, Aq, wq, eJ, Mq, jq, Iq, X5, Pq, Zq, Cq, Q5, z1, r4, B1, W5, J5, xq, S$, yq, _0, R0, J6, p0, P0, o4, G5, H5, z5, x, K5, wZ, t4, gq, a4, fq, kX, T6, V5, hq, uq, lq, mq, cq, pq, C$, dq, iq, k$, s4, nq, rq, e4, oq, vX, TX, _X, _6, tq, xX, X8, Q8, $8, Y8, W8, L5, q5, F5, N5, v$, O5, x6, D5, aq, J8, sq, G8, eq, T$, XF, H8, QF, $F, YF, WF, JF, GF, HF, BF, zF, KF, B8, UF, VF, z8, _$, x$, y$, LF, qF, FF, g$, NF, OF, DF, AF, wF, A5, K8, MF, U8, MZ, jF, y6, RF, yX, IF, f$, EF, bF, PF, SF, ZF, CF, kF, n4, vF, TF, _F, h$, u$, xF, yF, gF, fF, hF, uF, lF, mF, cF, pF, dF, iF, nF, rF, oF, tF, aF, sF, V8, eF, XN, QN, L8, $N, YN, WN, l$, JN, jZ, RZ, IZ, EZ, bZ, PZ, I5, BN, hz, uz, pz, cz;
var init_sdk = __esm({
  "../../../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.2.31_zod@4.3.5/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs"() {
    import_path = require("path");
    import_url = require("url");
    import_events = require("events");
    import_child_process = require("child_process");
    import_readline = require("readline");
    h = __toESM(require("fs"), 1);
    import_promises = require("fs/promises");
    import_path2 = require("path");
    import_os = require("os");
    import_path3 = require("path");
    import_process = require("process");
    import_fs = require("fs");
    import_crypto = require("crypto");
    import_crypto2 = require("crypto");
    import_fs2 = require("fs");
    import_path4 = require("path");
    import_crypto3 = require("crypto");
    WK = Object.create;
    ({ getPrototypeOf: JK, defineProperty: Y9, getOwnPropertyNames: GK } = Object);
    HK = Object.prototype.hasOwnProperty;
    K7 = (X, Q, $) => {
      $ = X != null ? WK(JK(X)) : {};
      let Y = Q || !X || !X.__esModule ? Y9($, "default", { value: X, enumerable: true }) : $;
      for (let W of GK(X)) if (!HK.call(Y, W)) Y9(Y, W, { get: () => X[W], enumerable: true });
      return Y;
    };
    P = (X, Q) => () => (Q || X((Q = { exports: {} }).exports, Q), Q.exports);
    U7 = (X, Q) => {
      for (var $ in Q) Y9(X, $, { get: Q[$], enumerable: true, configurable: true, set: (Y) => Q[$] = () => Y });
    };
    BK = Symbol.dispose || Symbol.for("Symbol.dispose");
    zK = Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose");
    hX = P((JG) => {
      Object.defineProperty(JG, "__esModule", { value: true });
      JG.regexpCode = JG.getEsmExportName = JG.getProperty = JG.safeStringify = JG.stringify = JG.strConcat = JG.addCodeArg = JG.str = JG._ = JG.nil = JG._Code = JG.Name = JG.IDENTIFIER = JG._CodeOrName = void 0;
      class D8 {
      }
      JG._CodeOrName = D8;
      JG.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
      class g6 extends D8 {
        constructor(X) {
          super();
          if (!JG.IDENTIFIER.test(X)) throw Error("CodeGen: name must be a valid identifier");
          this.str = X;
        }
        toString() {
          return this.str;
        }
        emptyStr() {
          return false;
        }
        get names() {
          return { [this.str]: 1 };
        }
      }
      JG.Name = g6;
      class s0 extends D8 {
        constructor(X) {
          super();
          this._items = typeof X === "string" ? [X] : X;
        }
        toString() {
          return this.str;
        }
        emptyStr() {
          if (this._items.length > 1) return false;
          let X = this._items[0];
          return X === "" || X === '""';
        }
        get str() {
          var X;
          return (X = this._str) !== null && X !== void 0 ? X : this._str = this._items.reduce((Q, $) => `${Q}${$}`, "");
        }
        get names() {
          var X;
          return (X = this._names) !== null && X !== void 0 ? X : this._names = this._items.reduce((Q, $) => {
            if ($ instanceof g6) Q[$.str] = (Q[$.str] || 0) + 1;
            return Q;
          }, {});
        }
      }
      JG._Code = s0;
      JG.nil = new s0("");
      function YG(X, ...Q) {
        let $ = [X[0]], Y = 0;
        while (Y < Q.length) s$($, Q[Y]), $.push(X[++Y]);
        return new s0($);
      }
      JG._ = YG;
      var a$ = new s0("+");
      function WG(X, ...Q) {
        let $ = [fX(X[0])], Y = 0;
        while (Y < Q.length) $.push(a$), s$($, Q[Y]), $.push(a$, fX(X[++Y]));
        return NN($), new s0($);
      }
      JG.str = WG;
      function s$(X, Q) {
        if (Q instanceof s0) X.push(...Q._items);
        else if (Q instanceof g6) X.push(Q);
        else X.push(AN(Q));
      }
      JG.addCodeArg = s$;
      function NN(X) {
        let Q = 1;
        while (Q < X.length - 1) {
          if (X[Q] === a$) {
            let $ = ON(X[Q - 1], X[Q + 1]);
            if ($ !== void 0) {
              X.splice(Q - 1, 3, $);
              continue;
            }
            X[Q++] = "+";
          }
          Q++;
        }
      }
      function ON(X, Q) {
        if (Q === '""') return X;
        if (X === '""') return Q;
        if (typeof X == "string") {
          if (Q instanceof g6 || X[X.length - 1] !== '"') return;
          if (typeof Q != "string") return `${X.slice(0, -1)}${Q}"`;
          if (Q[0] === '"') return X.slice(0, -1) + Q.slice(1);
          return;
        }
        if (typeof Q == "string" && Q[0] === '"' && !(X instanceof g6)) return `"${X}${Q.slice(1)}`;
        return;
      }
      function DN(X, Q) {
        return Q.emptyStr() ? X : X.emptyStr() ? Q : WG`${X}${Q}`;
      }
      JG.strConcat = DN;
      function AN(X) {
        return typeof X == "number" || typeof X == "boolean" || X === null ? X : fX(Array.isArray(X) ? X.join(",") : X);
      }
      function wN(X) {
        return new s0(fX(X));
      }
      JG.stringify = wN;
      function fX(X) {
        return JSON.stringify(X).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
      }
      JG.safeStringify = fX;
      function MN(X) {
        return typeof X == "string" && JG.IDENTIFIER.test(X) ? new s0(`.${X}`) : YG`[${X}]`;
      }
      JG.getProperty = MN;
      function jN(X) {
        if (typeof X == "string" && JG.IDENTIFIER.test(X)) return new s0(`${X}`);
        throw Error(`CodeGen: invalid export name: ${X}, use explicit $id name mapping`);
      }
      JG.getEsmExportName = jN;
      function RN(X) {
        return new s0(X.toString());
      }
      JG.regexpCode = RN;
    });
    $Y = P((zG) => {
      Object.defineProperty(zG, "__esModule", { value: true });
      zG.ValueScope = zG.ValueScopeName = zG.Scope = zG.varKinds = zG.UsedValueState = void 0;
      var x0 = hX();
      class HG extends Error {
        constructor(X) {
          super(`CodeGen: "code" for ${X} not defined`);
          this.value = X.value;
        }
      }
      var w8;
      (function(X) {
        X[X.Started = 0] = "Started", X[X.Completed = 1] = "Completed";
      })(w8 || (zG.UsedValueState = w8 = {}));
      zG.varKinds = { const: new x0.Name("const"), let: new x0.Name("let"), var: new x0.Name("var") };
      class XY {
        constructor({ prefixes: X, parent: Q } = {}) {
          this._names = {}, this._prefixes = X, this._parent = Q;
        }
        toName(X) {
          return X instanceof x0.Name ? X : this.name(X);
        }
        name(X) {
          return new x0.Name(this._newName(X));
        }
        _newName(X) {
          let Q = this._names[X] || this._nameGroup(X);
          return `${X}${Q.index++}`;
        }
        _nameGroup(X) {
          var Q, $;
          if ((($ = (Q = this._parent) === null || Q === void 0 ? void 0 : Q._prefixes) === null || $ === void 0 ? void 0 : $.has(X)) || this._prefixes && !this._prefixes.has(X)) throw Error(`CodeGen: prefix "${X}" is not allowed in this scope`);
          return this._names[X] = { prefix: X, index: 0 };
        }
      }
      zG.Scope = XY;
      class QY extends x0.Name {
        constructor(X, Q) {
          super(Q);
          this.prefix = X;
        }
        setValue(X, { property: Q, itemIndex: $ }) {
          this.value = X, this.scopePath = x0._`.${new x0.Name(Q)}[${$}]`;
        }
      }
      zG.ValueScopeName = QY;
      var yN = x0._`\n`;
      class BG extends XY {
        constructor(X) {
          super(X);
          this._values = {}, this._scope = X.scope, this.opts = { ...X, _n: X.lines ? yN : x0.nil };
        }
        get() {
          return this._scope;
        }
        name(X) {
          return new QY(X, this._newName(X));
        }
        value(X, Q) {
          var $;
          if (Q.ref === void 0) throw Error("CodeGen: ref must be passed in value");
          let Y = this.toName(X), { prefix: W } = Y, J = ($ = Q.key) !== null && $ !== void 0 ? $ : Q.ref, G = this._values[W];
          if (G) {
            let z = G.get(J);
            if (z) return z;
          } else G = this._values[W] = /* @__PURE__ */ new Map();
          G.set(J, Y);
          let H = this._scope[W] || (this._scope[W] = []), B = H.length;
          return H[B] = Q.ref, Y.setValue(Q, { property: W, itemIndex: B }), Y;
        }
        getValue(X, Q) {
          let $ = this._values[X];
          if (!$) return;
          return $.get(Q);
        }
        scopeRefs(X, Q = this._values) {
          return this._reduceValues(Q, ($) => {
            if ($.scopePath === void 0) throw Error(`CodeGen: name "${$}" has no value`);
            return x0._`${X}${$.scopePath}`;
          });
        }
        scopeCode(X = this._values, Q, $) {
          return this._reduceValues(X, (Y) => {
            if (Y.value === void 0) throw Error(`CodeGen: name "${Y}" has no value`);
            return Y.value.code;
          }, Q, $);
        }
        _reduceValues(X, Q, $ = {}, Y) {
          let W = x0.nil;
          for (let J in X) {
            let G = X[J];
            if (!G) continue;
            let H = $[J] = $[J] || /* @__PURE__ */ new Map();
            G.forEach((B) => {
              if (H.has(B)) return;
              H.set(B, w8.Started);
              let z = Q(B);
              if (z) {
                let K = this.opts.es5 ? zG.varKinds.var : zG.varKinds.const;
                W = x0._`${W}${K} ${B} = ${z};${this.opts._n}`;
              } else if (z = Y === null || Y === void 0 ? void 0 : Y(B)) W = x0._`${W}${z}${this.opts._n}`;
              else throw new HG(B);
              H.set(B, w8.Completed);
            });
          }
          return W;
        }
      }
      zG.ValueScope = BG;
    });
    c = P((y0) => {
      Object.defineProperty(y0, "__esModule", { value: true });
      y0.or = y0.and = y0.not = y0.CodeGen = y0.operators = y0.varKinds = y0.ValueScopeName = y0.ValueScope = y0.Scope = y0.Name = y0.regexpCode = y0.stringify = y0.getProperty = y0.nil = y0.strConcat = y0.str = y0._ = void 0;
      var t = hX(), e0 = $Y(), l1 = hX();
      Object.defineProperty(y0, "_", { enumerable: true, get: function() {
        return l1._;
      } });
      Object.defineProperty(y0, "str", { enumerable: true, get: function() {
        return l1.str;
      } });
      Object.defineProperty(y0, "strConcat", { enumerable: true, get: function() {
        return l1.strConcat;
      } });
      Object.defineProperty(y0, "nil", { enumerable: true, get: function() {
        return l1.nil;
      } });
      Object.defineProperty(y0, "getProperty", { enumerable: true, get: function() {
        return l1.getProperty;
      } });
      Object.defineProperty(y0, "stringify", { enumerable: true, get: function() {
        return l1.stringify;
      } });
      Object.defineProperty(y0, "regexpCode", { enumerable: true, get: function() {
        return l1.regexpCode;
      } });
      Object.defineProperty(y0, "Name", { enumerable: true, get: function() {
        return l1.Name;
      } });
      var b8 = $Y();
      Object.defineProperty(y0, "Scope", { enumerable: true, get: function() {
        return b8.Scope;
      } });
      Object.defineProperty(y0, "ValueScope", { enumerable: true, get: function() {
        return b8.ValueScope;
      } });
      Object.defineProperty(y0, "ValueScopeName", { enumerable: true, get: function() {
        return b8.ValueScopeName;
      } });
      Object.defineProperty(y0, "varKinds", { enumerable: true, get: function() {
        return b8.varKinds;
      } });
      y0.operators = { GT: new t._Code(">"), GTE: new t._Code(">="), LT: new t._Code("<"), LTE: new t._Code("<="), EQ: new t._Code("==="), NEQ: new t._Code("!=="), NOT: new t._Code("!"), OR: new t._Code("||"), AND: new t._Code("&&"), ADD: new t._Code("+") };
      class m1 {
        optimizeNodes() {
          return this;
        }
        optimizeNames(X, Q) {
          return this;
        }
      }
      class UG extends m1 {
        constructor(X, Q, $) {
          super();
          this.varKind = X, this.name = Q, this.rhs = $;
        }
        render({ es5: X, _n: Q }) {
          let $ = X ? e0.varKinds.var : this.varKind, Y = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
          return `${$} ${this.name}${Y};` + Q;
        }
        optimizeNames(X, Q) {
          if (!X[this.name.str]) return;
          if (this.rhs) this.rhs = h6(this.rhs, X, Q);
          return this;
        }
        get names() {
          return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
        }
      }
      class JY extends m1 {
        constructor(X, Q, $) {
          super();
          this.lhs = X, this.rhs = Q, this.sideEffects = $;
        }
        render({ _n: X }) {
          return `${this.lhs} = ${this.rhs};` + X;
        }
        optimizeNames(X, Q) {
          if (this.lhs instanceof t.Name && !X[this.lhs.str] && !this.sideEffects) return;
          return this.rhs = h6(this.rhs, X, Q), this;
        }
        get names() {
          let X = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
          return E8(X, this.rhs);
        }
      }
      class VG extends JY {
        constructor(X, Q, $, Y) {
          super(X, $, Y);
          this.op = Q;
        }
        render({ _n: X }) {
          return `${this.lhs} ${this.op}= ${this.rhs};` + X;
        }
      }
      class LG extends m1 {
        constructor(X) {
          super();
          this.label = X, this.names = {};
        }
        render({ _n: X }) {
          return `${this.label}:` + X;
        }
      }
      class qG extends m1 {
        constructor(X) {
          super();
          this.label = X, this.names = {};
        }
        render({ _n: X }) {
          return `break${this.label ? ` ${this.label}` : ""};` + X;
        }
      }
      class FG extends m1 {
        constructor(X) {
          super();
          this.error = X;
        }
        render({ _n: X }) {
          return `throw ${this.error};` + X;
        }
        get names() {
          return this.error.names;
        }
      }
      class NG extends m1 {
        constructor(X) {
          super();
          this.code = X;
        }
        render({ _n: X }) {
          return `${this.code};` + X;
        }
        optimizeNodes() {
          return `${this.code}` ? this : void 0;
        }
        optimizeNames(X, Q) {
          return this.code = h6(this.code, X, Q), this;
        }
        get names() {
          return this.code instanceof t._CodeOrName ? this.code.names : {};
        }
      }
      class P8 extends m1 {
        constructor(X = []) {
          super();
          this.nodes = X;
        }
        render(X) {
          return this.nodes.reduce((Q, $) => Q + $.render(X), "");
        }
        optimizeNodes() {
          let { nodes: X } = this, Q = X.length;
          while (Q--) {
            let $ = X[Q].optimizeNodes();
            if (Array.isArray($)) X.splice(Q, 1, ...$);
            else if ($) X[Q] = $;
            else X.splice(Q, 1);
          }
          return X.length > 0 ? this : void 0;
        }
        optimizeNames(X, Q) {
          let { nodes: $ } = this, Y = $.length;
          while (Y--) {
            let W = $[Y];
            if (W.optimizeNames(X, Q)) continue;
            uN(X, W.names), $.splice(Y, 1);
          }
          return $.length > 0 ? this : void 0;
        }
        get names() {
          return this.nodes.reduce((X, Q) => G6(X, Q.names), {});
        }
      }
      class c1 extends P8 {
        render(X) {
          return "{" + X._n + super.render(X) + "}" + X._n;
        }
      }
      class OG extends P8 {
      }
      class uX extends c1 {
      }
      uX.kind = "else";
      class j1 extends c1 {
        constructor(X, Q) {
          super(Q);
          this.condition = X;
        }
        render(X) {
          let Q = `if(${this.condition})` + super.render(X);
          if (this.else) Q += "else " + this.else.render(X);
          return Q;
        }
        optimizeNodes() {
          super.optimizeNodes();
          let X = this.condition;
          if (X === true) return this.nodes;
          let Q = this.else;
          if (Q) {
            let $ = Q.optimizeNodes();
            Q = this.else = Array.isArray($) ? new uX($) : $;
          }
          if (Q) {
            if (X === false) return Q instanceof j1 ? Q : Q.nodes;
            if (this.nodes.length) return this;
            return new j1(jG(X), Q instanceof j1 ? [Q] : Q.nodes);
          }
          if (X === false || !this.nodes.length) return;
          return this;
        }
        optimizeNames(X, Q) {
          var $;
          if (this.else = ($ = this.else) === null || $ === void 0 ? void 0 : $.optimizeNames(X, Q), !(super.optimizeNames(X, Q) || this.else)) return;
          return this.condition = h6(this.condition, X, Q), this;
        }
        get names() {
          let X = super.names;
          if (E8(X, this.condition), this.else) G6(X, this.else.names);
          return X;
        }
      }
      j1.kind = "if";
      class f6 extends c1 {
      }
      f6.kind = "for";
      class DG extends f6 {
        constructor(X) {
          super();
          this.iteration = X;
        }
        render(X) {
          return `for(${this.iteration})` + super.render(X);
        }
        optimizeNames(X, Q) {
          if (!super.optimizeNames(X, Q)) return;
          return this.iteration = h6(this.iteration, X, Q), this;
        }
        get names() {
          return G6(super.names, this.iteration.names);
        }
      }
      class AG extends f6 {
        constructor(X, Q, $, Y) {
          super();
          this.varKind = X, this.name = Q, this.from = $, this.to = Y;
        }
        render(X) {
          let Q = X.es5 ? e0.varKinds.var : this.varKind, { name: $, from: Y, to: W } = this;
          return `for(${Q} ${$}=${Y}; ${$}<${W}; ${$}++)` + super.render(X);
        }
        get names() {
          let X = E8(super.names, this.from);
          return E8(X, this.to);
        }
      }
      class YY extends f6 {
        constructor(X, Q, $, Y) {
          super();
          this.loop = X, this.varKind = Q, this.name = $, this.iterable = Y;
        }
        render(X) {
          return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(X);
        }
        optimizeNames(X, Q) {
          if (!super.optimizeNames(X, Q)) return;
          return this.iterable = h6(this.iterable, X, Q), this;
        }
        get names() {
          return G6(super.names, this.iterable.names);
        }
      }
      class M8 extends c1 {
        constructor(X, Q, $) {
          super();
          this.name = X, this.args = Q, this.async = $;
        }
        render(X) {
          return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(X);
        }
      }
      M8.kind = "func";
      class j8 extends P8 {
        render(X) {
          return "return " + super.render(X);
        }
      }
      j8.kind = "return";
      class wG extends c1 {
        render(X) {
          let Q = "try" + super.render(X);
          if (this.catch) Q += this.catch.render(X);
          if (this.finally) Q += this.finally.render(X);
          return Q;
        }
        optimizeNodes() {
          var X, Q;
          return super.optimizeNodes(), (X = this.catch) === null || X === void 0 || X.optimizeNodes(), (Q = this.finally) === null || Q === void 0 || Q.optimizeNodes(), this;
        }
        optimizeNames(X, Q) {
          var $, Y;
          return super.optimizeNames(X, Q), ($ = this.catch) === null || $ === void 0 || $.optimizeNames(X, Q), (Y = this.finally) === null || Y === void 0 || Y.optimizeNames(X, Q), this;
        }
        get names() {
          let X = super.names;
          if (this.catch) G6(X, this.catch.names);
          if (this.finally) G6(X, this.finally.names);
          return X;
        }
      }
      class R8 extends c1 {
        constructor(X) {
          super();
          this.error = X;
        }
        render(X) {
          return `catch(${this.error})` + super.render(X);
        }
      }
      R8.kind = "catch";
      class I8 extends c1 {
        render(X) {
          return "finally" + super.render(X);
        }
      }
      I8.kind = "finally";
      class MG {
        constructor(X, Q = {}) {
          this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...Q, _n: Q.lines ? `
` : "" }, this._extScope = X, this._scope = new e0.Scope({ parent: X }), this._nodes = [new OG()];
        }
        toString() {
          return this._root.render(this.opts);
        }
        name(X) {
          return this._scope.name(X);
        }
        scopeName(X) {
          return this._extScope.name(X);
        }
        scopeValue(X, Q) {
          let $ = this._extScope.value(X, Q);
          return (this._values[$.prefix] || (this._values[$.prefix] = /* @__PURE__ */ new Set())).add($), $;
        }
        getScopeValue(X, Q) {
          return this._extScope.getValue(X, Q);
        }
        scopeRefs(X) {
          return this._extScope.scopeRefs(X, this._values);
        }
        scopeCode() {
          return this._extScope.scopeCode(this._values);
        }
        _def(X, Q, $, Y) {
          let W = this._scope.toName(Q);
          if ($ !== void 0 && Y) this._constants[W.str] = $;
          return this._leafNode(new UG(X, W, $)), W;
        }
        const(X, Q, $) {
          return this._def(e0.varKinds.const, X, Q, $);
        }
        let(X, Q, $) {
          return this._def(e0.varKinds.let, X, Q, $);
        }
        var(X, Q, $) {
          return this._def(e0.varKinds.var, X, Q, $);
        }
        assign(X, Q, $) {
          return this._leafNode(new JY(X, Q, $));
        }
        add(X, Q) {
          return this._leafNode(new VG(X, y0.operators.ADD, Q));
        }
        code(X) {
          if (typeof X == "function") X();
          else if (X !== t.nil) this._leafNode(new NG(X));
          return this;
        }
        object(...X) {
          let Q = ["{"];
          for (let [$, Y] of X) {
            if (Q.length > 1) Q.push(",");
            if (Q.push($), $ !== Y || this.opts.es5) Q.push(":"), (0, t.addCodeArg)(Q, Y);
          }
          return Q.push("}"), new t._Code(Q);
        }
        if(X, Q, $) {
          if (this._blockNode(new j1(X)), Q && $) this.code(Q).else().code($).endIf();
          else if (Q) this.code(Q).endIf();
          else if ($) throw Error('CodeGen: "else" body without "then" body');
          return this;
        }
        elseIf(X) {
          return this._elseNode(new j1(X));
        }
        else() {
          return this._elseNode(new uX());
        }
        endIf() {
          return this._endBlockNode(j1, uX);
        }
        _for(X, Q) {
          if (this._blockNode(X), Q) this.code(Q).endFor();
          return this;
        }
        for(X, Q) {
          return this._for(new DG(X), Q);
        }
        forRange(X, Q, $, Y, W = this.opts.es5 ? e0.varKinds.var : e0.varKinds.let) {
          let J = this._scope.toName(X);
          return this._for(new AG(W, J, Q, $), () => Y(J));
        }
        forOf(X, Q, $, Y = e0.varKinds.const) {
          let W = this._scope.toName(X);
          if (this.opts.es5) {
            let J = Q instanceof t.Name ? Q : this.var("_arr", Q);
            return this.forRange("_i", 0, t._`${J}.length`, (G) => {
              this.var(W, t._`${J}[${G}]`), $(W);
            });
          }
          return this._for(new YY("of", Y, W, Q), () => $(W));
        }
        forIn(X, Q, $, Y = this.opts.es5 ? e0.varKinds.var : e0.varKinds.const) {
          if (this.opts.ownProperties) return this.forOf(X, t._`Object.keys(${Q})`, $);
          let W = this._scope.toName(X);
          return this._for(new YY("in", Y, W, Q), () => $(W));
        }
        endFor() {
          return this._endBlockNode(f6);
        }
        label(X) {
          return this._leafNode(new LG(X));
        }
        break(X) {
          return this._leafNode(new qG(X));
        }
        return(X) {
          let Q = new j8();
          if (this._blockNode(Q), this.code(X), Q.nodes.length !== 1) throw Error('CodeGen: "return" should have one node');
          return this._endBlockNode(j8);
        }
        try(X, Q, $) {
          if (!Q && !$) throw Error('CodeGen: "try" without "catch" and "finally"');
          let Y = new wG();
          if (this._blockNode(Y), this.code(X), Q) {
            let W = this.name("e");
            this._currNode = Y.catch = new R8(W), Q(W);
          }
          if ($) this._currNode = Y.finally = new I8(), this.code($);
          return this._endBlockNode(R8, I8);
        }
        throw(X) {
          return this._leafNode(new FG(X));
        }
        block(X, Q) {
          if (this._blockStarts.push(this._nodes.length), X) this.code(X).endBlock(Q);
          return this;
        }
        endBlock(X) {
          let Q = this._blockStarts.pop();
          if (Q === void 0) throw Error("CodeGen: not in self-balancing block");
          let $ = this._nodes.length - Q;
          if ($ < 0 || X !== void 0 && $ !== X) throw Error(`CodeGen: wrong number of nodes: ${$} vs ${X} expected`);
          return this._nodes.length = Q, this;
        }
        func(X, Q = t.nil, $, Y) {
          if (this._blockNode(new M8(X, Q, $)), Y) this.code(Y).endFunc();
          return this;
        }
        endFunc() {
          return this._endBlockNode(M8);
        }
        optimize(X = 1) {
          while (X-- > 0) this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
        }
        _leafNode(X) {
          return this._currNode.nodes.push(X), this;
        }
        _blockNode(X) {
          this._currNode.nodes.push(X), this._nodes.push(X);
        }
        _endBlockNode(X, Q) {
          let $ = this._currNode;
          if ($ instanceof X || Q && $ instanceof Q) return this._nodes.pop(), this;
          throw Error(`CodeGen: not in block "${Q ? `${X.kind}/${Q.kind}` : X.kind}"`);
        }
        _elseNode(X) {
          let Q = this._currNode;
          if (!(Q instanceof j1)) throw Error('CodeGen: "else" without "if"');
          return this._currNode = Q.else = X, this;
        }
        get _root() {
          return this._nodes[0];
        }
        get _currNode() {
          let X = this._nodes;
          return X[X.length - 1];
        }
        set _currNode(X) {
          let Q = this._nodes;
          Q[Q.length - 1] = X;
        }
      }
      y0.CodeGen = MG;
      function G6(X, Q) {
        for (let $ in Q) X[$] = (X[$] || 0) + (Q[$] || 0);
        return X;
      }
      function E8(X, Q) {
        return Q instanceof t._CodeOrName ? G6(X, Q.names) : X;
      }
      function h6(X, Q, $) {
        if (X instanceof t.Name) return Y(X);
        if (!W(X)) return X;
        return new t._Code(X._items.reduce((J, G) => {
          if (G instanceof t.Name) G = Y(G);
          if (G instanceof t._Code) J.push(...G._items);
          else J.push(G);
          return J;
        }, []));
        function Y(J) {
          let G = $[J.str];
          if (G === void 0 || Q[J.str] !== 1) return J;
          return delete Q[J.str], G;
        }
        function W(J) {
          return J instanceof t._Code && J._items.some((G) => G instanceof t.Name && Q[G.str] === 1 && $[G.str] !== void 0);
        }
      }
      function uN(X, Q) {
        for (let $ in Q) X[$] = (X[$] || 0) - (Q[$] || 0);
      }
      function jG(X) {
        return typeof X == "boolean" || typeof X == "number" || X === null ? !X : t._`!${WY(X)}`;
      }
      y0.not = jG;
      var lN = RG(y0.operators.AND);
      function mN(...X) {
        return X.reduce(lN);
      }
      y0.and = mN;
      var cN = RG(y0.operators.OR);
      function pN(...X) {
        return X.reduce(cN);
      }
      y0.or = pN;
      function RG(X) {
        return (Q, $) => Q === t.nil ? $ : $ === t.nil ? Q : t._`${WY(Q)} ${X} ${WY($)}`;
      }
      function WY(X) {
        return X instanceof t.Name ? X : t._`(${X})`;
      }
    });
    e = P((vG) => {
      Object.defineProperty(vG, "__esModule", { value: true });
      vG.checkStrictMode = vG.getErrorPath = vG.Type = vG.useFunc = vG.setEvaluated = vG.evaluatedPropsToName = vG.mergeEvaluated = vG.eachItem = vG.unescapeJsonPointer = vG.escapeJsonPointer = vG.escapeFragment = vG.unescapeFragment = vG.schemaRefOrVal = vG.schemaHasRulesButRef = vG.schemaHasRules = vG.checkUnknownRules = vG.alwaysValidSchema = vG.toHash = void 0;
      var $0 = c(), rN = hX();
      function oN(X) {
        let Q = {};
        for (let $ of X) Q[$] = true;
        return Q;
      }
      vG.toHash = oN;
      function tN(X, Q) {
        if (typeof Q == "boolean") return Q;
        if (Object.keys(Q).length === 0) return true;
        return PG(X, Q), !SG(Q, X.self.RULES.all);
      }
      vG.alwaysValidSchema = tN;
      function PG(X, Q = X.schema) {
        let { opts: $, self: Y } = X;
        if (!$.strictSchema) return;
        if (typeof Q === "boolean") return;
        let W = Y.RULES.keywords;
        for (let J in Q) if (!W[J]) kG(X, `unknown keyword: "${J}"`);
      }
      vG.checkUnknownRules = PG;
      function SG(X, Q) {
        if (typeof X == "boolean") return !X;
        for (let $ in X) if (Q[$]) return true;
        return false;
      }
      vG.schemaHasRules = SG;
      function aN(X, Q) {
        if (typeof X == "boolean") return !X;
        for (let $ in X) if ($ !== "$ref" && Q.all[$]) return true;
        return false;
      }
      vG.schemaHasRulesButRef = aN;
      function sN({ topSchemaRef: X, schemaPath: Q }, $, Y, W) {
        if (!W) {
          if (typeof $ == "number" || typeof $ == "boolean") return $;
          if (typeof $ == "string") return $0._`${$}`;
        }
        return $0._`${X}${Q}${(0, $0.getProperty)(Y)}`;
      }
      vG.schemaRefOrVal = sN;
      function eN(X) {
        return ZG(decodeURIComponent(X));
      }
      vG.unescapeFragment = eN;
      function XO(X) {
        return encodeURIComponent(HY(X));
      }
      vG.escapeFragment = XO;
      function HY(X) {
        if (typeof X == "number") return `${X}`;
        return X.replace(/~/g, "~0").replace(/\//g, "~1");
      }
      vG.escapeJsonPointer = HY;
      function ZG(X) {
        return X.replace(/~1/g, "/").replace(/~0/g, "~");
      }
      vG.unescapeJsonPointer = ZG;
      function QO(X, Q) {
        if (Array.isArray(X)) for (let $ of X) Q($);
        else Q(X);
      }
      vG.eachItem = QO;
      function EG({ mergeNames: X, mergeToName: Q, mergeValues: $, resultToName: Y }) {
        return (W, J, G, H) => {
          let B = G === void 0 ? J : G instanceof $0.Name ? (J instanceof $0.Name ? X(W, J, G) : Q(W, J, G), G) : J instanceof $0.Name ? (Q(W, G, J), J) : $(J, G);
          return H === $0.Name && !(B instanceof $0.Name) ? Y(W, B) : B;
        };
      }
      vG.mergeEvaluated = { props: EG({ mergeNames: (X, Q, $) => X.if($0._`${$} !== true && ${Q} !== undefined`, () => {
        X.if($0._`${Q} === true`, () => X.assign($, true), () => X.assign($, $0._`${$} || {}`).code($0._`Object.assign(${$}, ${Q})`));
      }), mergeToName: (X, Q, $) => X.if($0._`${$} !== true`, () => {
        if (Q === true) X.assign($, true);
        else X.assign($, $0._`${$} || {}`), BY(X, $, Q);
      }), mergeValues: (X, Q) => X === true ? true : { ...X, ...Q }, resultToName: CG }), items: EG({ mergeNames: (X, Q, $) => X.if($0._`${$} !== true && ${Q} !== undefined`, () => X.assign($, $0._`${Q} === true ? true : ${$} > ${Q} ? ${$} : ${Q}`)), mergeToName: (X, Q, $) => X.if($0._`${$} !== true`, () => X.assign($, Q === true ? true : $0._`${$} > ${Q} ? ${$} : ${Q}`)), mergeValues: (X, Q) => X === true ? true : Math.max(X, Q), resultToName: (X, Q) => X.var("items", Q) }) };
      function CG(X, Q) {
        if (Q === true) return X.var("props", true);
        let $ = X.var("props", $0._`{}`);
        if (Q !== void 0) BY(X, $, Q);
        return $;
      }
      vG.evaluatedPropsToName = CG;
      function BY(X, Q, $) {
        Object.keys($).forEach((Y) => X.assign($0._`${Q}${(0, $0.getProperty)(Y)}`, true));
      }
      vG.setEvaluated = BY;
      var bG = {};
      function $O(X, Q) {
        return X.scopeValue("func", { ref: Q, code: bG[Q.code] || (bG[Q.code] = new rN._Code(Q.code)) });
      }
      vG.useFunc = $O;
      var GY;
      (function(X) {
        X[X.Num = 0] = "Num", X[X.Str = 1] = "Str";
      })(GY || (vG.Type = GY = {}));
      function YO(X, Q, $) {
        if (X instanceof $0.Name) {
          let Y = Q === GY.Num;
          return $ ? Y ? $0._`"[" + ${X} + "]"` : $0._`"['" + ${X} + "']"` : Y ? $0._`"/" + ${X}` : $0._`"/" + ${X}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
        }
        return $ ? (0, $0.getProperty)(X).toString() : "/" + HY(X);
      }
      vG.getErrorPath = YO;
      function kG(X, Q, $ = X.opts.strictSchema) {
        if (!$) return;
        if (Q = `strict mode: ${Q}`, $ === true) throw Error(Q);
        X.self.logger.warn(Q);
      }
      vG.checkStrictMode = kG;
    });
    R1 = P((_G) => {
      Object.defineProperty(_G, "__esModule", { value: true });
      var S0 = c(), MO = { data: new S0.Name("data"), valCxt: new S0.Name("valCxt"), instancePath: new S0.Name("instancePath"), parentData: new S0.Name("parentData"), parentDataProperty: new S0.Name("parentDataProperty"), rootData: new S0.Name("rootData"), dynamicAnchors: new S0.Name("dynamicAnchors"), vErrors: new S0.Name("vErrors"), errors: new S0.Name("errors"), this: new S0.Name("this"), self: new S0.Name("self"), scope: new S0.Name("scope"), json: new S0.Name("json"), jsonPos: new S0.Name("jsonPos"), jsonLen: new S0.Name("jsonLen"), jsonPart: new S0.Name("jsonPart") };
      _G.default = MO;
    });
    lX = P((fG) => {
      Object.defineProperty(fG, "__esModule", { value: true });
      fG.extendErrors = fG.resetErrorsCount = fG.reportExtraError = fG.reportError = fG.keyword$DataError = fG.keywordError = void 0;
      var a = c(), Z8 = e(), v0 = R1();
      fG.keywordError = { message: ({ keyword: X }) => a.str`must pass "${X}" keyword validation` };
      fG.keyword$DataError = { message: ({ keyword: X, schemaType: Q }) => Q ? a.str`"${X}" keyword must be ${Q} ($data)` : a.str`"${X}" keyword is invalid ($data)` };
      function RO(X, Q = fG.keywordError, $, Y) {
        let { it: W } = X, { gen: J, compositeRule: G, allErrors: H } = W, B = gG(X, Q, $);
        if (Y !== null && Y !== void 0 ? Y : G || H) xG(J, B);
        else yG(W, a._`[${B}]`);
      }
      fG.reportError = RO;
      function IO(X, Q = fG.keywordError, $) {
        let { it: Y } = X, { gen: W, compositeRule: J, allErrors: G } = Y, H = gG(X, Q, $);
        if (xG(W, H), !(J || G)) yG(Y, v0.default.vErrors);
      }
      fG.reportExtraError = IO;
      function EO(X, Q) {
        X.assign(v0.default.errors, Q), X.if(a._`${v0.default.vErrors} !== null`, () => X.if(Q, () => X.assign(a._`${v0.default.vErrors}.length`, Q), () => X.assign(v0.default.vErrors, null)));
      }
      fG.resetErrorsCount = EO;
      function bO({ gen: X, keyword: Q, schemaValue: $, data: Y, errsCount: W, it: J }) {
        if (W === void 0) throw Error("ajv implementation error");
        let G = X.name("err");
        X.forRange("i", W, v0.default.errors, (H) => {
          if (X.const(G, a._`${v0.default.vErrors}[${H}]`), X.if(a._`${G}.instancePath === undefined`, () => X.assign(a._`${G}.instancePath`, (0, a.strConcat)(v0.default.instancePath, J.errorPath))), X.assign(a._`${G}.schemaPath`, a.str`${J.errSchemaPath}/${Q}`), J.opts.verbose) X.assign(a._`${G}.schema`, $), X.assign(a._`${G}.data`, Y);
        });
      }
      fG.extendErrors = bO;
      function xG(X, Q) {
        let $ = X.const("err", Q);
        X.if(a._`${v0.default.vErrors} === null`, () => X.assign(v0.default.vErrors, a._`[${$}]`), a._`${v0.default.vErrors}.push(${$})`), X.code(a._`${v0.default.errors}++`);
      }
      function yG(X, Q) {
        let { gen: $, validateName: Y, schemaEnv: W } = X;
        if (W.$async) $.throw(a._`new ${X.ValidationError}(${Q})`);
        else $.assign(a._`${Y}.errors`, Q), $.return(false);
      }
      var H6 = { keyword: new a.Name("keyword"), schemaPath: new a.Name("schemaPath"), params: new a.Name("params"), propertyName: new a.Name("propertyName"), message: new a.Name("message"), schema: new a.Name("schema"), parentSchema: new a.Name("parentSchema") };
      function gG(X, Q, $) {
        let { createErrors: Y } = X.it;
        if (Y === false) return a._`{}`;
        return PO(X, Q, $);
      }
      function PO(X, Q, $ = {}) {
        let { gen: Y, it: W } = X, J = [SO(W, $), ZO(X, $)];
        return CO(X, Q, J), Y.object(...J);
      }
      function SO({ errorPath: X }, { instancePath: Q }) {
        let $ = Q ? a.str`${X}${(0, Z8.getErrorPath)(Q, Z8.Type.Str)}` : X;
        return [v0.default.instancePath, (0, a.strConcat)(v0.default.instancePath, $)];
      }
      function ZO({ keyword: X, it: { errSchemaPath: Q } }, { schemaPath: $, parentSchema: Y }) {
        let W = Y ? Q : a.str`${Q}/${X}`;
        if ($) W = a.str`${W}${(0, Z8.getErrorPath)($, Z8.Type.Str)}`;
        return [H6.schemaPath, W];
      }
      function CO(X, { params: Q, message: $ }, Y) {
        let { keyword: W, data: J, schemaValue: G, it: H } = X, { opts: B, propertyName: z, topSchemaRef: K, schemaPath: V } = H;
        if (Y.push([H6.keyword, W], [H6.params, typeof Q == "function" ? Q(X) : Q || a._`{}`]), B.messages) Y.push([H6.message, typeof $ == "function" ? $(X) : $]);
        if (B.verbose) Y.push([H6.schema, G], [H6.parentSchema, a._`${K}${V}`], [v0.default.data, J]);
        if (z) Y.push([H6.propertyName, z]);
      }
    });
    cG = P((lG) => {
      Object.defineProperty(lG, "__esModule", { value: true });
      lG.boolOrEmptySchema = lG.topBoolOrEmptySchema = void 0;
      var xO = lX(), yO = c(), gO = R1(), fO = { message: "boolean schema is false" };
      function hO(X) {
        let { gen: Q, schema: $, validateName: Y } = X;
        if ($ === false) uG(X, false);
        else if (typeof $ == "object" && $.$async === true) Q.return(gO.default.data);
        else Q.assign(yO._`${Y}.errors`, null), Q.return(true);
      }
      lG.topBoolOrEmptySchema = hO;
      function uO(X, Q) {
        let { gen: $, schema: Y } = X;
        if (Y === false) $.var(Q, false), uG(X);
        else $.var(Q, true);
      }
      lG.boolOrEmptySchema = uO;
      function uG(X, Q) {
        let { gen: $, data: Y } = X, W = { gen: $, keyword: "false schema", data: Y, schema: false, schemaCode: false, schemaValue: false, params: {}, it: X };
        (0, xO.reportError)(W, fO, void 0, Q);
      }
    });
    KY = P((pG) => {
      Object.defineProperty(pG, "__esModule", { value: true });
      pG.getRules = pG.isJSONType = void 0;
      var mO = ["string", "number", "integer", "boolean", "null", "object", "array"], cO = new Set(mO);
      function pO(X) {
        return typeof X == "string" && cO.has(X);
      }
      pG.isJSONType = pO;
      function dO() {
        let X = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } };
        return { types: { ...X, integer: true, boolean: true, null: true }, rules: [{ rules: [] }, X.number, X.string, X.array, X.object], post: { rules: [] }, all: {}, keywords: {} };
      }
      pG.getRules = dO;
    });
    UY = P((rG) => {
      Object.defineProperty(rG, "__esModule", { value: true });
      rG.shouldUseRule = rG.shouldUseGroup = rG.schemaHasRulesForType = void 0;
      function nO({ schema: X, self: Q }, $) {
        let Y = Q.RULES.types[$];
        return Y && Y !== true && iG(X, Y);
      }
      rG.schemaHasRulesForType = nO;
      function iG(X, Q) {
        return Q.rules.some(($) => nG(X, $));
      }
      rG.shouldUseGroup = iG;
      function nG(X, Q) {
        var $;
        return X[Q.keyword] !== void 0 || (($ = Q.definition.implements) === null || $ === void 0 ? void 0 : $.some((Y) => X[Y] !== void 0));
      }
      rG.shouldUseRule = nG;
    });
    mX = P((eG) => {
      Object.defineProperty(eG, "__esModule", { value: true });
      eG.reportTypeError = eG.checkDataTypes = eG.checkDataType = eG.coerceAndCheckDataType = eG.getJSONTypes = eG.getSchemaTypes = eG.DataType = void 0;
      var tO = KY(), aO = UY(), sO = lX(), m = c(), tG = e(), u6;
      (function(X) {
        X[X.Correct = 0] = "Correct", X[X.Wrong = 1] = "Wrong";
      })(u6 || (eG.DataType = u6 = {}));
      function eO(X) {
        let Q = aG(X.type);
        if (Q.includes("null")) {
          if (X.nullable === false) throw Error("type: null contradicts nullable: false");
        } else {
          if (!Q.length && X.nullable !== void 0) throw Error('"nullable" cannot be used without "type"');
          if (X.nullable === true) Q.push("null");
        }
        return Q;
      }
      eG.getSchemaTypes = eO;
      function aG(X) {
        let Q = Array.isArray(X) ? X : X ? [X] : [];
        if (Q.every(tO.isJSONType)) return Q;
        throw Error("type must be JSONType or JSONType[]: " + Q.join(","));
      }
      eG.getJSONTypes = aG;
      function XD(X, Q) {
        let { gen: $, data: Y, opts: W } = X, J = QD(Q, W.coerceTypes), G = Q.length > 0 && !(J.length === 0 && Q.length === 1 && (0, aO.schemaHasRulesForType)(X, Q[0]));
        if (G) {
          let H = LY(Q, Y, W.strictNumbers, u6.Wrong);
          $.if(H, () => {
            if (J.length) $D(X, Q, J);
            else qY(X);
          });
        }
        return G;
      }
      eG.coerceAndCheckDataType = XD;
      var sG = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
      function QD(X, Q) {
        return Q ? X.filter(($) => sG.has($) || Q === "array" && $ === "array") : [];
      }
      function $D(X, Q, $) {
        let { gen: Y, data: W, opts: J } = X, G = Y.let("dataType", m._`typeof ${W}`), H = Y.let("coerced", m._`undefined`);
        if (J.coerceTypes === "array") Y.if(m._`${G} == 'object' && Array.isArray(${W}) && ${W}.length == 1`, () => Y.assign(W, m._`${W}[0]`).assign(G, m._`typeof ${W}`).if(LY(Q, W, J.strictNumbers), () => Y.assign(H, W)));
        Y.if(m._`${H} !== undefined`);
        for (let z of $) if (sG.has(z) || z === "array" && J.coerceTypes === "array") B(z);
        Y.else(), qY(X), Y.endIf(), Y.if(m._`${H} !== undefined`, () => {
          Y.assign(W, H), YD(X, H);
        });
        function B(z) {
          switch (z) {
            case "string":
              Y.elseIf(m._`${G} == "number" || ${G} == "boolean"`).assign(H, m._`"" + ${W}`).elseIf(m._`${W} === null`).assign(H, m._`""`);
              return;
            case "number":
              Y.elseIf(m._`${G} == "boolean" || ${W} === null
              || (${G} == "string" && ${W} && ${W} == +${W})`).assign(H, m._`+${W}`);
              return;
            case "integer":
              Y.elseIf(m._`${G} === "boolean" || ${W} === null
              || (${G} === "string" && ${W} && ${W} == +${W} && !(${W} % 1))`).assign(H, m._`+${W}`);
              return;
            case "boolean":
              Y.elseIf(m._`${W} === "false" || ${W} === 0 || ${W} === null`).assign(H, false).elseIf(m._`${W} === "true" || ${W} === 1`).assign(H, true);
              return;
            case "null":
              Y.elseIf(m._`${W} === "" || ${W} === 0 || ${W} === false`), Y.assign(H, null);
              return;
            case "array":
              Y.elseIf(m._`${G} === "string" || ${G} === "number"
              || ${G} === "boolean" || ${W} === null`).assign(H, m._`[${W}]`);
          }
        }
      }
      function YD({ gen: X, parentData: Q, parentDataProperty: $ }, Y) {
        X.if(m._`${Q} !== undefined`, () => X.assign(m._`${Q}[${$}]`, Y));
      }
      function VY(X, Q, $, Y = u6.Correct) {
        let W = Y === u6.Correct ? m.operators.EQ : m.operators.NEQ, J;
        switch (X) {
          case "null":
            return m._`${Q} ${W} null`;
          case "array":
            J = m._`Array.isArray(${Q})`;
            break;
          case "object":
            J = m._`${Q} && typeof ${Q} == "object" && !Array.isArray(${Q})`;
            break;
          case "integer":
            J = G(m._`!(${Q} % 1) && !isNaN(${Q})`);
            break;
          case "number":
            J = G();
            break;
          default:
            return m._`typeof ${Q} ${W} ${X}`;
        }
        return Y === u6.Correct ? J : (0, m.not)(J);
        function G(H = m.nil) {
          return (0, m.and)(m._`typeof ${Q} == "number"`, H, $ ? m._`isFinite(${Q})` : m.nil);
        }
      }
      eG.checkDataType = VY;
      function LY(X, Q, $, Y) {
        if (X.length === 1) return VY(X[0], Q, $, Y);
        let W, J = (0, tG.toHash)(X);
        if (J.array && J.object) {
          let G = m._`typeof ${Q} != "object"`;
          W = J.null ? G : m._`!${Q} || ${G}`, delete J.null, delete J.array, delete J.object;
        } else W = m.nil;
        if (J.number) delete J.integer;
        for (let G in J) W = (0, m.and)(W, VY(G, Q, $, Y));
        return W;
      }
      eG.checkDataTypes = LY;
      var WD = { message: ({ schema: X }) => `must be ${X}`, params: ({ schema: X, schemaValue: Q }) => typeof X == "string" ? m._`{type: ${X}}` : m._`{type: ${Q}}` };
      function qY(X) {
        let Q = JD(X);
        (0, sO.reportError)(Q, WD);
      }
      eG.reportTypeError = qY;
      function JD(X) {
        let { gen: Q, data: $, schema: Y } = X, W = (0, tG.schemaRefOrVal)(X, Y, "type");
        return { gen: Q, keyword: "type", data: $, schema: Y.type, schemaCode: W, schemaValue: W, parentSchema: Y, params: {}, it: X };
      }
    });
    W3 = P(($3) => {
      Object.defineProperty($3, "__esModule", { value: true });
      $3.assignDefaults = void 0;
      var l6 = c(), VD = e();
      function LD(X, Q) {
        let { properties: $, items: Y } = X.schema;
        if (Q === "object" && $) for (let W in $) Q3(X, W, $[W].default);
        else if (Q === "array" && Array.isArray(Y)) Y.forEach((W, J) => Q3(X, J, W.default));
      }
      $3.assignDefaults = LD;
      function Q3(X, Q, $) {
        let { gen: Y, compositeRule: W, data: J, opts: G } = X;
        if ($ === void 0) return;
        let H = l6._`${J}${(0, l6.getProperty)(Q)}`;
        if (W) {
          (0, VD.checkStrictMode)(X, `default is ignored for: ${H}`);
          return;
        }
        let B = l6._`${H} === undefined`;
        if (G.useDefaults === "empty") B = l6._`${B} || ${H} === null || ${H} === ""`;
        Y.if(B, l6._`${H} = ${(0, l6.stringify)($)}`);
      }
    });
    d0 = P((H3) => {
      Object.defineProperty(H3, "__esModule", { value: true });
      H3.validateUnion = H3.validateArray = H3.usePattern = H3.callValidateCode = H3.schemaProperties = H3.allSchemaProperties = H3.noPropertyInData = H3.propertyInData = H3.isOwnProperty = H3.hasPropFunc = H3.reportMissingProp = H3.checkMissingProp = H3.checkReportMissingProp = void 0;
      var G0 = c(), FY = e(), p1 = R1(), qD = e();
      function FD(X, Q) {
        let { gen: $, data: Y, it: W } = X;
        $.if(OY($, Y, Q, W.opts.ownProperties), () => {
          X.setParams({ missingProperty: G0._`${Q}` }, true), X.error();
        });
      }
      H3.checkReportMissingProp = FD;
      function ND({ gen: X, data: Q, it: { opts: $ } }, Y, W) {
        return (0, G0.or)(...Y.map((J) => (0, G0.and)(OY(X, Q, J, $.ownProperties), G0._`${W} = ${J}`)));
      }
      H3.checkMissingProp = ND;
      function OD(X, Q) {
        X.setParams({ missingProperty: Q }, true), X.error();
      }
      H3.reportMissingProp = OD;
      function J3(X) {
        return X.scopeValue("func", { ref: Object.prototype.hasOwnProperty, code: G0._`Object.prototype.hasOwnProperty` });
      }
      H3.hasPropFunc = J3;
      function NY(X, Q, $) {
        return G0._`${J3(X)}.call(${Q}, ${$})`;
      }
      H3.isOwnProperty = NY;
      function DD(X, Q, $, Y) {
        let W = G0._`${Q}${(0, G0.getProperty)($)} !== undefined`;
        return Y ? G0._`${W} && ${NY(X, Q, $)}` : W;
      }
      H3.propertyInData = DD;
      function OY(X, Q, $, Y) {
        let W = G0._`${Q}${(0, G0.getProperty)($)} === undefined`;
        return Y ? (0, G0.or)(W, (0, G0.not)(NY(X, Q, $))) : W;
      }
      H3.noPropertyInData = OY;
      function G3(X) {
        return X ? Object.keys(X).filter((Q) => Q !== "__proto__") : [];
      }
      H3.allSchemaProperties = G3;
      function AD(X, Q) {
        return G3(Q).filter(($) => !(0, FY.alwaysValidSchema)(X, Q[$]));
      }
      H3.schemaProperties = AD;
      function wD({ schemaCode: X, data: Q, it: { gen: $, topSchemaRef: Y, schemaPath: W, errorPath: J }, it: G }, H, B, z) {
        let K = z ? G0._`${X}, ${Q}, ${Y}${W}` : Q, V = [[p1.default.instancePath, (0, G0.strConcat)(p1.default.instancePath, J)], [p1.default.parentData, G.parentData], [p1.default.parentDataProperty, G.parentDataProperty], [p1.default.rootData, p1.default.rootData]];
        if (G.opts.dynamicRef) V.push([p1.default.dynamicAnchors, p1.default.dynamicAnchors]);
        let L = G0._`${K}, ${$.object(...V)}`;
        return B !== G0.nil ? G0._`${H}.call(${B}, ${L})` : G0._`${H}(${L})`;
      }
      H3.callValidateCode = wD;
      var MD = G0._`new RegExp`;
      function jD({ gen: X, it: { opts: Q } }, $) {
        let Y = Q.unicodeRegExp ? "u" : "", { regExp: W } = Q.code, J = W($, Y);
        return X.scopeValue("pattern", { key: J.toString(), ref: J, code: G0._`${W.code === "new RegExp" ? MD : (0, qD.useFunc)(X, W)}(${$}, ${Y})` });
      }
      H3.usePattern = jD;
      function RD(X) {
        let { gen: Q, data: $, keyword: Y, it: W } = X, J = Q.name("valid");
        if (W.allErrors) {
          let H = Q.let("valid", true);
          return G(() => Q.assign(H, false)), H;
        }
        return Q.var(J, true), G(() => Q.break()), J;
        function G(H) {
          let B = Q.const("len", G0._`${$}.length`);
          Q.forRange("i", 0, B, (z) => {
            X.subschema({ keyword: Y, dataProp: z, dataPropType: FY.Type.Num }, J), Q.if((0, G0.not)(J), H);
          });
        }
      }
      H3.validateArray = RD;
      function ID(X) {
        let { gen: Q, schema: $, keyword: Y, it: W } = X;
        if (!Array.isArray($)) throw Error("ajv implementation error");
        if ($.some((B) => (0, FY.alwaysValidSchema)(W, B)) && !W.opts.unevaluated) return;
        let G = Q.let("valid", false), H = Q.name("_valid");
        Q.block(() => $.forEach((B, z) => {
          let K = X.subschema({ keyword: Y, schemaProp: z, compositeRule: true }, H);
          if (Q.assign(G, G0._`${G} || ${H}`), !X.mergeValidEvaluated(K, H)) Q.if((0, G0.not)(G));
        })), X.result(G, () => X.reset(), () => X.error(true));
      }
      H3.validateUnion = ID;
    });
    L3 = P((U3) => {
      Object.defineProperty(U3, "__esModule", { value: true });
      U3.validateKeywordUsage = U3.validSchemaType = U3.funcKeywordCode = U3.macroKeywordCode = void 0;
      var T0 = c(), B6 = R1(), gD = d0(), fD = lX();
      function hD(X, Q) {
        let { gen: $, keyword: Y, schema: W, parentSchema: J, it: G } = X, H = Q.macro.call(G.self, W, J, G), B = K3($, Y, H);
        if (G.opts.validateSchema !== false) G.self.validateSchema(H, true);
        let z = $.name("valid");
        X.subschema({ schema: H, schemaPath: T0.nil, errSchemaPath: `${G.errSchemaPath}/${Y}`, topSchemaRef: B, compositeRule: true }, z), X.pass(z, () => X.error(true));
      }
      U3.macroKeywordCode = hD;
      function uD(X, Q) {
        var $;
        let { gen: Y, keyword: W, schema: J, parentSchema: G, $data: H, it: B } = X;
        mD(B, Q);
        let z = !H && Q.compile ? Q.compile.call(B.self, J, G, B) : Q.validate, K = K3(Y, W, z), V = Y.let("valid");
        X.block$data(V, L), X.ok(($ = Q.valid) !== null && $ !== void 0 ? $ : V);
        function L() {
          if (Q.errors === false) {
            if (q(), Q.modifying) z3(X);
            N(() => X.error());
          } else {
            let A = Q.async ? U() : F();
            if (Q.modifying) z3(X);
            N(() => lD(X, A));
          }
        }
        function U() {
          let A = Y.let("ruleErrs", null);
          return Y.try(() => q(T0._`await `), (M) => Y.assign(V, false).if(T0._`${M} instanceof ${B.ValidationError}`, () => Y.assign(A, T0._`${M}.errors`), () => Y.throw(M))), A;
        }
        function F() {
          let A = T0._`${K}.errors`;
          return Y.assign(A, null), q(T0.nil), A;
        }
        function q(A = Q.async ? T0._`await ` : T0.nil) {
          let M = B.opts.passContext ? B6.default.this : B6.default.self, R = !("compile" in Q && !H || Q.schema === false);
          Y.assign(V, T0._`${A}${(0, gD.callValidateCode)(X, K, M, R)}`, Q.modifying);
        }
        function N(A) {
          var M;
          Y.if((0, T0.not)((M = Q.valid) !== null && M !== void 0 ? M : V), A);
        }
      }
      U3.funcKeywordCode = uD;
      function z3(X) {
        let { gen: Q, data: $, it: Y } = X;
        Q.if(Y.parentData, () => Q.assign($, T0._`${Y.parentData}[${Y.parentDataProperty}]`));
      }
      function lD(X, Q) {
        let { gen: $ } = X;
        $.if(T0._`Array.isArray(${Q})`, () => {
          $.assign(B6.default.vErrors, T0._`${B6.default.vErrors} === null ? ${Q} : ${B6.default.vErrors}.concat(${Q})`).assign(B6.default.errors, T0._`${B6.default.vErrors}.length`), (0, fD.extendErrors)(X);
        }, () => X.error());
      }
      function mD({ schemaEnv: X }, Q) {
        if (Q.async && !X.$async) throw Error("async keyword in sync schema");
      }
      function K3(X, Q, $) {
        if ($ === void 0) throw Error(`keyword "${Q}" failed to compile`);
        return X.scopeValue("keyword", typeof $ == "function" ? { ref: $ } : { ref: $, code: (0, T0.stringify)($) });
      }
      function cD(X, Q, $ = false) {
        return !Q.length || Q.some((Y) => Y === "array" ? Array.isArray(X) : Y === "object" ? X && typeof X == "object" && !Array.isArray(X) : typeof X == Y || $ && typeof X > "u");
      }
      U3.validSchemaType = cD;
      function pD({ schema: X, opts: Q, self: $, errSchemaPath: Y }, W, J) {
        if (Array.isArray(W.keyword) ? !W.keyword.includes(J) : W.keyword !== J) throw Error("ajv implementation error");
        let G = W.dependencies;
        if (G === null || G === void 0 ? void 0 : G.some((H) => !Object.prototype.hasOwnProperty.call(X, H))) throw Error(`parent schema must have dependencies of ${J}: ${G.join(",")}`);
        if (W.validateSchema) {
          if (!W.validateSchema(X[J])) {
            let B = `keyword "${J}" value is invalid at path "${Y}": ` + $.errorsText(W.validateSchema.errors);
            if (Q.validateSchema === "log") $.logger.error(B);
            else throw Error(B);
          }
        }
      }
      U3.validateKeywordUsage = pD;
    });
    O3 = P((F3) => {
      Object.defineProperty(F3, "__esModule", { value: true });
      F3.extendSubschemaMode = F3.extendSubschemaData = F3.getSubschema = void 0;
      var K1 = c(), q3 = e();
      function rD(X, { keyword: Q, schemaProp: $, schema: Y, schemaPath: W, errSchemaPath: J, topSchemaRef: G }) {
        if (Q !== void 0 && Y !== void 0) throw Error('both "keyword" and "schema" passed, only one allowed');
        if (Q !== void 0) {
          let H = X.schema[Q];
          return $ === void 0 ? { schema: H, schemaPath: K1._`${X.schemaPath}${(0, K1.getProperty)(Q)}`, errSchemaPath: `${X.errSchemaPath}/${Q}` } : { schema: H[$], schemaPath: K1._`${X.schemaPath}${(0, K1.getProperty)(Q)}${(0, K1.getProperty)($)}`, errSchemaPath: `${X.errSchemaPath}/${Q}/${(0, q3.escapeFragment)($)}` };
        }
        if (Y !== void 0) {
          if (W === void 0 || J === void 0 || G === void 0) throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
          return { schema: Y, schemaPath: W, topSchemaRef: G, errSchemaPath: J };
        }
        throw Error('either "keyword" or "schema" must be passed');
      }
      F3.getSubschema = rD;
      function oD(X, Q, { dataProp: $, dataPropType: Y, data: W, dataTypes: J, propertyName: G }) {
        if (W !== void 0 && $ !== void 0) throw Error('both "data" and "dataProp" passed, only one allowed');
        let { gen: H } = Q;
        if ($ !== void 0) {
          let { errorPath: z, dataPathArr: K, opts: V } = Q, L = H.let("data", K1._`${Q.data}${(0, K1.getProperty)($)}`, true);
          B(L), X.errorPath = K1.str`${z}${(0, q3.getErrorPath)($, Y, V.jsPropertySyntax)}`, X.parentDataProperty = K1._`${$}`, X.dataPathArr = [...K, X.parentDataProperty];
        }
        if (W !== void 0) {
          let z = W instanceof K1.Name ? W : H.let("data", W, true);
          if (B(z), G !== void 0) X.propertyName = G;
        }
        if (J) X.dataTypes = J;
        function B(z) {
          X.data = z, X.dataLevel = Q.dataLevel + 1, X.dataTypes = [], Q.definedProperties = /* @__PURE__ */ new Set(), X.parentData = Q.data, X.dataNames = [...Q.dataNames, z];
        }
      }
      F3.extendSubschemaData = oD;
      function tD(X, { jtdDiscriminator: Q, jtdMetadata: $, compositeRule: Y, createErrors: W, allErrors: J }) {
        if (Y !== void 0) X.compositeRule = Y;
        if (W !== void 0) X.createErrors = W;
        if (J !== void 0) X.allErrors = J;
        X.jtdDiscriminator = Q, X.jtdMetadata = $;
      }
      F3.extendSubschemaMode = tD;
    });
    DY = P((QT, D3) => {
      D3.exports = function X(Q, $) {
        if (Q === $) return true;
        if (Q && $ && typeof Q == "object" && typeof $ == "object") {
          if (Q.constructor !== $.constructor) return false;
          var Y, W, J;
          if (Array.isArray(Q)) {
            if (Y = Q.length, Y != $.length) return false;
            for (W = Y; W-- !== 0; ) if (!X(Q[W], $[W])) return false;
            return true;
          }
          if (Q.constructor === RegExp) return Q.source === $.source && Q.flags === $.flags;
          if (Q.valueOf !== Object.prototype.valueOf) return Q.valueOf() === $.valueOf();
          if (Q.toString !== Object.prototype.toString) return Q.toString() === $.toString();
          if (J = Object.keys(Q), Y = J.length, Y !== Object.keys($).length) return false;
          for (W = Y; W-- !== 0; ) if (!Object.prototype.hasOwnProperty.call($, J[W])) return false;
          for (W = Y; W-- !== 0; ) {
            var G = J[W];
            if (!X(Q[G], $[G])) return false;
          }
          return true;
        }
        return Q !== Q && $ !== $;
      };
    });
    w3 = P(($T, A3) => {
      var d1 = A3.exports = function(X, Q, $) {
        if (typeof Q == "function") $ = Q, Q = {};
        $ = Q.cb || $;
        var Y = typeof $ == "function" ? $ : $.pre || function() {
        }, W = $.post || function() {
        };
        C8(Q, Y, W, X, "", X);
      };
      d1.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true, if: true, then: true, else: true };
      d1.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true };
      d1.propsKeywords = { $defs: true, definitions: true, properties: true, patternProperties: true, dependencies: true };
      d1.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true };
      function C8(X, Q, $, Y, W, J, G, H, B, z) {
        if (Y && typeof Y == "object" && !Array.isArray(Y)) {
          Q(Y, W, J, G, H, B, z);
          for (var K in Y) {
            var V = Y[K];
            if (Array.isArray(V)) {
              if (K in d1.arrayKeywords) for (var L = 0; L < V.length; L++) C8(X, Q, $, V[L], W + "/" + K + "/" + L, J, W, K, Y, L);
            } else if (K in d1.propsKeywords) {
              if (V && typeof V == "object") for (var U in V) C8(X, Q, $, V[U], W + "/" + K + "/" + eD(U), J, W, K, Y, U);
            } else if (K in d1.keywords || X.allKeys && !(K in d1.skipKeywords)) C8(X, Q, $, V, W + "/" + K, J, W, K, Y);
          }
          $(Y, W, J, G, H, B, z);
        }
      }
      function eD(X) {
        return X.replace(/~/g, "~0").replace(/\//g, "~1");
      }
    });
    cX = P((I3) => {
      Object.defineProperty(I3, "__esModule", { value: true });
      I3.getSchemaRefs = I3.resolveUrl = I3.normalizeId = I3._getFullPath = I3.getFullPath = I3.inlineRef = void 0;
      var XA = e(), QA = DY(), $A = w3(), YA = /* @__PURE__ */ new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]);
      function WA(X, Q = true) {
        if (typeof X == "boolean") return true;
        if (Q === true) return !AY(X);
        if (!Q) return false;
        return M3(X) <= Q;
      }
      I3.inlineRef = WA;
      var JA = /* @__PURE__ */ new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]);
      function AY(X) {
        for (let Q in X) {
          if (JA.has(Q)) return true;
          let $ = X[Q];
          if (Array.isArray($) && $.some(AY)) return true;
          if (typeof $ == "object" && AY($)) return true;
        }
        return false;
      }
      function M3(X) {
        let Q = 0;
        for (let $ in X) {
          if ($ === "$ref") return 1 / 0;
          if (Q++, YA.has($)) continue;
          if (typeof X[$] == "object") (0, XA.eachItem)(X[$], (Y) => Q += M3(Y));
          if (Q === 1 / 0) return 1 / 0;
        }
        return Q;
      }
      function j3(X, Q = "", $) {
        if ($ !== false) Q = m6(Q);
        let Y = X.parse(Q);
        return R3(X, Y);
      }
      I3.getFullPath = j3;
      function R3(X, Q) {
        return X.serialize(Q).split("#")[0] + "#";
      }
      I3._getFullPath = R3;
      var GA = /#\/?$/;
      function m6(X) {
        return X ? X.replace(GA, "") : "";
      }
      I3.normalizeId = m6;
      function HA(X, Q, $) {
        return $ = m6($), X.resolve(Q, $);
      }
      I3.resolveUrl = HA;
      var BA = /^[a-z_][-a-z0-9._]*$/i;
      function zA(X, Q) {
        if (typeof X == "boolean") return {};
        let { schemaId: $, uriResolver: Y } = this.opts, W = m6(X[$] || Q), J = { "": W }, G = j3(Y, W, false), H = {}, B = /* @__PURE__ */ new Set();
        return $A(X, { allKeys: true }, (V, L, U, F) => {
          if (F === void 0) return;
          let q = G + L, N = J[F];
          if (typeof V[$] == "string") N = A.call(this, V[$]);
          M.call(this, V.$anchor), M.call(this, V.$dynamicAnchor), J[L] = N;
          function A(R) {
            let S = this.opts.uriResolver.resolve;
            if (R = m6(N ? S(N, R) : R), B.has(R)) throw K(R);
            B.add(R);
            let C = this.refs[R];
            if (typeof C == "string") C = this.refs[C];
            if (typeof C == "object") z(V, C.schema, R);
            else if (R !== m6(q)) if (R[0] === "#") z(V, H[R], R), H[R] = V;
            else this.refs[R] = q;
            return R;
          }
          function M(R) {
            if (typeof R == "string") {
              if (!BA.test(R)) throw Error(`invalid anchor "${R}"`);
              A.call(this, `#${R}`);
            }
          }
        }), H;
        function z(V, L, U) {
          if (L !== void 0 && !QA(V, L)) throw K(U);
        }
        function K(V) {
          return Error(`reference "${V}" resolves to more than one schema`);
        }
      }
      I3.getSchemaRefs = zA;
    });
    iX = P((u3) => {
      Object.defineProperty(u3, "__esModule", { value: true });
      u3.getData = u3.KeywordCxt = u3.validateFunctionCode = void 0;
      var C3 = cG(), b3 = mX(), MY = UY(), k8 = mX(), FA = W3(), dX = L3(), wY = O3(), _ = c(), u = R1(), NA = cX(), I1 = e(), pX = lX();
      function OA(X) {
        if (T3(X)) {
          if (_3(X), v3(X)) {
            wA(X);
            return;
          }
        }
        k3(X, () => (0, C3.topBoolOrEmptySchema)(X));
      }
      u3.validateFunctionCode = OA;
      function k3({ gen: X, validateName: Q, schema: $, schemaEnv: Y, opts: W }, J) {
        if (W.code.es5) X.func(Q, _._`${u.default.data}, ${u.default.valCxt}`, Y.$async, () => {
          X.code(_._`"use strict"; ${P3($, W)}`), AA(X, W), X.code(J);
        });
        else X.func(Q, _._`${u.default.data}, ${DA(W)}`, Y.$async, () => X.code(P3($, W)).code(J));
      }
      function DA(X) {
        return _._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${X.dynamicRef ? _._`, ${u.default.dynamicAnchors}={}` : _.nil}}={}`;
      }
      function AA(X, Q) {
        X.if(u.default.valCxt, () => {
          if (X.var(u.default.instancePath, _._`${u.default.valCxt}.${u.default.instancePath}`), X.var(u.default.parentData, _._`${u.default.valCxt}.${u.default.parentData}`), X.var(u.default.parentDataProperty, _._`${u.default.valCxt}.${u.default.parentDataProperty}`), X.var(u.default.rootData, _._`${u.default.valCxt}.${u.default.rootData}`), Q.dynamicRef) X.var(u.default.dynamicAnchors, _._`${u.default.valCxt}.${u.default.dynamicAnchors}`);
        }, () => {
          if (X.var(u.default.instancePath, _._`""`), X.var(u.default.parentData, _._`undefined`), X.var(u.default.parentDataProperty, _._`undefined`), X.var(u.default.rootData, u.default.data), Q.dynamicRef) X.var(u.default.dynamicAnchors, _._`{}`);
        });
      }
      function wA(X) {
        let { schema: Q, opts: $, gen: Y } = X;
        k3(X, () => {
          if ($.$comment && Q.$comment) y3(X);
          if (EA(X), Y.let(u.default.vErrors, null), Y.let(u.default.errors, 0), $.unevaluated) MA(X);
          x3(X), SA(X);
        });
        return;
      }
      function MA(X) {
        let { gen: Q, validateName: $ } = X;
        X.evaluated = Q.const("evaluated", _._`${$}.evaluated`), Q.if(_._`${X.evaluated}.dynamicProps`, () => Q.assign(_._`${X.evaluated}.props`, _._`undefined`)), Q.if(_._`${X.evaluated}.dynamicItems`, () => Q.assign(_._`${X.evaluated}.items`, _._`undefined`));
      }
      function P3(X, Q) {
        let $ = typeof X == "object" && X[Q.schemaId];
        return $ && (Q.code.source || Q.code.process) ? _._`/*# sourceURL=${$} */` : _.nil;
      }
      function jA(X, Q) {
        if (T3(X)) {
          if (_3(X), v3(X)) {
            RA(X, Q);
            return;
          }
        }
        (0, C3.boolOrEmptySchema)(X, Q);
      }
      function v3({ schema: X, self: Q }) {
        if (typeof X == "boolean") return !X;
        for (let $ in X) if (Q.RULES.all[$]) return true;
        return false;
      }
      function T3(X) {
        return typeof X.schema != "boolean";
      }
      function RA(X, Q) {
        let { schema: $, gen: Y, opts: W } = X;
        if (W.$comment && $.$comment) y3(X);
        bA(X), PA(X);
        let J = Y.const("_errs", u.default.errors);
        x3(X, J), Y.var(Q, _._`${J} === ${u.default.errors}`);
      }
      function _3(X) {
        (0, I1.checkUnknownRules)(X), IA(X);
      }
      function x3(X, Q) {
        if (X.opts.jtd) return S3(X, [], false, Q);
        let $ = (0, b3.getSchemaTypes)(X.schema), Y = (0, b3.coerceAndCheckDataType)(X, $);
        S3(X, $, !Y, Q);
      }
      function IA(X) {
        let { schema: Q, errSchemaPath: $, opts: Y, self: W } = X;
        if (Q.$ref && Y.ignoreKeywordsWithRef && (0, I1.schemaHasRulesButRef)(Q, W.RULES)) W.logger.warn(`$ref: keywords ignored in schema at path "${$}"`);
      }
      function EA(X) {
        let { schema: Q, opts: $ } = X;
        if (Q.default !== void 0 && $.useDefaults && $.strictSchema) (0, I1.checkStrictMode)(X, "default is ignored in the schema root");
      }
      function bA(X) {
        let Q = X.schema[X.opts.schemaId];
        if (Q) X.baseId = (0, NA.resolveUrl)(X.opts.uriResolver, X.baseId, Q);
      }
      function PA(X) {
        if (X.schema.$async && !X.schemaEnv.$async) throw Error("async schema in sync schema");
      }
      function y3({ gen: X, schemaEnv: Q, schema: $, errSchemaPath: Y, opts: W }) {
        let J = $.$comment;
        if (W.$comment === true) X.code(_._`${u.default.self}.logger.log(${J})`);
        else if (typeof W.$comment == "function") {
          let G = _.str`${Y}/$comment`, H = X.scopeValue("root", { ref: Q.root });
          X.code(_._`${u.default.self}.opts.$comment(${J}, ${G}, ${H}.schema)`);
        }
      }
      function SA(X) {
        let { gen: Q, schemaEnv: $, validateName: Y, ValidationError: W, opts: J } = X;
        if ($.$async) Q.if(_._`${u.default.errors} === 0`, () => Q.return(u.default.data), () => Q.throw(_._`new ${W}(${u.default.vErrors})`));
        else {
          if (Q.assign(_._`${Y}.errors`, u.default.vErrors), J.unevaluated) ZA(X);
          Q.return(_._`${u.default.errors} === 0`);
        }
      }
      function ZA({ gen: X, evaluated: Q, props: $, items: Y }) {
        if ($ instanceof _.Name) X.assign(_._`${Q}.props`, $);
        if (Y instanceof _.Name) X.assign(_._`${Q}.items`, Y);
      }
      function S3(X, Q, $, Y) {
        let { gen: W, schema: J, data: G, allErrors: H, opts: B, self: z } = X, { RULES: K } = z;
        if (J.$ref && (B.ignoreKeywordsWithRef || !(0, I1.schemaHasRulesButRef)(J, K))) {
          W.block(() => f3(X, "$ref", K.all.$ref.definition));
          return;
        }
        if (!B.jtd) CA(X, Q);
        W.block(() => {
          for (let L of K.rules) V(L);
          V(K.post);
        });
        function V(L) {
          if (!(0, MY.shouldUseGroup)(J, L)) return;
          if (L.type) {
            if (W.if((0, k8.checkDataType)(L.type, G, B.strictNumbers)), Z3(X, L), Q.length === 1 && Q[0] === L.type && $) W.else(), (0, k8.reportTypeError)(X);
            W.endIf();
          } else Z3(X, L);
          if (!H) W.if(_._`${u.default.errors} === ${Y || 0}`);
        }
      }
      function Z3(X, Q) {
        let { gen: $, schema: Y, opts: { useDefaults: W } } = X;
        if (W) (0, FA.assignDefaults)(X, Q.type);
        $.block(() => {
          for (let J of Q.rules) if ((0, MY.shouldUseRule)(Y, J)) f3(X, J.keyword, J.definition, Q.type);
        });
      }
      function CA(X, Q) {
        if (X.schemaEnv.meta || !X.opts.strictTypes) return;
        if (kA(X, Q), !X.opts.allowUnionTypes) vA(X, Q);
        TA(X, X.dataTypes);
      }
      function kA(X, Q) {
        if (!Q.length) return;
        if (!X.dataTypes.length) {
          X.dataTypes = Q;
          return;
        }
        Q.forEach(($) => {
          if (!g3(X.dataTypes, $)) jY(X, `type "${$}" not allowed by context "${X.dataTypes.join(",")}"`);
        }), xA(X, Q);
      }
      function vA(X, Q) {
        if (Q.length > 1 && !(Q.length === 2 && Q.includes("null"))) jY(X, "use allowUnionTypes to allow union type keyword");
      }
      function TA(X, Q) {
        let $ = X.self.RULES.all;
        for (let Y in $) {
          let W = $[Y];
          if (typeof W == "object" && (0, MY.shouldUseRule)(X.schema, W)) {
            let { type: J } = W.definition;
            if (J.length && !J.some((G) => _A(Q, G))) jY(X, `missing type "${J.join(",")}" for keyword "${Y}"`);
          }
        }
      }
      function _A(X, Q) {
        return X.includes(Q) || Q === "number" && X.includes("integer");
      }
      function g3(X, Q) {
        return X.includes(Q) || Q === "integer" && X.includes("number");
      }
      function xA(X, Q) {
        let $ = [];
        for (let Y of X.dataTypes) if (g3(Q, Y)) $.push(Y);
        else if (Q.includes("integer") && Y === "number") $.push("integer");
        X.dataTypes = $;
      }
      function jY(X, Q) {
        let $ = X.schemaEnv.baseId + X.errSchemaPath;
        Q += ` at "${$}" (strictTypes)`, (0, I1.checkStrictMode)(X, Q, X.opts.strictTypes);
      }
      class RY {
        constructor(X, Q, $) {
          if ((0, dX.validateKeywordUsage)(X, Q, $), this.gen = X.gen, this.allErrors = X.allErrors, this.keyword = $, this.data = X.data, this.schema = X.schema[$], this.$data = Q.$data && X.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, I1.schemaRefOrVal)(X, this.schema, $, this.$data), this.schemaType = Q.schemaType, this.parentSchema = X.schema, this.params = {}, this.it = X, this.def = Q, this.$data) this.schemaCode = X.gen.const("vSchema", h3(this.$data, X));
          else if (this.schemaCode = this.schemaValue, !(0, dX.validSchemaType)(this.schema, Q.schemaType, Q.allowUndefined)) throw Error(`${$} value must be ${JSON.stringify(Q.schemaType)}`);
          if ("code" in Q ? Q.trackErrors : Q.errors !== false) this.errsCount = X.gen.const("_errs", u.default.errors);
        }
        result(X, Q, $) {
          this.failResult((0, _.not)(X), Q, $);
        }
        failResult(X, Q, $) {
          if (this.gen.if(X), $) $();
          else this.error();
          if (Q) {
            if (this.gen.else(), Q(), this.allErrors) this.gen.endIf();
          } else if (this.allErrors) this.gen.endIf();
          else this.gen.else();
        }
        pass(X, Q) {
          this.failResult((0, _.not)(X), void 0, Q);
        }
        fail(X) {
          if (X === void 0) {
            if (this.error(), !this.allErrors) this.gen.if(false);
            return;
          }
          if (this.gen.if(X), this.error(), this.allErrors) this.gen.endIf();
          else this.gen.else();
        }
        fail$data(X) {
          if (!this.$data) return this.fail(X);
          let { schemaCode: Q } = this;
          this.fail(_._`${Q} !== undefined && (${(0, _.or)(this.invalid$data(), X)})`);
        }
        error(X, Q, $) {
          if (Q) {
            this.setParams(Q), this._error(X, $), this.setParams({});
            return;
          }
          this._error(X, $);
        }
        _error(X, Q) {
          (X ? pX.reportExtraError : pX.reportError)(this, this.def.error, Q);
        }
        $dataError() {
          (0, pX.reportError)(this, this.def.$dataError || pX.keyword$DataError);
        }
        reset() {
          if (this.errsCount === void 0) throw Error('add "trackErrors" to keyword definition');
          (0, pX.resetErrorsCount)(this.gen, this.errsCount);
        }
        ok(X) {
          if (!this.allErrors) this.gen.if(X);
        }
        setParams(X, Q) {
          if (Q) Object.assign(this.params, X);
          else this.params = X;
        }
        block$data(X, Q, $ = _.nil) {
          this.gen.block(() => {
            this.check$data(X, $), Q();
          });
        }
        check$data(X = _.nil, Q = _.nil) {
          if (!this.$data) return;
          let { gen: $, schemaCode: Y, schemaType: W, def: J } = this;
          if ($.if((0, _.or)(_._`${Y} === undefined`, Q)), X !== _.nil) $.assign(X, true);
          if (W.length || J.validateSchema) {
            if ($.elseIf(this.invalid$data()), this.$dataError(), X !== _.nil) $.assign(X, false);
          }
          $.else();
        }
        invalid$data() {
          let { gen: X, schemaCode: Q, schemaType: $, def: Y, it: W } = this;
          return (0, _.or)(J(), G());
          function J() {
            if ($.length) {
              if (!(Q instanceof _.Name)) throw Error("ajv implementation error");
              let H = Array.isArray($) ? $ : [$];
              return _._`${(0, k8.checkDataTypes)(H, Q, W.opts.strictNumbers, k8.DataType.Wrong)}`;
            }
            return _.nil;
          }
          function G() {
            if (Y.validateSchema) {
              let H = X.scopeValue("validate$data", { ref: Y.validateSchema });
              return _._`!${H}(${Q})`;
            }
            return _.nil;
          }
        }
        subschema(X, Q) {
          let $ = (0, wY.getSubschema)(this.it, X);
          (0, wY.extendSubschemaData)($, this.it, X), (0, wY.extendSubschemaMode)($, X);
          let Y = { ...this.it, ...$, items: void 0, props: void 0 };
          return jA(Y, Q), Y;
        }
        mergeEvaluated(X, Q) {
          let { it: $, gen: Y } = this;
          if (!$.opts.unevaluated) return;
          if ($.props !== true && X.props !== void 0) $.props = I1.mergeEvaluated.props(Y, X.props, $.props, Q);
          if ($.items !== true && X.items !== void 0) $.items = I1.mergeEvaluated.items(Y, X.items, $.items, Q);
        }
        mergeValidEvaluated(X, Q) {
          let { it: $, gen: Y } = this;
          if ($.opts.unevaluated && ($.props !== true || $.items !== true)) return Y.if(Q, () => this.mergeEvaluated(X, _.Name)), true;
        }
      }
      u3.KeywordCxt = RY;
      function f3(X, Q, $, Y) {
        let W = new RY(X, $, Q);
        if ("code" in $) $.code(W, Y);
        else if (W.$data && $.validate) (0, dX.funcKeywordCode)(W, $);
        else if ("macro" in $) (0, dX.macroKeywordCode)(W, $);
        else if ($.compile || $.validate) (0, dX.funcKeywordCode)(W, $);
      }
      var yA = /^\/(?:[^~]|~0|~1)*$/, gA = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
      function h3(X, { dataLevel: Q, dataNames: $, dataPathArr: Y }) {
        let W, J;
        if (X === "") return u.default.rootData;
        if (X[0] === "/") {
          if (!yA.test(X)) throw Error(`Invalid JSON-pointer: ${X}`);
          W = X, J = u.default.rootData;
        } else {
          let z = gA.exec(X);
          if (!z) throw Error(`Invalid JSON-pointer: ${X}`);
          let K = +z[1];
          if (W = z[2], W === "#") {
            if (K >= Q) throw Error(B("property/index", K));
            return Y[Q - K];
          }
          if (K > Q) throw Error(B("data", K));
          if (J = $[Q - K], !W) return J;
        }
        let G = J, H = W.split("/");
        for (let z of H) if (z) J = _._`${J}${(0, _.getProperty)((0, I1.unescapeJsonPointer)(z))}`, G = _._`${G} && ${J}`;
        return G;
        function B(z, K) {
          return `Cannot access ${z} ${K} levels up, current level is ${Q}`;
        }
      }
      u3.getData = h3;
    });
    v8 = P((c3) => {
      Object.defineProperty(c3, "__esModule", { value: true });
      class m3 extends Error {
        constructor(X) {
          super("validation failed");
          this.errors = X, this.ajv = this.validation = true;
        }
      }
      c3.default = m3;
    });
    nX = P((d3) => {
      Object.defineProperty(d3, "__esModule", { value: true });
      var IY = cX();
      class p3 extends Error {
        constructor(X, Q, $, Y) {
          super(Y || `can't resolve reference ${$} from id ${Q}`);
          this.missingRef = (0, IY.resolveUrl)(X, Q, $), this.missingSchema = (0, IY.normalizeId)((0, IY.getFullPath)(X, this.missingRef));
        }
      }
      d3.default = p3;
    });
    _8 = P((r3) => {
      Object.defineProperty(r3, "__esModule", { value: true });
      r3.resolveSchema = r3.getCompilingSchema = r3.resolveRef = r3.compileSchema = r3.SchemaEnv = void 0;
      var X1 = c(), mA = v8(), z6 = R1(), Q1 = cX(), i3 = e(), cA = iX();
      class rX {
        constructor(X) {
          var Q;
          this.refs = {}, this.dynamicAnchors = {};
          let $;
          if (typeof X.schema == "object") $ = X.schema;
          this.schema = X.schema, this.schemaId = X.schemaId, this.root = X.root || this, this.baseId = (Q = X.baseId) !== null && Q !== void 0 ? Q : (0, Q1.normalizeId)($ === null || $ === void 0 ? void 0 : $[X.schemaId || "$id"]), this.schemaPath = X.schemaPath, this.localRefs = X.localRefs, this.meta = X.meta, this.$async = $ === null || $ === void 0 ? void 0 : $.$async, this.refs = {};
        }
      }
      r3.SchemaEnv = rX;
      function bY(X) {
        let Q = n3.call(this, X);
        if (Q) return Q;
        let $ = (0, Q1.getFullPath)(this.opts.uriResolver, X.root.baseId), { es5: Y, lines: W } = this.opts.code, { ownProperties: J } = this.opts, G = new X1.CodeGen(this.scope, { es5: Y, lines: W, ownProperties: J }), H;
        if (X.$async) H = G.scopeValue("Error", { ref: mA.default, code: X1._`require("ajv/dist/runtime/validation_error").default` });
        let B = G.scopeName("validate");
        X.validateName = B;
        let z = { gen: G, allErrors: this.opts.allErrors, data: z6.default.data, parentData: z6.default.parentData, parentDataProperty: z6.default.parentDataProperty, dataNames: [z6.default.data], dataPathArr: [X1.nil], dataLevel: 0, dataTypes: [], definedProperties: /* @__PURE__ */ new Set(), topSchemaRef: G.scopeValue("schema", this.opts.code.source === true ? { ref: X.schema, code: (0, X1.stringify)(X.schema) } : { ref: X.schema }), validateName: B, ValidationError: H, schema: X.schema, schemaEnv: X, rootId: $, baseId: X.baseId || $, schemaPath: X1.nil, errSchemaPath: X.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: X1._`""`, opts: this.opts, self: this }, K;
        try {
          this._compilations.add(X), (0, cA.validateFunctionCode)(z), G.optimize(this.opts.code.optimize);
          let V = G.toString();
          if (K = `${G.scopeRefs(z6.default.scope)}return ${V}`, this.opts.code.process) K = this.opts.code.process(K, X);
          let U = Function(`${z6.default.self}`, `${z6.default.scope}`, K)(this, this.scope.get());
          if (this.scope.value(B, { ref: U }), U.errors = null, U.schema = X.schema, U.schemaEnv = X, X.$async) U.$async = true;
          if (this.opts.code.source === true) U.source = { validateName: B, validateCode: V, scopeValues: G._values };
          if (this.opts.unevaluated) {
            let { props: F, items: q } = z;
            if (U.evaluated = { props: F instanceof X1.Name ? void 0 : F, items: q instanceof X1.Name ? void 0 : q, dynamicProps: F instanceof X1.Name, dynamicItems: q instanceof X1.Name }, U.source) U.source.evaluated = (0, X1.stringify)(U.evaluated);
          }
          return X.validate = U, X;
        } catch (V) {
          if (delete X.validate, delete X.validateName, K) this.logger.error("Error compiling schema, function code:", K);
          throw V;
        } finally {
          this._compilations.delete(X);
        }
      }
      r3.compileSchema = bY;
      function pA(X, Q, $) {
        var Y;
        $ = (0, Q1.resolveUrl)(this.opts.uriResolver, Q, $);
        let W = X.refs[$];
        if (W) return W;
        let J = nA.call(this, X, $);
        if (J === void 0) {
          let G = (Y = X.localRefs) === null || Y === void 0 ? void 0 : Y[$], { schemaId: H } = this.opts;
          if (G) J = new rX({ schema: G, schemaId: H, root: X, baseId: Q });
        }
        if (J === void 0) return;
        return X.refs[$] = dA.call(this, J);
      }
      r3.resolveRef = pA;
      function dA(X) {
        if ((0, Q1.inlineRef)(X.schema, this.opts.inlineRefs)) return X.schema;
        return X.validate ? X : bY.call(this, X);
      }
      function n3(X) {
        for (let Q of this._compilations) if (iA(Q, X)) return Q;
      }
      r3.getCompilingSchema = n3;
      function iA(X, Q) {
        return X.schema === Q.schema && X.root === Q.root && X.baseId === Q.baseId;
      }
      function nA(X, Q) {
        let $;
        while (typeof ($ = this.refs[Q]) == "string") Q = $;
        return $ || this.schemas[Q] || T8.call(this, X, Q);
      }
      function T8(X, Q) {
        let $ = this.opts.uriResolver.parse(Q), Y = (0, Q1._getFullPath)(this.opts.uriResolver, $), W = (0, Q1.getFullPath)(this.opts.uriResolver, X.baseId, void 0);
        if (Object.keys(X.schema).length > 0 && Y === W) return EY.call(this, $, X);
        let J = (0, Q1.normalizeId)(Y), G = this.refs[J] || this.schemas[J];
        if (typeof G == "string") {
          let H = T8.call(this, X, G);
          if (typeof (H === null || H === void 0 ? void 0 : H.schema) !== "object") return;
          return EY.call(this, $, H);
        }
        if (typeof (G === null || G === void 0 ? void 0 : G.schema) !== "object") return;
        if (!G.validate) bY.call(this, G);
        if (J === (0, Q1.normalizeId)(Q)) {
          let { schema: H } = G, { schemaId: B } = this.opts, z = H[B];
          if (z) W = (0, Q1.resolveUrl)(this.opts.uriResolver, W, z);
          return new rX({ schema: H, schemaId: B, root: X, baseId: W });
        }
        return EY.call(this, $, G);
      }
      r3.resolveSchema = T8;
      var rA = /* @__PURE__ */ new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
      function EY(X, { baseId: Q, schema: $, root: Y }) {
        var W;
        if (((W = X.fragment) === null || W === void 0 ? void 0 : W[0]) !== "/") return;
        for (let H of X.fragment.slice(1).split("/")) {
          if (typeof $ === "boolean") return;
          let B = $[(0, i3.unescapeFragment)(H)];
          if (B === void 0) return;
          $ = B;
          let z = typeof $ === "object" && $[this.opts.schemaId];
          if (!rA.has(H) && z) Q = (0, Q1.resolveUrl)(this.opts.uriResolver, Q, z);
        }
        let J;
        if (typeof $ != "boolean" && $.$ref && !(0, i3.schemaHasRulesButRef)($, this.RULES)) {
          let H = (0, Q1.resolveUrl)(this.opts.uriResolver, Q, $.$ref);
          J = T8.call(this, Y, H);
        }
        let { schemaId: G } = this.opts;
        if (J = J || new rX({ schema: $, schemaId: G, root: Y, baseId: Q }), J.schema !== J.root.schema) return J;
        return;
      }
    });
    t3 = P((BT, eA) => {
      eA.exports = { $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", type: "object", required: ["$data"], properties: { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, additionalProperties: false };
    });
    s3 = P((zT, a3) => {
      var Xw = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, a: 10, A: 10, b: 11, B: 11, c: 12, C: 12, d: 13, D: 13, e: 14, E: 14, f: 15, F: 15 };
      a3.exports = { HEX: Xw };
    });
    GH = P((KT, JH) => {
      var { HEX: Qw } = s3(), $w = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
      function $H(X) {
        if (WH(X, ".") < 3) return { host: X, isIPV4: false };
        let Q = X.match($w) || [], [$] = Q;
        if ($) return { host: Ww($, "."), isIPV4: true };
        else return { host: X, isIPV4: false };
      }
      function PY(X, Q = false) {
        let $ = "", Y = true;
        for (let W of X) {
          if (Qw[W] === void 0) return;
          if (W !== "0" && Y === true) Y = false;
          if (!Y) $ += W;
        }
        if (Q && $.length === 0) $ = "0";
        return $;
      }
      function Yw(X) {
        let Q = 0, $ = { error: false, address: "", zone: "" }, Y = [], W = [], J = false, G = false, H = false;
        function B() {
          if (W.length) {
            if (J === false) {
              let z = PY(W);
              if (z !== void 0) Y.push(z);
              else return $.error = true, false;
            }
            W.length = 0;
          }
          return true;
        }
        for (let z = 0; z < X.length; z++) {
          let K = X[z];
          if (K === "[" || K === "]") continue;
          if (K === ":") {
            if (G === true) H = true;
            if (!B()) break;
            if (Q++, Y.push(":"), Q > 7) {
              $.error = true;
              break;
            }
            if (z - 1 >= 0 && X[z - 1] === ":") G = true;
            continue;
          } else if (K === "%") {
            if (!B()) break;
            J = true;
          } else {
            W.push(K);
            continue;
          }
        }
        if (W.length) if (J) $.zone = W.join("");
        else if (H) Y.push(W.join(""));
        else Y.push(PY(W));
        return $.address = Y.join(""), $;
      }
      function YH(X) {
        if (WH(X, ":") < 2) return { host: X, isIPV6: false };
        let Q = Yw(X);
        if (!Q.error) {
          let { address: $, address: Y } = Q;
          if (Q.zone) $ += "%" + Q.zone, Y += "%25" + Q.zone;
          return { host: $, escapedHost: Y, isIPV6: true };
        } else return { host: X, isIPV6: false };
      }
      function Ww(X, Q) {
        let $ = "", Y = true, W = X.length;
        for (let J = 0; J < W; J++) {
          let G = X[J];
          if (G === "0" && Y) {
            if (J + 1 <= W && X[J + 1] === Q || J + 1 === W) $ += G, Y = false;
          } else {
            if (G === Q) Y = true;
            else Y = false;
            $ += G;
          }
        }
        return $;
      }
      function WH(X, Q) {
        let $ = 0;
        for (let Y = 0; Y < X.length; Y++) if (X[Y] === Q) $++;
        return $;
      }
      var e3 = /^\.\.?\//u, XH = /^\/\.(?:\/|$)/u, QH = /^\/\.\.(?:\/|$)/u, Jw = /^\/?(?:.|\n)*?(?=\/|$)/u;
      function Gw(X) {
        let Q = [];
        while (X.length) if (X.match(e3)) X = X.replace(e3, "");
        else if (X.match(XH)) X = X.replace(XH, "/");
        else if (X.match(QH)) X = X.replace(QH, "/"), Q.pop();
        else if (X === "." || X === "..") X = "";
        else {
          let $ = X.match(Jw);
          if ($) {
            let Y = $[0];
            X = X.slice(Y.length), Q.push(Y);
          } else throw Error("Unexpected dot segment condition");
        }
        return Q.join("");
      }
      function Hw(X, Q) {
        let $ = Q !== true ? escape : unescape;
        if (X.scheme !== void 0) X.scheme = $(X.scheme);
        if (X.userinfo !== void 0) X.userinfo = $(X.userinfo);
        if (X.host !== void 0) X.host = $(X.host);
        if (X.path !== void 0) X.path = $(X.path);
        if (X.query !== void 0) X.query = $(X.query);
        if (X.fragment !== void 0) X.fragment = $(X.fragment);
        return X;
      }
      function Bw(X) {
        let Q = [];
        if (X.userinfo !== void 0) Q.push(X.userinfo), Q.push("@");
        if (X.host !== void 0) {
          let $ = unescape(X.host), Y = $H($);
          if (Y.isIPV4) $ = Y.host;
          else {
            let W = YH(Y.host);
            if (W.isIPV6 === true) $ = `[${W.escapedHost}]`;
            else $ = X.host;
          }
          Q.push($);
        }
        if (typeof X.port === "number" || typeof X.port === "string") Q.push(":"), Q.push(String(X.port));
        return Q.length ? Q.join("") : void 0;
      }
      JH.exports = { recomposeAuthority: Bw, normalizeComponentEncoding: Hw, removeDotSegments: Gw, normalizeIPv4: $H, normalizeIPv6: YH, stringArrayToHexStripped: PY };
    });
    VH = P((UT, UH) => {
      var zw = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu, Kw = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
      function HH(X) {
        return typeof X.secure === "boolean" ? X.secure : String(X.scheme).toLowerCase() === "wss";
      }
      function BH(X) {
        if (!X.host) X.error = X.error || "HTTP URIs must have a host.";
        return X;
      }
      function zH(X) {
        let Q = String(X.scheme).toLowerCase() === "https";
        if (X.port === (Q ? 443 : 80) || X.port === "") X.port = void 0;
        if (!X.path) X.path = "/";
        return X;
      }
      function Uw(X) {
        return X.secure = HH(X), X.resourceName = (X.path || "/") + (X.query ? "?" + X.query : ""), X.path = void 0, X.query = void 0, X;
      }
      function Vw(X) {
        if (X.port === (HH(X) ? 443 : 80) || X.port === "") X.port = void 0;
        if (typeof X.secure === "boolean") X.scheme = X.secure ? "wss" : "ws", X.secure = void 0;
        if (X.resourceName) {
          let [Q, $] = X.resourceName.split("?");
          X.path = Q && Q !== "/" ? Q : void 0, X.query = $, X.resourceName = void 0;
        }
        return X.fragment = void 0, X;
      }
      function Lw(X, Q) {
        if (!X.path) return X.error = "URN can not be parsed", X;
        let $ = X.path.match(Kw);
        if ($) {
          let Y = Q.scheme || X.scheme || "urn";
          X.nid = $[1].toLowerCase(), X.nss = $[2];
          let W = `${Y}:${Q.nid || X.nid}`, J = SY[W];
          if (X.path = void 0, J) X = J.parse(X, Q);
        } else X.error = X.error || "URN can not be parsed.";
        return X;
      }
      function qw(X, Q) {
        let $ = Q.scheme || X.scheme || "urn", Y = X.nid.toLowerCase(), W = `${$}:${Q.nid || Y}`, J = SY[W];
        if (J) X = J.serialize(X, Q);
        let G = X, H = X.nss;
        return G.path = `${Y || Q.nid}:${H}`, Q.skipEscape = true, G;
      }
      function Fw(X, Q) {
        let $ = X;
        if ($.uuid = $.nss, $.nss = void 0, !Q.tolerant && (!$.uuid || !zw.test($.uuid))) $.error = $.error || "UUID is not valid.";
        return $;
      }
      function Nw(X) {
        let Q = X;
        return Q.nss = (X.uuid || "").toLowerCase(), Q;
      }
      var KH = { scheme: "http", domainHost: true, parse: BH, serialize: zH }, Ow = { scheme: "https", domainHost: KH.domainHost, parse: BH, serialize: zH }, x8 = { scheme: "ws", domainHost: true, parse: Uw, serialize: Vw }, Dw = { scheme: "wss", domainHost: x8.domainHost, parse: x8.parse, serialize: x8.serialize }, Aw = { scheme: "urn", parse: Lw, serialize: qw, skipNormalize: true }, ww = { scheme: "urn:uuid", parse: Fw, serialize: Nw, skipNormalize: true }, SY = { http: KH, https: Ow, ws: x8, wss: Dw, urn: Aw, "urn:uuid": ww };
      UH.exports = SY;
    });
    qH = P((VT, g8) => {
      var { normalizeIPv6: Mw, normalizeIPv4: jw, removeDotSegments: oX, recomposeAuthority: Rw, normalizeComponentEncoding: y8 } = GH(), ZY = VH();
      function Iw(X, Q) {
        if (typeof X === "string") X = U1(E1(X, Q), Q);
        else if (typeof X === "object") X = E1(U1(X, Q), Q);
        return X;
      }
      function Ew(X, Q, $) {
        let Y = Object.assign({ scheme: "null" }, $), W = LH(E1(X, Y), E1(Q, Y), Y, true);
        return U1(W, { ...Y, skipEscape: true });
      }
      function LH(X, Q, $, Y) {
        let W = {};
        if (!Y) X = E1(U1(X, $), $), Q = E1(U1(Q, $), $);
        if ($ = $ || {}, !$.tolerant && Q.scheme) W.scheme = Q.scheme, W.userinfo = Q.userinfo, W.host = Q.host, W.port = Q.port, W.path = oX(Q.path || ""), W.query = Q.query;
        else {
          if (Q.userinfo !== void 0 || Q.host !== void 0 || Q.port !== void 0) W.userinfo = Q.userinfo, W.host = Q.host, W.port = Q.port, W.path = oX(Q.path || ""), W.query = Q.query;
          else {
            if (!Q.path) if (W.path = X.path, Q.query !== void 0) W.query = Q.query;
            else W.query = X.query;
            else {
              if (Q.path.charAt(0) === "/") W.path = oX(Q.path);
              else {
                if ((X.userinfo !== void 0 || X.host !== void 0 || X.port !== void 0) && !X.path) W.path = "/" + Q.path;
                else if (!X.path) W.path = Q.path;
                else W.path = X.path.slice(0, X.path.lastIndexOf("/") + 1) + Q.path;
                W.path = oX(W.path);
              }
              W.query = Q.query;
            }
            W.userinfo = X.userinfo, W.host = X.host, W.port = X.port;
          }
          W.scheme = X.scheme;
        }
        return W.fragment = Q.fragment, W;
      }
      function bw(X, Q, $) {
        if (typeof X === "string") X = unescape(X), X = U1(y8(E1(X, $), true), { ...$, skipEscape: true });
        else if (typeof X === "object") X = U1(y8(X, true), { ...$, skipEscape: true });
        if (typeof Q === "string") Q = unescape(Q), Q = U1(y8(E1(Q, $), true), { ...$, skipEscape: true });
        else if (typeof Q === "object") Q = U1(y8(Q, true), { ...$, skipEscape: true });
        return X.toLowerCase() === Q.toLowerCase();
      }
      function U1(X, Q) {
        let $ = { host: X.host, scheme: X.scheme, userinfo: X.userinfo, port: X.port, path: X.path, query: X.query, nid: X.nid, nss: X.nss, uuid: X.uuid, fragment: X.fragment, reference: X.reference, resourceName: X.resourceName, secure: X.secure, error: "" }, Y = Object.assign({}, Q), W = [], J = ZY[(Y.scheme || $.scheme || "").toLowerCase()];
        if (J && J.serialize) J.serialize($, Y);
        if ($.path !== void 0) if (!Y.skipEscape) {
          if ($.path = escape($.path), $.scheme !== void 0) $.path = $.path.split("%3A").join(":");
        } else $.path = unescape($.path);
        if (Y.reference !== "suffix" && $.scheme) W.push($.scheme, ":");
        let G = Rw($);
        if (G !== void 0) {
          if (Y.reference !== "suffix") W.push("//");
          if (W.push(G), $.path && $.path.charAt(0) !== "/") W.push("/");
        }
        if ($.path !== void 0) {
          let H = $.path;
          if (!Y.absolutePath && (!J || !J.absolutePath)) H = oX(H);
          if (G === void 0) H = H.replace(/^\/\//u, "/%2F");
          W.push(H);
        }
        if ($.query !== void 0) W.push("?", $.query);
        if ($.fragment !== void 0) W.push("#", $.fragment);
        return W.join("");
      }
      var Pw = Array.from({ length: 127 }, (X, Q) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(Q)));
      function Sw(X) {
        let Q = 0;
        for (let $ = 0, Y = X.length; $ < Y; ++$) if (Q = X.charCodeAt($), Q > 126 || Pw[Q]) return true;
        return false;
      }
      var Zw = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
      function E1(X, Q) {
        let $ = Object.assign({}, Q), Y = { scheme: void 0, userinfo: void 0, host: "", port: void 0, path: "", query: void 0, fragment: void 0 }, W = X.indexOf("%") !== -1, J = false;
        if ($.reference === "suffix") X = ($.scheme ? $.scheme + ":" : "") + "//" + X;
        let G = X.match(Zw);
        if (G) {
          if (Y.scheme = G[1], Y.userinfo = G[3], Y.host = G[4], Y.port = parseInt(G[5], 10), Y.path = G[6] || "", Y.query = G[7], Y.fragment = G[8], isNaN(Y.port)) Y.port = G[5];
          if (Y.host) {
            let B = jw(Y.host);
            if (B.isIPV4 === false) {
              let z = Mw(B.host);
              Y.host = z.host.toLowerCase(), J = z.isIPV6;
            } else Y.host = B.host, J = true;
          }
          if (Y.scheme === void 0 && Y.userinfo === void 0 && Y.host === void 0 && Y.port === void 0 && Y.query === void 0 && !Y.path) Y.reference = "same-document";
          else if (Y.scheme === void 0) Y.reference = "relative";
          else if (Y.fragment === void 0) Y.reference = "absolute";
          else Y.reference = "uri";
          if ($.reference && $.reference !== "suffix" && $.reference !== Y.reference) Y.error = Y.error || "URI is not a " + $.reference + " reference.";
          let H = ZY[($.scheme || Y.scheme || "").toLowerCase()];
          if (!$.unicodeSupport && (!H || !H.unicodeSupport)) {
            if (Y.host && ($.domainHost || H && H.domainHost) && J === false && Sw(Y.host)) try {
              Y.host = URL.domainToASCII(Y.host.toLowerCase());
            } catch (B) {
              Y.error = Y.error || "Host's domain name can not be converted to ASCII: " + B;
            }
          }
          if (!H || H && !H.skipNormalize) {
            if (W && Y.scheme !== void 0) Y.scheme = unescape(Y.scheme);
            if (W && Y.host !== void 0) Y.host = unescape(Y.host);
            if (Y.path) Y.path = escape(unescape(Y.path));
            if (Y.fragment) Y.fragment = encodeURI(decodeURIComponent(Y.fragment));
          }
          if (H && H.parse) H.parse(Y, $);
        } else Y.error = Y.error || "URI can not be parsed.";
        return Y;
      }
      var CY = { SCHEMES: ZY, normalize: Iw, resolve: Ew, resolveComponents: LH, equal: bw, serialize: U1, parse: E1 };
      g8.exports = CY;
      g8.exports.default = CY;
      g8.exports.fastUri = CY;
    });
    OH = P((NH) => {
      Object.defineProperty(NH, "__esModule", { value: true });
      var FH = qH();
      FH.code = 'require("ajv/dist/runtime/uri").default';
      NH.default = FH;
    });
    EH = P((b1) => {
      Object.defineProperty(b1, "__esModule", { value: true });
      b1.CodeGen = b1.Name = b1.nil = b1.stringify = b1.str = b1._ = b1.KeywordCxt = void 0;
      var kw = iX();
      Object.defineProperty(b1, "KeywordCxt", { enumerable: true, get: function() {
        return kw.KeywordCxt;
      } });
      var c6 = c();
      Object.defineProperty(b1, "_", { enumerable: true, get: function() {
        return c6._;
      } });
      Object.defineProperty(b1, "str", { enumerable: true, get: function() {
        return c6.str;
      } });
      Object.defineProperty(b1, "stringify", { enumerable: true, get: function() {
        return c6.stringify;
      } });
      Object.defineProperty(b1, "nil", { enumerable: true, get: function() {
        return c6.nil;
      } });
      Object.defineProperty(b1, "Name", { enumerable: true, get: function() {
        return c6.Name;
      } });
      Object.defineProperty(b1, "CodeGen", { enumerable: true, get: function() {
        return c6.CodeGen;
      } });
      var vw = v8(), jH = nX(), Tw = KY(), tX = _8(), _w = c(), aX = cX(), f8 = mX(), vY = e(), DH = t3(), xw = OH(), RH = (X, Q) => new RegExp(X, Q);
      RH.code = "new RegExp";
      var yw = ["removeAdditional", "useDefaults", "coerceTypes"], gw = /* @__PURE__ */ new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]), fw = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }, hw = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }, AH = 200;
      function uw(X) {
        var Q, $, Y, W, J, G, H, B, z, K, V, L, U, F, q, N, A, M, R, S, C, K0, U0, s, D0;
        let q0 = X.strict, L1 = (Q = X.code) === null || Q === void 0 ? void 0 : Q.optimize, P1 = L1 === true || L1 === void 0 ? 1 : L1 || 0, o1 = (Y = ($ = X.code) === null || $ === void 0 ? void 0 : $.regExp) !== null && Y !== void 0 ? Y : RH, p = (W = X.uriResolver) !== null && W !== void 0 ? W : xw.default;
        return { strictSchema: (G = (J = X.strictSchema) !== null && J !== void 0 ? J : q0) !== null && G !== void 0 ? G : true, strictNumbers: (B = (H = X.strictNumbers) !== null && H !== void 0 ? H : q0) !== null && B !== void 0 ? B : true, strictTypes: (K = (z = X.strictTypes) !== null && z !== void 0 ? z : q0) !== null && K !== void 0 ? K : "log", strictTuples: (L = (V = X.strictTuples) !== null && V !== void 0 ? V : q0) !== null && L !== void 0 ? L : "log", strictRequired: (F = (U = X.strictRequired) !== null && U !== void 0 ? U : q0) !== null && F !== void 0 ? F : false, code: X.code ? { ...X.code, optimize: P1, regExp: o1 } : { optimize: P1, regExp: o1 }, loopRequired: (q = X.loopRequired) !== null && q !== void 0 ? q : AH, loopEnum: (N = X.loopEnum) !== null && N !== void 0 ? N : AH, meta: (A = X.meta) !== null && A !== void 0 ? A : true, messages: (M = X.messages) !== null && M !== void 0 ? M : true, inlineRefs: (R = X.inlineRefs) !== null && R !== void 0 ? R : true, schemaId: (S = X.schemaId) !== null && S !== void 0 ? S : "$id", addUsedSchema: (C = X.addUsedSchema) !== null && C !== void 0 ? C : true, validateSchema: (K0 = X.validateSchema) !== null && K0 !== void 0 ? K0 : true, validateFormats: (U0 = X.validateFormats) !== null && U0 !== void 0 ? U0 : true, unicodeRegExp: (s = X.unicodeRegExp) !== null && s !== void 0 ? s : true, int32range: (D0 = X.int32range) !== null && D0 !== void 0 ? D0 : true, uriResolver: p };
      }
      class h8 {
        constructor(X = {}) {
          this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), X = this.opts = { ...X, ...uw(X) };
          let { es5: Q, lines: $ } = this.opts.code;
          this.scope = new _w.ValueScope({ scope: {}, prefixes: gw, es5: Q, lines: $ }), this.logger = iw(X.logger);
          let Y = X.validateFormats;
          if (X.validateFormats = false, this.RULES = (0, Tw.getRules)(), wH.call(this, fw, X, "NOT SUPPORTED"), wH.call(this, hw, X, "DEPRECATED", "warn"), this._metaOpts = pw.call(this), X.formats) mw.call(this);
          if (this._addVocabularies(), this._addDefaultMetaSchema(), X.keywords) cw.call(this, X.keywords);
          if (typeof X.meta == "object") this.addMetaSchema(X.meta);
          lw.call(this), X.validateFormats = Y;
        }
        _addVocabularies() {
          this.addKeyword("$async");
        }
        _addDefaultMetaSchema() {
          let { $data: X, meta: Q, schemaId: $ } = this.opts, Y = DH;
          if ($ === "id") Y = { ...DH }, Y.id = Y.$id, delete Y.$id;
          if (Q && X) this.addMetaSchema(Y, Y[$], false);
        }
        defaultMeta() {
          let { meta: X, schemaId: Q } = this.opts;
          return this.opts.defaultMeta = typeof X == "object" ? X[Q] || X : void 0;
        }
        validate(X, Q) {
          let $;
          if (typeof X == "string") {
            if ($ = this.getSchema(X), !$) throw Error(`no schema with key or ref "${X}"`);
          } else $ = this.compile(X);
          let Y = $(Q);
          if (!("$async" in $)) this.errors = $.errors;
          return Y;
        }
        compile(X, Q) {
          let $ = this._addSchema(X, Q);
          return $.validate || this._compileSchemaEnv($);
        }
        compileAsync(X, Q) {
          if (typeof this.opts.loadSchema != "function") throw Error("options.loadSchema should be a function");
          let { loadSchema: $ } = this.opts;
          return Y.call(this, X, Q);
          async function Y(z, K) {
            await W.call(this, z.$schema);
            let V = this._addSchema(z, K);
            return V.validate || J.call(this, V);
          }
          async function W(z) {
            if (z && !this.getSchema(z)) await Y.call(this, { $ref: z }, true);
          }
          async function J(z) {
            try {
              return this._compileSchemaEnv(z);
            } catch (K) {
              if (!(K instanceof jH.default)) throw K;
              return G.call(this, K), await H.call(this, K.missingSchema), J.call(this, z);
            }
          }
          function G({ missingSchema: z, missingRef: K }) {
            if (this.refs[z]) throw Error(`AnySchema ${z} is loaded but ${K} cannot be resolved`);
          }
          async function H(z) {
            let K = await B.call(this, z);
            if (!this.refs[z]) await W.call(this, K.$schema);
            if (!this.refs[z]) this.addSchema(K, z, Q);
          }
          async function B(z) {
            let K = this._loading[z];
            if (K) return K;
            try {
              return await (this._loading[z] = $(z));
            } finally {
              delete this._loading[z];
            }
          }
        }
        addSchema(X, Q, $, Y = this.opts.validateSchema) {
          if (Array.isArray(X)) {
            for (let J of X) this.addSchema(J, void 0, $, Y);
            return this;
          }
          let W;
          if (typeof X === "object") {
            let { schemaId: J } = this.opts;
            if (W = X[J], W !== void 0 && typeof W != "string") throw Error(`schema ${J} must be string`);
          }
          return Q = (0, aX.normalizeId)(Q || W), this._checkUnique(Q), this.schemas[Q] = this._addSchema(X, $, Q, Y, true), this;
        }
        addMetaSchema(X, Q, $ = this.opts.validateSchema) {
          return this.addSchema(X, Q, true, $), this;
        }
        validateSchema(X, Q) {
          if (typeof X == "boolean") return true;
          let $;
          if ($ = X.$schema, $ !== void 0 && typeof $ != "string") throw Error("$schema must be a string");
          if ($ = $ || this.opts.defaultMeta || this.defaultMeta(), !$) return this.logger.warn("meta-schema not available"), this.errors = null, true;
          let Y = this.validate($, X);
          if (!Y && Q) {
            let W = "schema is invalid: " + this.errorsText();
            if (this.opts.validateSchema === "log") this.logger.error(W);
            else throw Error(W);
          }
          return Y;
        }
        getSchema(X) {
          let Q;
          while (typeof (Q = MH.call(this, X)) == "string") X = Q;
          if (Q === void 0) {
            let { schemaId: $ } = this.opts, Y = new tX.SchemaEnv({ schema: {}, schemaId: $ });
            if (Q = tX.resolveSchema.call(this, Y, X), !Q) return;
            this.refs[X] = Q;
          }
          return Q.validate || this._compileSchemaEnv(Q);
        }
        removeSchema(X) {
          if (X instanceof RegExp) return this._removeAllSchemas(this.schemas, X), this._removeAllSchemas(this.refs, X), this;
          switch (typeof X) {
            case "undefined":
              return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
            case "string": {
              let Q = MH.call(this, X);
              if (typeof Q == "object") this._cache.delete(Q.schema);
              return delete this.schemas[X], delete this.refs[X], this;
            }
            case "object": {
              let Q = X;
              this._cache.delete(Q);
              let $ = X[this.opts.schemaId];
              if ($) $ = (0, aX.normalizeId)($), delete this.schemas[$], delete this.refs[$];
              return this;
            }
            default:
              throw Error("ajv.removeSchema: invalid parameter");
          }
        }
        addVocabulary(X) {
          for (let Q of X) this.addKeyword(Q);
          return this;
        }
        addKeyword(X, Q) {
          let $;
          if (typeof X == "string") {
            if ($ = X, typeof Q == "object") this.logger.warn("these parameters are deprecated, see docs for addKeyword"), Q.keyword = $;
          } else if (typeof X == "object" && Q === void 0) {
            if (Q = X, $ = Q.keyword, Array.isArray($) && !$.length) throw Error("addKeywords: keyword must be string or non-empty array");
          } else throw Error("invalid addKeywords parameters");
          if (rw.call(this, $, Q), !Q) return (0, vY.eachItem)($, (W) => kY.call(this, W)), this;
          tw.call(this, Q);
          let Y = { ...Q, type: (0, f8.getJSONTypes)(Q.type), schemaType: (0, f8.getJSONTypes)(Q.schemaType) };
          return (0, vY.eachItem)($, Y.type.length === 0 ? (W) => kY.call(this, W, Y) : (W) => Y.type.forEach((J) => kY.call(this, W, Y, J))), this;
        }
        getKeyword(X) {
          let Q = this.RULES.all[X];
          return typeof Q == "object" ? Q.definition : !!Q;
        }
        removeKeyword(X) {
          let { RULES: Q } = this;
          delete Q.keywords[X], delete Q.all[X];
          for (let $ of Q.rules) {
            let Y = $.rules.findIndex((W) => W.keyword === X);
            if (Y >= 0) $.rules.splice(Y, 1);
          }
          return this;
        }
        addFormat(X, Q) {
          if (typeof Q == "string") Q = new RegExp(Q);
          return this.formats[X] = Q, this;
        }
        errorsText(X = this.errors, { separator: Q = ", ", dataVar: $ = "data" } = {}) {
          if (!X || X.length === 0) return "No errors";
          return X.map((Y) => `${$}${Y.instancePath} ${Y.message}`).reduce((Y, W) => Y + Q + W);
        }
        $dataMetaSchema(X, Q) {
          let $ = this.RULES.all;
          X = JSON.parse(JSON.stringify(X));
          for (let Y of Q) {
            let W = Y.split("/").slice(1), J = X;
            for (let G of W) J = J[G];
            for (let G in $) {
              let H = $[G];
              if (typeof H != "object") continue;
              let { $data: B } = H.definition, z = J[G];
              if (B && z) J[G] = IH(z);
            }
          }
          return X;
        }
        _removeAllSchemas(X, Q) {
          for (let $ in X) {
            let Y = X[$];
            if (!Q || Q.test($)) {
              if (typeof Y == "string") delete X[$];
              else if (Y && !Y.meta) this._cache.delete(Y.schema), delete X[$];
            }
          }
        }
        _addSchema(X, Q, $, Y = this.opts.validateSchema, W = this.opts.addUsedSchema) {
          let J, { schemaId: G } = this.opts;
          if (typeof X == "object") J = X[G];
          else if (this.opts.jtd) throw Error("schema must be object");
          else if (typeof X != "boolean") throw Error("schema must be object or boolean");
          let H = this._cache.get(X);
          if (H !== void 0) return H;
          $ = (0, aX.normalizeId)(J || $);
          let B = aX.getSchemaRefs.call(this, X, $);
          if (H = new tX.SchemaEnv({ schema: X, schemaId: G, meta: Q, baseId: $, localRefs: B }), this._cache.set(H.schema, H), W && !$.startsWith("#")) {
            if ($) this._checkUnique($);
            this.refs[$] = H;
          }
          if (Y) this.validateSchema(X, true);
          return H;
        }
        _checkUnique(X) {
          if (this.schemas[X] || this.refs[X]) throw Error(`schema with key or id "${X}" already exists`);
        }
        _compileSchemaEnv(X) {
          if (X.meta) this._compileMetaSchema(X);
          else tX.compileSchema.call(this, X);
          if (!X.validate) throw Error("ajv implementation error");
          return X.validate;
        }
        _compileMetaSchema(X) {
          let Q = this.opts;
          this.opts = this._metaOpts;
          try {
            tX.compileSchema.call(this, X);
          } finally {
            this.opts = Q;
          }
        }
      }
      h8.ValidationError = vw.default;
      h8.MissingRefError = jH.default;
      b1.default = h8;
      function wH(X, Q, $, Y = "error") {
        for (let W in X) {
          let J = W;
          if (J in Q) this.logger[Y](`${$}: option ${W}. ${X[J]}`);
        }
      }
      function MH(X) {
        return X = (0, aX.normalizeId)(X), this.schemas[X] || this.refs[X];
      }
      function lw() {
        let X = this.opts.schemas;
        if (!X) return;
        if (Array.isArray(X)) this.addSchema(X);
        else for (let Q in X) this.addSchema(X[Q], Q);
      }
      function mw() {
        for (let X in this.opts.formats) {
          let Q = this.opts.formats[X];
          if (Q) this.addFormat(X, Q);
        }
      }
      function cw(X) {
        if (Array.isArray(X)) {
          this.addVocabulary(X);
          return;
        }
        this.logger.warn("keywords option as map is deprecated, pass array");
        for (let Q in X) {
          let $ = X[Q];
          if (!$.keyword) $.keyword = Q;
          this.addKeyword($);
        }
      }
      function pw() {
        let X = { ...this.opts };
        for (let Q of yw) delete X[Q];
        return X;
      }
      var dw = { log() {
      }, warn() {
      }, error() {
      } };
      function iw(X) {
        if (X === false) return dw;
        if (X === void 0) return console;
        if (X.log && X.warn && X.error) return X;
        throw Error("logger must implement log, warn and error methods");
      }
      var nw = /^[a-z_$][a-z0-9_$:-]*$/i;
      function rw(X, Q) {
        let { RULES: $ } = this;
        if ((0, vY.eachItem)(X, (Y) => {
          if ($.keywords[Y]) throw Error(`Keyword ${Y} is already defined`);
          if (!nw.test(Y)) throw Error(`Keyword ${Y} has invalid name`);
        }), !Q) return;
        if (Q.$data && !("code" in Q || "validate" in Q)) throw Error('$data keyword must have "code" or "validate" function');
      }
      function kY(X, Q, $) {
        var Y;
        let W = Q === null || Q === void 0 ? void 0 : Q.post;
        if ($ && W) throw Error('keyword with "post" flag cannot have "type"');
        let { RULES: J } = this, G = W ? J.post : J.rules.find(({ type: B }) => B === $);
        if (!G) G = { type: $, rules: [] }, J.rules.push(G);
        if (J.keywords[X] = true, !Q) return;
        let H = { keyword: X, definition: { ...Q, type: (0, f8.getJSONTypes)(Q.type), schemaType: (0, f8.getJSONTypes)(Q.schemaType) } };
        if (Q.before) ow.call(this, G, H, Q.before);
        else G.rules.push(H);
        J.all[X] = H, (Y = Q.implements) === null || Y === void 0 || Y.forEach((B) => this.addKeyword(B));
      }
      function ow(X, Q, $) {
        let Y = X.rules.findIndex((W) => W.keyword === $);
        if (Y >= 0) X.rules.splice(Y, 0, Q);
        else X.rules.push(Q), this.logger.warn(`rule ${$} is not defined`);
      }
      function tw(X) {
        let { metaSchema: Q } = X;
        if (Q === void 0) return;
        if (X.$data && this.opts.$data) Q = IH(Q);
        X.validateSchema = this.compile(Q, true);
      }
      var aw = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" };
      function IH(X) {
        return { anyOf: [X, aw] };
      }
    });
    PH = P((bH) => {
      Object.defineProperty(bH, "__esModule", { value: true });
      var XM = { keyword: "id", code() {
        throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
      } };
      bH.default = XM;
    });
    TH = P((kH) => {
      Object.defineProperty(kH, "__esModule", { value: true });
      kH.callRef = kH.getValidate = void 0;
      var $M = nX(), SH = d0(), g0 = c(), p6 = R1(), ZH = _8(), u8 = e(), YM = { keyword: "$ref", schemaType: "string", code(X) {
        let { gen: Q, schema: $, it: Y } = X, { baseId: W, schemaEnv: J, validateName: G, opts: H, self: B } = Y, { root: z } = J;
        if (($ === "#" || $ === "#/") && W === z.baseId) return V();
        let K = ZH.resolveRef.call(B, z, W, $);
        if (K === void 0) throw new $M.default(Y.opts.uriResolver, W, $);
        if (K instanceof ZH.SchemaEnv) return L(K);
        return U(K);
        function V() {
          if (J === z) return l8(X, G, J, J.$async);
          let F = Q.scopeValue("root", { ref: z });
          return l8(X, g0._`${F}.validate`, z, z.$async);
        }
        function L(F) {
          let q = CH(X, F);
          l8(X, q, F, F.$async);
        }
        function U(F) {
          let q = Q.scopeValue("schema", H.code.source === true ? { ref: F, code: (0, g0.stringify)(F) } : { ref: F }), N = Q.name("valid"), A = X.subschema({ schema: F, dataTypes: [], schemaPath: g0.nil, topSchemaRef: q, errSchemaPath: $ }, N);
          X.mergeEvaluated(A), X.ok(N);
        }
      } };
      function CH(X, Q) {
        let { gen: $ } = X;
        return Q.validate ? $.scopeValue("validate", { ref: Q.validate }) : g0._`${$.scopeValue("wrapper", { ref: Q })}.validate`;
      }
      kH.getValidate = CH;
      function l8(X, Q, $, Y) {
        let { gen: W, it: J } = X, { allErrors: G, schemaEnv: H, opts: B } = J, z = B.passContext ? p6.default.this : g0.nil;
        if (Y) K();
        else V();
        function K() {
          if (!H.$async) throw Error("async schema referenced by sync schema");
          let F = W.let("valid");
          W.try(() => {
            if (W.code(g0._`await ${(0, SH.callValidateCode)(X, Q, z)}`), U(Q), !G) W.assign(F, true);
          }, (q) => {
            if (W.if(g0._`!(${q} instanceof ${J.ValidationError})`, () => W.throw(q)), L(q), !G) W.assign(F, false);
          }), X.ok(F);
        }
        function V() {
          X.result((0, SH.callValidateCode)(X, Q, z), () => U(Q), () => L(Q));
        }
        function L(F) {
          let q = g0._`${F}.errors`;
          W.assign(p6.default.vErrors, g0._`${p6.default.vErrors} === null ? ${q} : ${p6.default.vErrors}.concat(${q})`), W.assign(p6.default.errors, g0._`${p6.default.vErrors}.length`);
        }
        function U(F) {
          var q;
          if (!J.opts.unevaluated) return;
          let N = (q = $ === null || $ === void 0 ? void 0 : $.validate) === null || q === void 0 ? void 0 : q.evaluated;
          if (J.props !== true) if (N && !N.dynamicProps) {
            if (N.props !== void 0) J.props = u8.mergeEvaluated.props(W, N.props, J.props);
          } else {
            let A = W.var("props", g0._`${F}.evaluated.props`);
            J.props = u8.mergeEvaluated.props(W, A, J.props, g0.Name);
          }
          if (J.items !== true) if (N && !N.dynamicItems) {
            if (N.items !== void 0) J.items = u8.mergeEvaluated.items(W, N.items, J.items);
          } else {
            let A = W.var("items", g0._`${F}.evaluated.items`);
            J.items = u8.mergeEvaluated.items(W, A, J.items, g0.Name);
          }
        }
      }
      kH.callRef = l8;
      kH.default = YM;
    });
    xH = P((_H) => {
      Object.defineProperty(_H, "__esModule", { value: true });
      var GM = PH(), HM = TH(), BM = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", GM.default, HM.default];
      _H.default = BM;
    });
    gH = P((yH) => {
      Object.defineProperty(yH, "__esModule", { value: true });
      var m8 = c(), i1 = m8.operators, c8 = { maximum: { okStr: "<=", ok: i1.LTE, fail: i1.GT }, minimum: { okStr: ">=", ok: i1.GTE, fail: i1.LT }, exclusiveMaximum: { okStr: "<", ok: i1.LT, fail: i1.GTE }, exclusiveMinimum: { okStr: ">", ok: i1.GT, fail: i1.LTE } }, KM = { message: ({ keyword: X, schemaCode: Q }) => m8.str`must be ${c8[X].okStr} ${Q}`, params: ({ keyword: X, schemaCode: Q }) => m8._`{comparison: ${c8[X].okStr}, limit: ${Q}}` }, UM = { keyword: Object.keys(c8), type: "number", schemaType: "number", $data: true, error: KM, code(X) {
        let { keyword: Q, data: $, schemaCode: Y } = X;
        X.fail$data(m8._`${$} ${c8[Q].fail} ${Y} || isNaN(${$})`);
      } };
      yH.default = UM;
    });
    hH = P((fH) => {
      Object.defineProperty(fH, "__esModule", { value: true });
      var sX = c(), LM = { message: ({ schemaCode: X }) => sX.str`must be multiple of ${X}`, params: ({ schemaCode: X }) => sX._`{multipleOf: ${X}}` }, qM = { keyword: "multipleOf", type: "number", schemaType: "number", $data: true, error: LM, code(X) {
        let { gen: Q, data: $, schemaCode: Y, it: W } = X, J = W.opts.multipleOfPrecision, G = Q.let("res"), H = J ? sX._`Math.abs(Math.round(${G}) - ${G}) > 1e-${J}` : sX._`${G} !== parseInt(${G})`;
        X.fail$data(sX._`(${Y} === 0 || (${G} = ${$}/${Y}, ${H}))`);
      } };
      fH.default = qM;
    });
    mH = P((lH) => {
      Object.defineProperty(lH, "__esModule", { value: true });
      function uH(X) {
        let Q = X.length, $ = 0, Y = 0, W;
        while (Y < Q) if ($++, W = X.charCodeAt(Y++), W >= 55296 && W <= 56319 && Y < Q) {
          if (W = X.charCodeAt(Y), (W & 64512) === 56320) Y++;
        }
        return $;
      }
      lH.default = uH;
      uH.code = 'require("ajv/dist/runtime/ucs2length").default';
    });
    pH = P((cH) => {
      Object.defineProperty(cH, "__esModule", { value: true });
      var K6 = c(), OM = e(), DM = mH(), AM = { message({ keyword: X, schemaCode: Q }) {
        let $ = X === "maxLength" ? "more" : "fewer";
        return K6.str`must NOT have ${$} than ${Q} characters`;
      }, params: ({ schemaCode: X }) => K6._`{limit: ${X}}` }, wM = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: true, error: AM, code(X) {
        let { keyword: Q, data: $, schemaCode: Y, it: W } = X, J = Q === "maxLength" ? K6.operators.GT : K6.operators.LT, G = W.opts.unicode === false ? K6._`${$}.length` : K6._`${(0, OM.useFunc)(X.gen, DM.default)}(${$})`;
        X.fail$data(K6._`${G} ${J} ${Y}`);
      } };
      cH.default = wM;
    });
    iH = P((dH) => {
      Object.defineProperty(dH, "__esModule", { value: true });
      var jM = d0(), p8 = c(), RM = { message: ({ schemaCode: X }) => p8.str`must match pattern "${X}"`, params: ({ schemaCode: X }) => p8._`{pattern: ${X}}` }, IM = { keyword: "pattern", type: "string", schemaType: "string", $data: true, error: RM, code(X) {
        let { data: Q, $data: $, schema: Y, schemaCode: W, it: J } = X, G = J.opts.unicodeRegExp ? "u" : "", H = $ ? p8._`(new RegExp(${W}, ${G}))` : (0, jM.usePattern)(X, Y);
        X.fail$data(p8._`!${H}.test(${Q})`);
      } };
      dH.default = IM;
    });
    rH = P((nH) => {
      Object.defineProperty(nH, "__esModule", { value: true });
      var eX = c(), bM = { message({ keyword: X, schemaCode: Q }) {
        let $ = X === "maxProperties" ? "more" : "fewer";
        return eX.str`must NOT have ${$} than ${Q} properties`;
      }, params: ({ schemaCode: X }) => eX._`{limit: ${X}}` }, PM = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: true, error: bM, code(X) {
        let { keyword: Q, data: $, schemaCode: Y } = X, W = Q === "maxProperties" ? eX.operators.GT : eX.operators.LT;
        X.fail$data(eX._`Object.keys(${$}).length ${W} ${Y}`);
      } };
      nH.default = PM;
    });
    tH = P((oH) => {
      Object.defineProperty(oH, "__esModule", { value: true });
      var X4 = d0(), Q4 = c(), ZM = e(), CM = { message: ({ params: { missingProperty: X } }) => Q4.str`must have required property '${X}'`, params: ({ params: { missingProperty: X } }) => Q4._`{missingProperty: ${X}}` }, kM = { keyword: "required", type: "object", schemaType: "array", $data: true, error: CM, code(X) {
        let { gen: Q, schema: $, schemaCode: Y, data: W, $data: J, it: G } = X, { opts: H } = G;
        if (!J && $.length === 0) return;
        let B = $.length >= H.loopRequired;
        if (G.allErrors) z();
        else K();
        if (H.strictRequired) {
          let U = X.parentSchema.properties, { definedProperties: F } = X.it;
          for (let q of $) if ((U === null || U === void 0 ? void 0 : U[q]) === void 0 && !F.has(q)) {
            let N = G.schemaEnv.baseId + G.errSchemaPath, A = `required property "${q}" is not defined at "${N}" (strictRequired)`;
            (0, ZM.checkStrictMode)(G, A, G.opts.strictRequired);
          }
        }
        function z() {
          if (B || J) X.block$data(Q4.nil, V);
          else for (let U of $) (0, X4.checkReportMissingProp)(X, U);
        }
        function K() {
          let U = Q.let("missing");
          if (B || J) {
            let F = Q.let("valid", true);
            X.block$data(F, () => L(U, F)), X.ok(F);
          } else Q.if((0, X4.checkMissingProp)(X, $, U)), (0, X4.reportMissingProp)(X, U), Q.else();
        }
        function V() {
          Q.forOf("prop", Y, (U) => {
            X.setParams({ missingProperty: U }), Q.if((0, X4.noPropertyInData)(Q, W, U, H.ownProperties), () => X.error());
          });
        }
        function L(U, F) {
          X.setParams({ missingProperty: U }), Q.forOf(U, Y, () => {
            Q.assign(F, (0, X4.propertyInData)(Q, W, U, H.ownProperties)), Q.if((0, Q4.not)(F), () => {
              X.error(), Q.break();
            });
          }, Q4.nil);
        }
      } };
      oH.default = kM;
    });
    sH = P((aH) => {
      Object.defineProperty(aH, "__esModule", { value: true });
      var $4 = c(), TM = { message({ keyword: X, schemaCode: Q }) {
        let $ = X === "maxItems" ? "more" : "fewer";
        return $4.str`must NOT have ${$} than ${Q} items`;
      }, params: ({ schemaCode: X }) => $4._`{limit: ${X}}` }, _M = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: true, error: TM, code(X) {
        let { keyword: Q, data: $, schemaCode: Y } = X, W = Q === "maxItems" ? $4.operators.GT : $4.operators.LT;
        X.fail$data($4._`${$}.length ${W} ${Y}`);
      } };
      aH.default = _M;
    });
    d8 = P((XB) => {
      Object.defineProperty(XB, "__esModule", { value: true });
      var eH = DY();
      eH.code = 'require("ajv/dist/runtime/equal").default';
      XB.default = eH;
    });
    $B = P((QB) => {
      Object.defineProperty(QB, "__esModule", { value: true });
      var TY = mX(), I0 = c(), gM = e(), fM = d8(), hM = { message: ({ params: { i: X, j: Q } }) => I0.str`must NOT have duplicate items (items ## ${Q} and ${X} are identical)`, params: ({ params: { i: X, j: Q } }) => I0._`{i: ${X}, j: ${Q}}` }, uM = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, error: hM, code(X) {
        let { gen: Q, data: $, $data: Y, schema: W, parentSchema: J, schemaCode: G, it: H } = X;
        if (!Y && !W) return;
        let B = Q.let("valid"), z = J.items ? (0, TY.getSchemaTypes)(J.items) : [];
        X.block$data(B, K, I0._`${G} === false`), X.ok(B);
        function K() {
          let F = Q.let("i", I0._`${$}.length`), q = Q.let("j");
          X.setParams({ i: F, j: q }), Q.assign(B, true), Q.if(I0._`${F} > 1`, () => (V() ? L : U)(F, q));
        }
        function V() {
          return z.length > 0 && !z.some((F) => F === "object" || F === "array");
        }
        function L(F, q) {
          let N = Q.name("item"), A = (0, TY.checkDataTypes)(z, N, H.opts.strictNumbers, TY.DataType.Wrong), M = Q.const("indices", I0._`{}`);
          Q.for(I0._`;${F}--;`, () => {
            if (Q.let(N, I0._`${$}[${F}]`), Q.if(A, I0._`continue`), z.length > 1) Q.if(I0._`typeof ${N} == "string"`, I0._`${N} += "_"`);
            Q.if(I0._`typeof ${M}[${N}] == "number"`, () => {
              Q.assign(q, I0._`${M}[${N}]`), X.error(), Q.assign(B, false).break();
            }).code(I0._`${M}[${N}] = ${F}`);
          });
        }
        function U(F, q) {
          let N = (0, gM.useFunc)(Q, fM.default), A = Q.name("outer");
          Q.label(A).for(I0._`;${F}--;`, () => Q.for(I0._`${q} = ${F}; ${q}--;`, () => Q.if(I0._`${N}(${$}[${F}], ${$}[${q}])`, () => {
            X.error(), Q.assign(B, false).break(A);
          })));
        }
      } };
      QB.default = uM;
    });
    WB = P((YB) => {
      Object.defineProperty(YB, "__esModule", { value: true });
      var _Y = c(), mM = e(), cM = d8(), pM = { message: "must be equal to constant", params: ({ schemaCode: X }) => _Y._`{allowedValue: ${X}}` }, dM = { keyword: "const", $data: true, error: pM, code(X) {
        let { gen: Q, data: $, $data: Y, schemaCode: W, schema: J } = X;
        if (Y || J && typeof J == "object") X.fail$data(_Y._`!${(0, mM.useFunc)(Q, cM.default)}(${$}, ${W})`);
        else X.fail(_Y._`${J} !== ${$}`);
      } };
      YB.default = dM;
    });
    GB = P((JB) => {
      Object.defineProperty(JB, "__esModule", { value: true });
      var Y4 = c(), nM = e(), rM = d8(), oM = { message: "must be equal to one of the allowed values", params: ({ schemaCode: X }) => Y4._`{allowedValues: ${X}}` }, tM = { keyword: "enum", schemaType: "array", $data: true, error: oM, code(X) {
        let { gen: Q, data: $, $data: Y, schema: W, schemaCode: J, it: G } = X;
        if (!Y && W.length === 0) throw Error("enum must have non-empty array");
        let H = W.length >= G.opts.loopEnum, B, z = () => B !== null && B !== void 0 ? B : B = (0, nM.useFunc)(Q, rM.default), K;
        if (H || Y) K = Q.let("valid"), X.block$data(K, V);
        else {
          if (!Array.isArray(W)) throw Error("ajv implementation error");
          let U = Q.const("vSchema", J);
          K = (0, Y4.or)(...W.map((F, q) => L(U, q)));
        }
        X.pass(K);
        function V() {
          Q.assign(K, false), Q.forOf("v", J, (U) => Q.if(Y4._`${z()}(${$}, ${U})`, () => Q.assign(K, true).break()));
        }
        function L(U, F) {
          let q = W[F];
          return typeof q === "object" && q !== null ? Y4._`${z()}(${$}, ${U}[${F}])` : Y4._`${$} === ${q}`;
        }
      } };
      JB.default = tM;
    });
    BB = P((HB) => {
      Object.defineProperty(HB, "__esModule", { value: true });
      var sM = gH(), eM = hH(), Xj = pH(), Qj = iH(), $j = rH(), Yj = tH(), Wj = sH(), Jj = $B(), Gj = WB(), Hj = GB(), Bj = [sM.default, eM.default, Xj.default, Qj.default, $j.default, Yj.default, Wj.default, Jj.default, { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, Gj.default, Hj.default];
      HB.default = Bj;
    });
    yY = P((KB) => {
      Object.defineProperty(KB, "__esModule", { value: true });
      KB.validateAdditionalItems = void 0;
      var U6 = c(), xY = e(), Kj = { message: ({ params: { len: X } }) => U6.str`must NOT have more than ${X} items`, params: ({ params: { len: X } }) => U6._`{limit: ${X}}` }, Uj = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error: Kj, code(X) {
        let { parentSchema: Q, it: $ } = X, { items: Y } = Q;
        if (!Array.isArray(Y)) {
          (0, xY.checkStrictMode)($, '"additionalItems" is ignored when "items" is not an array of schemas');
          return;
        }
        zB(X, Y);
      } };
      function zB(X, Q) {
        let { gen: $, schema: Y, data: W, keyword: J, it: G } = X;
        G.items = true;
        let H = $.const("len", U6._`${W}.length`);
        if (Y === false) X.setParams({ len: Q.length }), X.pass(U6._`${H} <= ${Q.length}`);
        else if (typeof Y == "object" && !(0, xY.alwaysValidSchema)(G, Y)) {
          let z = $.var("valid", U6._`${H} <= ${Q.length}`);
          $.if((0, U6.not)(z), () => B(z)), X.ok(z);
        }
        function B(z) {
          $.forRange("i", Q.length, H, (K) => {
            if (X.subschema({ keyword: J, dataProp: K, dataPropType: xY.Type.Num }, z), !G.allErrors) $.if((0, U6.not)(z), () => $.break());
          });
        }
      }
      KB.validateAdditionalItems = zB;
      KB.default = Uj;
    });
    gY = P((qB) => {
      Object.defineProperty(qB, "__esModule", { value: true });
      qB.validateTuple = void 0;
      var VB = c(), i8 = e(), Lj = d0(), qj = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code(X) {
        let { schema: Q, it: $ } = X;
        if (Array.isArray(Q)) return LB(X, "additionalItems", Q);
        if ($.items = true, (0, i8.alwaysValidSchema)($, Q)) return;
        X.ok((0, Lj.validateArray)(X));
      } };
      function LB(X, Q, $ = X.schema) {
        let { gen: Y, parentSchema: W, data: J, keyword: G, it: H } = X;
        if (K(W), H.opts.unevaluated && $.length && H.items !== true) H.items = i8.mergeEvaluated.items(Y, $.length, H.items);
        let B = Y.name("valid"), z = Y.const("len", VB._`${J}.length`);
        $.forEach((V, L) => {
          if ((0, i8.alwaysValidSchema)(H, V)) return;
          Y.if(VB._`${z} > ${L}`, () => X.subschema({ keyword: G, schemaProp: L, dataProp: L }, B)), X.ok(B);
        });
        function K(V) {
          let { opts: L, errSchemaPath: U } = H, F = $.length, q = F === V.minItems && (F === V.maxItems || V[Q] === false);
          if (L.strictTuples && !q) {
            let N = `"${G}" is ${F}-tuple, but minItems or maxItems/${Q} are not specified or different at path "${U}"`;
            (0, i8.checkStrictMode)(H, N, L.strictTuples);
          }
        }
      }
      qB.validateTuple = LB;
      qB.default = qj;
    });
    OB = P((NB) => {
      Object.defineProperty(NB, "__esModule", { value: true });
      var Nj = gY(), Oj = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: (X) => (0, Nj.validateTuple)(X, "items") };
      NB.default = Oj;
    });
    wB = P((AB) => {
      Object.defineProperty(AB, "__esModule", { value: true });
      var DB = c(), Aj = e(), wj = d0(), Mj = yY(), jj = { message: ({ params: { len: X } }) => DB.str`must NOT have more than ${X} items`, params: ({ params: { len: X } }) => DB._`{limit: ${X}}` }, Rj = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error: jj, code(X) {
        let { schema: Q, parentSchema: $, it: Y } = X, { prefixItems: W } = $;
        if (Y.items = true, (0, Aj.alwaysValidSchema)(Y, Q)) return;
        if (W) (0, Mj.validateAdditionalItems)(X, W);
        else X.ok((0, wj.validateArray)(X));
      } };
      AB.default = Rj;
    });
    jB = P((MB) => {
      Object.defineProperty(MB, "__esModule", { value: true });
      var i0 = c(), n8 = e(), Ej = { message: ({ params: { min: X, max: Q } }) => Q === void 0 ? i0.str`must contain at least ${X} valid item(s)` : i0.str`must contain at least ${X} and no more than ${Q} valid item(s)`, params: ({ params: { min: X, max: Q } }) => Q === void 0 ? i0._`{minContains: ${X}}` : i0._`{minContains: ${X}, maxContains: ${Q}}` }, bj = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, error: Ej, code(X) {
        let { gen: Q, schema: $, parentSchema: Y, data: W, it: J } = X, G, H, { minContains: B, maxContains: z } = Y;
        if (J.opts.next) G = B === void 0 ? 1 : B, H = z;
        else G = 1;
        let K = Q.const("len", i0._`${W}.length`);
        if (X.setParams({ min: G, max: H }), H === void 0 && G === 0) {
          (0, n8.checkStrictMode)(J, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
          return;
        }
        if (H !== void 0 && G > H) {
          (0, n8.checkStrictMode)(J, '"minContains" > "maxContains" is always invalid'), X.fail();
          return;
        }
        if ((0, n8.alwaysValidSchema)(J, $)) {
          let q = i0._`${K} >= ${G}`;
          if (H !== void 0) q = i0._`${q} && ${K} <= ${H}`;
          X.pass(q);
          return;
        }
        J.items = true;
        let V = Q.name("valid");
        if (H === void 0 && G === 1) U(V, () => Q.if(V, () => Q.break()));
        else if (G === 0) {
          if (Q.let(V, true), H !== void 0) Q.if(i0._`${W}.length > 0`, L);
        } else Q.let(V, false), L();
        X.result(V, () => X.reset());
        function L() {
          let q = Q.name("_valid"), N = Q.let("count", 0);
          U(q, () => Q.if(q, () => F(N)));
        }
        function U(q, N) {
          Q.forRange("i", 0, K, (A) => {
            X.subschema({ keyword: "contains", dataProp: A, dataPropType: n8.Type.Num, compositeRule: true }, q), N();
          });
        }
        function F(q) {
          if (Q.code(i0._`${q}++`), H === void 0) Q.if(i0._`${q} >= ${G}`, () => Q.assign(V, true).break());
          else if (Q.if(i0._`${q} > ${H}`, () => Q.assign(V, false).break()), G === 1) Q.assign(V, true);
          else Q.if(i0._`${q} >= ${G}`, () => Q.assign(V, true));
        }
      } };
      MB.default = bj;
    });
    SB = P((EB) => {
      Object.defineProperty(EB, "__esModule", { value: true });
      EB.validateSchemaDeps = EB.validatePropertyDeps = EB.error = void 0;
      var fY = c(), Sj = e(), W4 = d0();
      EB.error = { message: ({ params: { property: X, depsCount: Q, deps: $ } }) => {
        let Y = Q === 1 ? "property" : "properties";
        return fY.str`must have ${Y} ${$} when property ${X} is present`;
      }, params: ({ params: { property: X, depsCount: Q, deps: $, missingProperty: Y } }) => fY._`{property: ${X},
    missingProperty: ${Y},
    depsCount: ${Q},
    deps: ${$}}` };
      var Zj = { keyword: "dependencies", type: "object", schemaType: "object", error: EB.error, code(X) {
        let [Q, $] = Cj(X);
        RB(X, Q), IB(X, $);
      } };
      function Cj({ schema: X }) {
        let Q = {}, $ = {};
        for (let Y in X) {
          if (Y === "__proto__") continue;
          let W = Array.isArray(X[Y]) ? Q : $;
          W[Y] = X[Y];
        }
        return [Q, $];
      }
      function RB(X, Q = X.schema) {
        let { gen: $, data: Y, it: W } = X;
        if (Object.keys(Q).length === 0) return;
        let J = $.let("missing");
        for (let G in Q) {
          let H = Q[G];
          if (H.length === 0) continue;
          let B = (0, W4.propertyInData)($, Y, G, W.opts.ownProperties);
          if (X.setParams({ property: G, depsCount: H.length, deps: H.join(", ") }), W.allErrors) $.if(B, () => {
            for (let z of H) (0, W4.checkReportMissingProp)(X, z);
          });
          else $.if(fY._`${B} && (${(0, W4.checkMissingProp)(X, H, J)})`), (0, W4.reportMissingProp)(X, J), $.else();
        }
      }
      EB.validatePropertyDeps = RB;
      function IB(X, Q = X.schema) {
        let { gen: $, data: Y, keyword: W, it: J } = X, G = $.name("valid");
        for (let H in Q) {
          if ((0, Sj.alwaysValidSchema)(J, Q[H])) continue;
          $.if((0, W4.propertyInData)($, Y, H, J.opts.ownProperties), () => {
            let B = X.subschema({ keyword: W, schemaProp: H }, G);
            X.mergeValidEvaluated(B, G);
          }, () => $.var(G, true)), X.ok(G);
        }
      }
      EB.validateSchemaDeps = IB;
      EB.default = Zj;
    });
    kB = P((CB) => {
      Object.defineProperty(CB, "__esModule", { value: true });
      var ZB = c(), Tj = e(), _j = { message: "property name must be valid", params: ({ params: X }) => ZB._`{propertyName: ${X.propertyName}}` }, xj = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error: _j, code(X) {
        let { gen: Q, schema: $, data: Y, it: W } = X;
        if ((0, Tj.alwaysValidSchema)(W, $)) return;
        let J = Q.name("valid");
        Q.forIn("key", Y, (G) => {
          X.setParams({ propertyName: G }), X.subschema({ keyword: "propertyNames", data: G, dataTypes: ["string"], propertyName: G, compositeRule: true }, J), Q.if((0, ZB.not)(J), () => {
            if (X.error(true), !W.allErrors) Q.break();
          });
        }), X.ok(J);
      } };
      CB.default = xj;
    });
    hY = P((vB) => {
      Object.defineProperty(vB, "__esModule", { value: true });
      var r8 = d0(), $1 = c(), gj = R1(), o8 = e(), fj = { message: "must NOT have additional properties", params: ({ params: X }) => $1._`{additionalProperty: ${X.additionalProperty}}` }, hj = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, error: fj, code(X) {
        let { gen: Q, schema: $, parentSchema: Y, data: W, errsCount: J, it: G } = X;
        if (!J) throw Error("ajv implementation error");
        let { allErrors: H, opts: B } = G;
        if (G.props = true, B.removeAdditional !== "all" && (0, o8.alwaysValidSchema)(G, $)) return;
        let z = (0, r8.allSchemaProperties)(Y.properties), K = (0, r8.allSchemaProperties)(Y.patternProperties);
        V(), X.ok($1._`${J} === ${gj.default.errors}`);
        function V() {
          Q.forIn("key", W, (N) => {
            if (!z.length && !K.length) F(N);
            else Q.if(L(N), () => F(N));
          });
        }
        function L(N) {
          let A;
          if (z.length > 8) {
            let M = (0, o8.schemaRefOrVal)(G, Y.properties, "properties");
            A = (0, r8.isOwnProperty)(Q, M, N);
          } else if (z.length) A = (0, $1.or)(...z.map((M) => $1._`${N} === ${M}`));
          else A = $1.nil;
          if (K.length) A = (0, $1.or)(A, ...K.map((M) => $1._`${(0, r8.usePattern)(X, M)}.test(${N})`));
          return (0, $1.not)(A);
        }
        function U(N) {
          Q.code($1._`delete ${W}[${N}]`);
        }
        function F(N) {
          if (B.removeAdditional === "all" || B.removeAdditional && $ === false) {
            U(N);
            return;
          }
          if ($ === false) {
            if (X.setParams({ additionalProperty: N }), X.error(), !H) Q.break();
            return;
          }
          if (typeof $ == "object" && !(0, o8.alwaysValidSchema)(G, $)) {
            let A = Q.name("valid");
            if (B.removeAdditional === "failing") q(N, A, false), Q.if((0, $1.not)(A), () => {
              X.reset(), U(N);
            });
            else if (q(N, A), !H) Q.if((0, $1.not)(A), () => Q.break());
          }
        }
        function q(N, A, M) {
          let R = { keyword: "additionalProperties", dataProp: N, dataPropType: o8.Type.Str };
          if (M === false) Object.assign(R, { compositeRule: true, createErrors: false, allErrors: false });
          X.subschema(R, A);
        }
      } };
      vB.default = hj;
    });
    yB = P((xB) => {
      Object.defineProperty(xB, "__esModule", { value: true });
      var lj = iX(), TB = d0(), uY = e(), _B = hY(), mj = { keyword: "properties", type: "object", schemaType: "object", code(X) {
        let { gen: Q, schema: $, parentSchema: Y, data: W, it: J } = X;
        if (J.opts.removeAdditional === "all" && Y.additionalProperties === void 0) _B.default.code(new lj.KeywordCxt(J, _B.default, "additionalProperties"));
        let G = (0, TB.allSchemaProperties)($);
        for (let V of G) J.definedProperties.add(V);
        if (J.opts.unevaluated && G.length && J.props !== true) J.props = uY.mergeEvaluated.props(Q, (0, uY.toHash)(G), J.props);
        let H = G.filter((V) => !(0, uY.alwaysValidSchema)(J, $[V]));
        if (H.length === 0) return;
        let B = Q.name("valid");
        for (let V of H) {
          if (z(V)) K(V);
          else {
            if (Q.if((0, TB.propertyInData)(Q, W, V, J.opts.ownProperties)), K(V), !J.allErrors) Q.else().var(B, true);
            Q.endIf();
          }
          X.it.definedProperties.add(V), X.ok(B);
        }
        function z(V) {
          return J.opts.useDefaults && !J.compositeRule && $[V].default !== void 0;
        }
        function K(V) {
          X.subschema({ keyword: "properties", schemaProp: V, dataProp: V }, B);
        }
      } };
      xB.default = mj;
    });
    lB = P((uB) => {
      Object.defineProperty(uB, "__esModule", { value: true });
      var gB = d0(), t8 = c(), fB = e(), hB = e(), pj = { keyword: "patternProperties", type: "object", schemaType: "object", code(X) {
        let { gen: Q, schema: $, data: Y, parentSchema: W, it: J } = X, { opts: G } = J, H = (0, gB.allSchemaProperties)($), B = H.filter((q) => (0, fB.alwaysValidSchema)(J, $[q]));
        if (H.length === 0 || B.length === H.length && (!J.opts.unevaluated || J.props === true)) return;
        let z = G.strictSchema && !G.allowMatchingProperties && W.properties, K = Q.name("valid");
        if (J.props !== true && !(J.props instanceof t8.Name)) J.props = (0, hB.evaluatedPropsToName)(Q, J.props);
        let { props: V } = J;
        L();
        function L() {
          for (let q of H) {
            if (z) U(q);
            if (J.allErrors) F(q);
            else Q.var(K, true), F(q), Q.if(K);
          }
        }
        function U(q) {
          for (let N in z) if (new RegExp(q).test(N)) (0, fB.checkStrictMode)(J, `property ${N} matches pattern ${q} (use allowMatchingProperties)`);
        }
        function F(q) {
          Q.forIn("key", Y, (N) => {
            Q.if(t8._`${(0, gB.usePattern)(X, q)}.test(${N})`, () => {
              let A = B.includes(q);
              if (!A) X.subschema({ keyword: "patternProperties", schemaProp: q, dataProp: N, dataPropType: hB.Type.Str }, K);
              if (J.opts.unevaluated && V !== true) Q.assign(t8._`${V}[${N}]`, true);
              else if (!A && !J.allErrors) Q.if((0, t8.not)(K), () => Q.break());
            });
          });
        }
      } };
      uB.default = pj;
    });
    cB = P((mB) => {
      Object.defineProperty(mB, "__esModule", { value: true });
      var ij = e(), nj = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code(X) {
        let { gen: Q, schema: $, it: Y } = X;
        if ((0, ij.alwaysValidSchema)(Y, $)) {
          X.fail();
          return;
        }
        let W = Q.name("valid");
        X.subschema({ keyword: "not", compositeRule: true, createErrors: false, allErrors: false }, W), X.failResult(W, () => X.reset(), () => X.error());
      }, error: { message: "must NOT be valid" } };
      mB.default = nj;
    });
    dB = P((pB) => {
      Object.defineProperty(pB, "__esModule", { value: true });
      var oj = d0(), tj = { keyword: "anyOf", schemaType: "array", trackErrors: true, code: oj.validateUnion, error: { message: "must match a schema in anyOf" } };
      pB.default = tj;
    });
    nB = P((iB) => {
      Object.defineProperty(iB, "__esModule", { value: true });
      var a8 = c(), sj = e(), ej = { message: "must match exactly one schema in oneOf", params: ({ params: X }) => a8._`{passingSchemas: ${X.passing}}` }, XR = { keyword: "oneOf", schemaType: "array", trackErrors: true, error: ej, code(X) {
        let { gen: Q, schema: $, parentSchema: Y, it: W } = X;
        if (!Array.isArray($)) throw Error("ajv implementation error");
        if (W.opts.discriminator && Y.discriminator) return;
        let J = $, G = Q.let("valid", false), H = Q.let("passing", null), B = Q.name("_valid");
        X.setParams({ passing: H }), Q.block(z), X.result(G, () => X.reset(), () => X.error(true));
        function z() {
          J.forEach((K, V) => {
            let L;
            if ((0, sj.alwaysValidSchema)(W, K)) Q.var(B, true);
            else L = X.subschema({ keyword: "oneOf", schemaProp: V, compositeRule: true }, B);
            if (V > 0) Q.if(a8._`${B} && ${G}`).assign(G, false).assign(H, a8._`[${H}, ${V}]`).else();
            Q.if(B, () => {
              if (Q.assign(G, true), Q.assign(H, V), L) X.mergeEvaluated(L, a8.Name);
            });
          });
        }
      } };
      iB.default = XR;
    });
    oB = P((rB) => {
      Object.defineProperty(rB, "__esModule", { value: true });
      var $R = e(), YR = { keyword: "allOf", schemaType: "array", code(X) {
        let { gen: Q, schema: $, it: Y } = X;
        if (!Array.isArray($)) throw Error("ajv implementation error");
        let W = Q.name("valid");
        $.forEach((J, G) => {
          if ((0, $R.alwaysValidSchema)(Y, J)) return;
          let H = X.subschema({ keyword: "allOf", schemaProp: G }, W);
          X.ok(W), X.mergeEvaluated(H);
        });
      } };
      rB.default = YR;
    });
    eB = P((sB) => {
      Object.defineProperty(sB, "__esModule", { value: true });
      var s8 = c(), aB = e(), JR = { message: ({ params: X }) => s8.str`must match "${X.ifClause}" schema`, params: ({ params: X }) => s8._`{failingKeyword: ${X.ifClause}}` }, GR = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, error: JR, code(X) {
        let { gen: Q, parentSchema: $, it: Y } = X;
        if ($.then === void 0 && $.else === void 0) (0, aB.checkStrictMode)(Y, '"if" without "then" and "else" is ignored');
        let W = tB(Y, "then"), J = tB(Y, "else");
        if (!W && !J) return;
        let G = Q.let("valid", true), H = Q.name("_valid");
        if (B(), X.reset(), W && J) {
          let K = Q.let("ifClause");
          X.setParams({ ifClause: K }), Q.if(H, z("then", K), z("else", K));
        } else if (W) Q.if(H, z("then"));
        else Q.if((0, s8.not)(H), z("else"));
        X.pass(G, () => X.error(true));
        function B() {
          let K = X.subschema({ keyword: "if", compositeRule: true, createErrors: false, allErrors: false }, H);
          X.mergeEvaluated(K);
        }
        function z(K, V) {
          return () => {
            let L = X.subschema({ keyword: K }, H);
            if (Q.assign(G, H), X.mergeValidEvaluated(L, G), V) Q.assign(V, s8._`${K}`);
            else X.setParams({ ifClause: K });
          };
        }
      } };
      function tB(X, Q) {
        let $ = X.schema[Q];
        return $ !== void 0 && !(0, aB.alwaysValidSchema)(X, $);
      }
      sB.default = GR;
    });
    Qz = P((Xz) => {
      Object.defineProperty(Xz, "__esModule", { value: true });
      var BR = e(), zR = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code({ keyword: X, parentSchema: Q, it: $ }) {
        if (Q.if === void 0) (0, BR.checkStrictMode)($, `"${X}" without "if" is ignored`);
      } };
      Xz.default = zR;
    });
    Yz = P(($z) => {
      Object.defineProperty($z, "__esModule", { value: true });
      var UR = yY(), VR = OB(), LR = gY(), qR = wB(), FR = jB(), NR = SB(), OR = kB(), DR = hY(), AR = yB(), wR = lB(), MR = cB(), jR = dB(), RR = nB(), IR = oB(), ER = eB(), bR = Qz();
      function PR(X = false) {
        let Q = [MR.default, jR.default, RR.default, IR.default, ER.default, bR.default, OR.default, DR.default, NR.default, AR.default, wR.default];
        if (X) Q.push(VR.default, qR.default);
        else Q.push(UR.default, LR.default);
        return Q.push(FR.default), Q;
      }
      $z.default = PR;
    });
    Jz = P((Wz) => {
      Object.defineProperty(Wz, "__esModule", { value: true });
      var L0 = c(), ZR = { message: ({ schemaCode: X }) => L0.str`must match format "${X}"`, params: ({ schemaCode: X }) => L0._`{format: ${X}}` }, CR = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: true, error: ZR, code(X, Q) {
        let { gen: $, data: Y, $data: W, schema: J, schemaCode: G, it: H } = X, { opts: B, errSchemaPath: z, schemaEnv: K, self: V } = H;
        if (!B.validateFormats) return;
        if (W) L();
        else U();
        function L() {
          let F = $.scopeValue("formats", { ref: V.formats, code: B.code.formats }), q = $.const("fDef", L0._`${F}[${G}]`), N = $.let("fType"), A = $.let("format");
          $.if(L0._`typeof ${q} == "object" && !(${q} instanceof RegExp)`, () => $.assign(N, L0._`${q}.type || "string"`).assign(A, L0._`${q}.validate`), () => $.assign(N, L0._`"string"`).assign(A, q)), X.fail$data((0, L0.or)(M(), R()));
          function M() {
            if (B.strictSchema === false) return L0.nil;
            return L0._`${G} && !${A}`;
          }
          function R() {
            let S = K.$async ? L0._`(${q}.async ? await ${A}(${Y}) : ${A}(${Y}))` : L0._`${A}(${Y})`, C = L0._`(typeof ${A} == "function" ? ${S} : ${A}.test(${Y}))`;
            return L0._`${A} && ${A} !== true && ${N} === ${Q} && !${C}`;
          }
        }
        function U() {
          let F = V.formats[J];
          if (!F) {
            M();
            return;
          }
          if (F === true) return;
          let [q, N, A] = R(F);
          if (q === Q) X.pass(S());
          function M() {
            if (B.strictSchema === false) {
              V.logger.warn(C());
              return;
            }
            throw Error(C());
            function C() {
              return `unknown format "${J}" ignored in schema at path "${z}"`;
            }
          }
          function R(C) {
            let K0 = C instanceof RegExp ? (0, L0.regexpCode)(C) : B.code.formats ? L0._`${B.code.formats}${(0, L0.getProperty)(J)}` : void 0, U0 = $.scopeValue("formats", { key: J, ref: C, code: K0 });
            if (typeof C == "object" && !(C instanceof RegExp)) return [C.type || "string", C.validate, L0._`${U0}.validate`];
            return ["string", C, U0];
          }
          function S() {
            if (typeof F == "object" && !(F instanceof RegExp) && F.async) {
              if (!K.$async) throw Error("async format in sync schema");
              return L0._`await ${A}(${Y})`;
            }
            return typeof N == "function" ? L0._`${A}(${Y})` : L0._`${A}.test(${Y})`;
          }
        }
      } };
      Wz.default = CR;
    });
    Hz = P((Gz) => {
      Object.defineProperty(Gz, "__esModule", { value: true });
      var vR = Jz(), TR = [vR.default];
      Gz.default = TR;
    });
    Kz = P((Bz) => {
      Object.defineProperty(Bz, "__esModule", { value: true });
      Bz.contentVocabulary = Bz.metadataVocabulary = void 0;
      Bz.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"];
      Bz.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"];
    });
    Lz = P((Vz) => {
      Object.defineProperty(Vz, "__esModule", { value: true });
      var yR = xH(), gR = BB(), fR = Yz(), hR = Hz(), Uz = Kz(), uR = [yR.default, gR.default, (0, fR.default)(), hR.default, Uz.metadataVocabulary, Uz.contentVocabulary];
      Vz.default = uR;
    });
    Oz = P((Fz) => {
      Object.defineProperty(Fz, "__esModule", { value: true });
      Fz.DiscrError = void 0;
      var qz;
      (function(X) {
        X.Tag = "tag", X.Mapping = "mapping";
      })(qz || (Fz.DiscrError = qz = {}));
    });
    wz = P((Az) => {
      Object.defineProperty(Az, "__esModule", { value: true });
      var d6 = c(), lY = Oz(), Dz = _8(), mR = nX(), cR = e(), pR = { message: ({ params: { discrError: X, tagName: Q } }) => X === lY.DiscrError.Tag ? `tag "${Q}" must be string` : `value of tag "${Q}" must be in oneOf`, params: ({ params: { discrError: X, tag: Q, tagName: $ } }) => d6._`{error: ${X}, tag: ${$}, tagValue: ${Q}}` }, dR = { keyword: "discriminator", type: "object", schemaType: "object", error: pR, code(X) {
        let { gen: Q, data: $, schema: Y, parentSchema: W, it: J } = X, { oneOf: G } = W;
        if (!J.opts.discriminator) throw Error("discriminator: requires discriminator option");
        let H = Y.propertyName;
        if (typeof H != "string") throw Error("discriminator: requires propertyName");
        if (Y.mapping) throw Error("discriminator: mapping is not supported");
        if (!G) throw Error("discriminator: requires oneOf keyword");
        let B = Q.let("valid", false), z = Q.const("tag", d6._`${$}${(0, d6.getProperty)(H)}`);
        Q.if(d6._`typeof ${z} == "string"`, () => K(), () => X.error(false, { discrError: lY.DiscrError.Tag, tag: z, tagName: H })), X.ok(B);
        function K() {
          let U = L();
          Q.if(false);
          for (let F in U) Q.elseIf(d6._`${z} === ${F}`), Q.assign(B, V(U[F]));
          Q.else(), X.error(false, { discrError: lY.DiscrError.Mapping, tag: z, tagName: H }), Q.endIf();
        }
        function V(U) {
          let F = Q.name("valid"), q = X.subschema({ keyword: "oneOf", schemaProp: U }, F);
          return X.mergeEvaluated(q, d6.Name), F;
        }
        function L() {
          var U;
          let F = {}, q = A(W), N = true;
          for (let S = 0; S < G.length; S++) {
            let C = G[S];
            if ((C === null || C === void 0 ? void 0 : C.$ref) && !(0, cR.schemaHasRulesButRef)(C, J.self.RULES)) {
              let U0 = C.$ref;
              if (C = Dz.resolveRef.call(J.self, J.schemaEnv.root, J.baseId, U0), C instanceof Dz.SchemaEnv) C = C.schema;
              if (C === void 0) throw new mR.default(J.opts.uriResolver, J.baseId, U0);
            }
            let K0 = (U = C === null || C === void 0 ? void 0 : C.properties) === null || U === void 0 ? void 0 : U[H];
            if (typeof K0 != "object") throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${H}"`);
            N = N && (q || A(C)), M(K0, S);
          }
          if (!N) throw Error(`discriminator: "${H}" must be required`);
          return F;
          function A({ required: S }) {
            return Array.isArray(S) && S.includes(H);
          }
          function M(S, C) {
            if (S.const) R(S.const, C);
            else if (S.enum) for (let K0 of S.enum) R(K0, C);
            else throw Error(`discriminator: "properties/${H}" must have "const" or "enum"`);
          }
          function R(S, C) {
            if (typeof S != "string" || S in F) throw Error(`discriminator: "${H}" values must be unique strings`);
            F[S] = C;
          }
        }
      } };
      Az.default = dR;
    });
    Mz = P((G_, nR) => {
      nR.exports = { $schema: "http://json-schema.org/draft-07/schema#", $id: "http://json-schema.org/draft-07/schema#", title: "Core schema meta-schema", definitions: { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: true, default: [] } }, type: ["object", "boolean"], properties: { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: true, readOnly: { type: "boolean", default: false }, examples: { type: "array", items: true }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: true }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: false }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: true, enum: { type: "array", items: true, minItems: 1, uniqueItems: true }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: true }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, default: true };
    });
    cY = P((f0, mY) => {
      Object.defineProperty(f0, "__esModule", { value: true });
      f0.MissingRefError = f0.ValidationError = f0.CodeGen = f0.Name = f0.nil = f0.stringify = f0.str = f0._ = f0.KeywordCxt = f0.Ajv = void 0;
      var rR = EH(), oR = Lz(), tR = wz(), jz = Mz(), aR = ["/properties"], e8 = "http://json-schema.org/draft-07/schema";
      class J4 extends rR.default {
        _addVocabularies() {
          if (super._addVocabularies(), oR.default.forEach((X) => this.addVocabulary(X)), this.opts.discriminator) this.addKeyword(tR.default);
        }
        _addDefaultMetaSchema() {
          if (super._addDefaultMetaSchema(), !this.opts.meta) return;
          let X = this.opts.$data ? this.$dataMetaSchema(jz, aR) : jz;
          this.addMetaSchema(X, e8, false), this.refs["http://json-schema.org/schema"] = e8;
        }
        defaultMeta() {
          return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(e8) ? e8 : void 0);
        }
      }
      f0.Ajv = J4;
      mY.exports = f0 = J4;
      mY.exports.Ajv = J4;
      Object.defineProperty(f0, "__esModule", { value: true });
      f0.default = J4;
      var sR = iX();
      Object.defineProperty(f0, "KeywordCxt", { enumerable: true, get: function() {
        return sR.KeywordCxt;
      } });
      var i6 = c();
      Object.defineProperty(f0, "_", { enumerable: true, get: function() {
        return i6._;
      } });
      Object.defineProperty(f0, "str", { enumerable: true, get: function() {
        return i6.str;
      } });
      Object.defineProperty(f0, "stringify", { enumerable: true, get: function() {
        return i6.stringify;
      } });
      Object.defineProperty(f0, "nil", { enumerable: true, get: function() {
        return i6.nil;
      } });
      Object.defineProperty(f0, "Name", { enumerable: true, get: function() {
        return i6.Name;
      } });
      Object.defineProperty(f0, "CodeGen", { enumerable: true, get: function() {
        return i6.CodeGen;
      } });
      var eR = v8();
      Object.defineProperty(f0, "ValidationError", { enumerable: true, get: function() {
        return eR.default;
      } });
      var XI = nX();
      Object.defineProperty(f0, "MissingRefError", { enumerable: true, get: function() {
        return XI.default;
      } });
    });
    vz = P((Cz) => {
      Object.defineProperty(Cz, "__esModule", { value: true });
      Cz.formatNames = Cz.fastFormats = Cz.fullFormats = void 0;
      function V1(X, Q) {
        return { validate: X, compare: Q };
      }
      Cz.fullFormats = { date: V1(bz, nY), time: V1(dY(true), rY), "date-time": V1(Rz(true), Sz), "iso-time": V1(dY(), Pz), "iso-date-time": V1(Rz(), Zz), duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, uri: BI, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, regex: FI, uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, byte: zI, int32: { type: "number", validate: VI }, int64: { type: "number", validate: LI }, float: { type: "number", validate: Ez }, double: { type: "number", validate: Ez }, password: true, binary: true };
      Cz.fastFormats = { ...Cz.fullFormats, date: V1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, nY), time: V1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, rY), "date-time": V1(/^\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, Sz), "iso-time": V1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, Pz), "iso-date-time": V1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, Zz), uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i };
      Cz.formatNames = Object.keys(Cz.fullFormats);
      function YI(X) {
        return X % 4 === 0 && (X % 100 !== 0 || X % 400 === 0);
      }
      var WI = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, JI = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
      function bz(X) {
        let Q = WI.exec(X);
        if (!Q) return false;
        let $ = +Q[1], Y = +Q[2], W = +Q[3];
        return Y >= 1 && Y <= 12 && W >= 1 && W <= (Y === 2 && YI($) ? 29 : JI[Y]);
      }
      function nY(X, Q) {
        if (!(X && Q)) return;
        if (X > Q) return 1;
        if (X < Q) return -1;
        return 0;
      }
      var pY = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
      function dY(X) {
        return function($) {
          let Y = pY.exec($);
          if (!Y) return false;
          let W = +Y[1], J = +Y[2], G = +Y[3], H = Y[4], B = Y[5] === "-" ? -1 : 1, z = +(Y[6] || 0), K = +(Y[7] || 0);
          if (z > 23 || K > 59 || X && !H) return false;
          if (W <= 23 && J <= 59 && G < 60) return true;
          let V = J - K * B, L = W - z * B - (V < 0 ? 1 : 0);
          return (L === 23 || L === -1) && (V === 59 || V === -1) && G < 61;
        };
      }
      function rY(X, Q) {
        if (!(X && Q)) return;
        let $ = (/* @__PURE__ */ new Date("2020-01-01T" + X)).valueOf(), Y = (/* @__PURE__ */ new Date("2020-01-01T" + Q)).valueOf();
        if (!($ && Y)) return;
        return $ - Y;
      }
      function Pz(X, Q) {
        if (!(X && Q)) return;
        let $ = pY.exec(X), Y = pY.exec(Q);
        if (!($ && Y)) return;
        if (X = $[1] + $[2] + $[3], Q = Y[1] + Y[2] + Y[3], X > Q) return 1;
        if (X < Q) return -1;
        return 0;
      }
      var iY = /t|\s/i;
      function Rz(X) {
        let Q = dY(X);
        return function(Y) {
          let W = Y.split(iY);
          return W.length === 2 && bz(W[0]) && Q(W[1]);
        };
      }
      function Sz(X, Q) {
        if (!(X && Q)) return;
        let $ = new Date(X).valueOf(), Y = new Date(Q).valueOf();
        if (!($ && Y)) return;
        return $ - Y;
      }
      function Zz(X, Q) {
        if (!(X && Q)) return;
        let [$, Y] = X.split(iY), [W, J] = Q.split(iY), G = nY($, W);
        if (G === void 0) return;
        return G || rY(Y, J);
      }
      var GI = /\/|:/, HI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
      function BI(X) {
        return GI.test(X) && HI.test(X);
      }
      var Iz = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
      function zI(X) {
        return Iz.lastIndex = 0, Iz.test(X);
      }
      var KI = -2147483648, UI = 2147483647;
      function VI(X) {
        return Number.isInteger(X) && X <= UI && X >= KI;
      }
      function LI(X) {
        return Number.isInteger(X);
      }
      function Ez() {
        return true;
      }
      var qI = /[^\\]\\Z/;
      function FI(X) {
        if (qI.test(X)) return false;
        try {
          return new RegExp(X), true;
        } catch (Q) {
          return false;
        }
      }
    });
    _z = P((Tz) => {
      Object.defineProperty(Tz, "__esModule", { value: true });
      Tz.formatLimitDefinition = void 0;
      var OI = cY(), Y1 = c(), n1 = Y1.operators, X9 = { formatMaximum: { okStr: "<=", ok: n1.LTE, fail: n1.GT }, formatMinimum: { okStr: ">=", ok: n1.GTE, fail: n1.LT }, formatExclusiveMaximum: { okStr: "<", ok: n1.LT, fail: n1.GTE }, formatExclusiveMinimum: { okStr: ">", ok: n1.GT, fail: n1.LTE } }, DI = { message: ({ keyword: X, schemaCode: Q }) => Y1.str`should be ${X9[X].okStr} ${Q}`, params: ({ keyword: X, schemaCode: Q }) => Y1._`{comparison: ${X9[X].okStr}, limit: ${Q}}` };
      Tz.formatLimitDefinition = { keyword: Object.keys(X9), type: "string", schemaType: "string", $data: true, error: DI, code(X) {
        let { gen: Q, data: $, schemaCode: Y, keyword: W, it: J } = X, { opts: G, self: H } = J;
        if (!G.validateFormats) return;
        let B = new OI.KeywordCxt(J, H.RULES.all.format.definition, "format");
        if (B.$data) z();
        else K();
        function z() {
          let L = Q.scopeValue("formats", { ref: H.formats, code: G.code.formats }), U = Q.const("fmt", Y1._`${L}[${B.schemaCode}]`);
          X.fail$data((0, Y1.or)(Y1._`typeof ${U} != "object"`, Y1._`${U} instanceof RegExp`, Y1._`typeof ${U}.compare != "function"`, V(U)));
        }
        function K() {
          let L = B.schema, U = H.formats[L];
          if (!U || U === true) return;
          if (typeof U != "object" || U instanceof RegExp || typeof U.compare != "function") throw Error(`"${W}": format "${L}" does not define "compare" function`);
          let F = Q.scopeValue("formats", { key: L, ref: U, code: G.code.formats ? Y1._`${G.code.formats}${(0, Y1.getProperty)(L)}` : void 0 });
          X.fail$data(V(F));
        }
        function V(L) {
          return Y1._`${L}.compare(${$}, ${Y}) ${X9[W].fail} 0`;
        }
      }, dependencies: ["format"] };
      var AI = (X) => {
        return X.addKeyword(Tz.formatLimitDefinition), X;
      };
      Tz.default = AI;
    });
    fz = P((G4, gz) => {
      Object.defineProperty(G4, "__esModule", { value: true });
      var n6 = vz(), MI = _z(), aY = c(), xz = new aY.Name("fullFormats"), jI = new aY.Name("fastFormats"), sY = (X, Q = { keywords: true }) => {
        if (Array.isArray(Q)) return yz(X, Q, n6.fullFormats, xz), X;
        let [$, Y] = Q.mode === "fast" ? [n6.fastFormats, jI] : [n6.fullFormats, xz], W = Q.formats || n6.formatNames;
        if (yz(X, W, $, Y), Q.keywords) (0, MI.default)(X);
        return X;
      };
      sY.get = (X, Q = "full") => {
        let Y = (Q === "fast" ? n6.fastFormats : n6.fullFormats)[X];
        if (!Y) throw Error(`Unknown format "${X}"`);
        return Y;
      };
      function yz(X, Q, $, Y) {
        var W, J;
        (W = (J = X.opts.code).formats) !== null && W !== void 0 || (J.formats = aY._`require("ajv-formats/dist/formats").${Y}`);
        for (let G of Q) X.addFormat(G, $[G]);
      }
      gz.exports = G4 = sY;
      Object.defineProperty(G4, "__esModule", { value: true });
      G4.default = sY;
    });
    UK = 50;
    VK = typeof global == "object" && global && global.Object === Object && global;
    q7 = VK;
    LK = typeof self == "object" && self && self.Object === Object && self;
    qK = q7 || LK || Function("return this")();
    N6 = qK;
    FK = N6.Symbol;
    O6 = FK;
    F7 = Object.prototype;
    NK = F7.hasOwnProperty;
    OK = F7.toString;
    e6 = O6 ? O6.toStringTag : void 0;
    N7 = DK;
    AK = Object.prototype;
    wK = AK.toString;
    O7 = MK;
    jK = "[object Null]";
    RK = "[object Undefined]";
    D7 = O6 ? O6.toStringTag : void 0;
    A7 = IK;
    z4 = EK;
    bK = "[object AsyncFunction]";
    PK = "[object Function]";
    SK = "[object GeneratorFunction]";
    ZK = "[object Proxy]";
    w7 = CK;
    kK = N6["__core-js_shared__"];
    K4 = kK;
    M7 = function() {
      var X = /[^.]+$/.exec(K4 && K4.keys && K4.keys.IE_PROTO || "");
      return X ? "Symbol(src)_1." + X : "";
    }();
    j7 = vK;
    TK = Function.prototype;
    _K = TK.toString;
    R7 = xK;
    yK = /[\\^$.*+?()[\]{}|]/g;
    gK = /^\[object .+?Constructor\]$/;
    fK = Function.prototype;
    hK = Object.prototype;
    uK = fK.toString;
    lK = hK.hasOwnProperty;
    mK = RegExp("^" + uK.call(lK).replace(yK, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
    I7 = cK;
    E7 = pK;
    U4 = dK;
    iK = U4(Object, "create");
    q1 = iK;
    b7 = nK;
    P7 = rK;
    oK = "__lodash_hash_undefined__";
    tK = Object.prototype;
    aK = tK.hasOwnProperty;
    S7 = sK;
    eK = Object.prototype;
    XU = eK.hasOwnProperty;
    Z7 = QU;
    $U = "__lodash_hash_undefined__";
    C7 = YU;
    D6.prototype.clear = b7;
    D6.prototype.delete = P7;
    D6.prototype.get = S7;
    D6.prototype.has = Z7;
    D6.prototype.set = C7;
    W9 = D6;
    k7 = WU;
    v7 = JU;
    Z1 = GU;
    HU = Array.prototype;
    BU = HU.splice;
    T7 = zU;
    _7 = KU;
    x7 = UU;
    y7 = VU;
    A6.prototype.clear = k7;
    A6.prototype.delete = T7;
    A6.prototype.get = _7;
    A6.prototype.has = x7;
    A6.prototype.set = y7;
    g7 = A6;
    LU = U4(N6, "Map");
    f7 = LU;
    h7 = qU;
    u7 = FU;
    C1 = NU;
    l7 = OU;
    m7 = DU;
    c7 = AU;
    p7 = wU;
    w6.prototype.clear = h7;
    w6.prototype.delete = l7;
    w6.prototype.get = m7;
    w6.prototype.has = c7;
    w6.prototype.set = p7;
    J9 = w6;
    MU = "Expected a function";
    G9.Cache = J9;
    k1 = G9;
    i7 = k1((X) => {
      if (!X || X.trim() === "") return null;
      let Q = X.split(",").map((J) => J.trim()).filter(Boolean);
      if (Q.length === 0) return null;
      let $ = Q.some((J) => J.startsWith("!")), Y = Q.some((J) => !J.startsWith("!"));
      if ($ && Y) return null;
      let W = Q.map((J) => J.replace(/^!/, "").toLowerCase());
      return { include: $ ? [] : W, exclude: $ ? W : [], isExclusive: $ };
    });
    o7 = r7("BASH_MAX_OUTPUT_LENGTH");
    bb = r7("TASK_MAX_OUTPUT_LENGTH");
    t7 = { name: "CLAUDE_CODE_MAX_OUTPUT_TOKENS", default: 32e3, validate: (X) => {
      if (!X) return { effective: 32e3, status: "valid" };
      let Y = parseInt(X, 10);
      if (isNaN(Y) || Y <= 0) return { effective: 32e3, status: "invalid", message: `Invalid value "${X}" (using default: 32000)` };
      if (Y > 64e3) return { effective: 64e3, status: "capped", message: `Capped from ${Y} to 64000` };
      return { effective: Y, status: "valid" };
    } };
    CU = ZU();
    XW = /* @__PURE__ */ new Set();
    B9 = 1 / 0;
    L4 = (X, Q) => {
      let $ = typeof X === "string" ? X.length : 0;
      return $W(`JSON.parse(${$} chars)`, () => JSON.parse(X, Q));
    };
    vU = k1(() => {
      return H9(process.env.DEBUG) || H9(process.env.DEBUG_SDK) || process.argv.includes("--debug") || process.argv.includes("-d") || WW() || process.argv.some((X) => X.startsWith("--debug=")) || JW() !== null;
    });
    TU = k1(() => {
      let X = process.argv.find(($) => $.startsWith("--debug="));
      if (!X) return null;
      let Q = X.substring(8);
      return i7(Q);
    });
    WW = k1(() => {
      return process.argv.includes("--debug-to-stderr") || process.argv.includes("-d2e");
    });
    JW = k1(() => {
      for (let X = 0; X < process.argv.length; X++) {
        let Q = process.argv[X];
        if (Q.startsWith("--debug-file=")) return Q.substring(13);
        if (Q === "--debug-file" && X + 1 < process.argv.length) return process.argv[X + 1];
      }
      return null;
    });
    xU = false;
    q4 = null;
    gU = k1(() => {
      if (process.argv[2] === "--ripgrep") return;
      try {
        let X = GW(), Q = (0, import_path3.dirname)(X), $ = (0, import_path3.join)(Q, "latest");
        if (!n0().existsSync(Q)) n0().mkdirSync(Q);
        if (n0().existsSync($)) try {
          n0().unlinkSync($);
        } catch {
        }
        n0().symlinkSync(X, $);
      } catch {
      }
    });
    pU = { cwd() {
      return process.cwd();
    }, existsSync(X) {
      return F0(`existsSync(${X})`, () => h.existsSync(X));
    }, async stat(X) {
      return (0, import_promises.stat)(X);
    }, async readdir(X) {
      return (0, import_promises.readdir)(X, { withFileTypes: true });
    }, async unlink(X) {
      return (0, import_promises.unlink)(X);
    }, async rmdir(X) {
      return (0, import_promises.rmdir)(X);
    }, async rm(X, Q) {
      return (0, import_promises.rm)(X, Q);
    }, statSync(X) {
      return F0(`statSync(${X})`, () => h.statSync(X));
    }, lstatSync(X) {
      return F0(`lstatSync(${X})`, () => h.lstatSync(X));
    }, readFileSync(X, Q) {
      return F0(`readFileSync(${X})`, () => h.readFileSync(X, { encoding: Q.encoding }));
    }, readFileBytesSync(X) {
      return F0(`readFileBytesSync(${X})`, () => h.readFileSync(X));
    }, readSync(X, Q) {
      return F0(`readSync(${X}, ${Q.length} bytes)`, () => {
        let $ = void 0;
        try {
          $ = h.openSync(X, "r");
          let Y = Buffer.alloc(Q.length), W = h.readSync($, Y, 0, Q.length, 0);
          return { buffer: Y, bytesRead: W };
        } finally {
          if ($) h.closeSync($);
        }
      });
    }, appendFileSync(X, Q, $) {
      return F0(`appendFileSync(${X}, ${Q.length} chars)`, () => {
        if (!h.existsSync(X) && $?.mode !== void 0) {
          let Y = h.openSync(X, "a", $.mode);
          try {
            h.appendFileSync(Y, Q);
          } finally {
            h.closeSync(Y);
          }
        } else h.appendFileSync(X, Q);
      });
    }, copyFileSync(X, Q) {
      return F0(`copyFileSync(${X} \u2192 ${Q})`, () => h.copyFileSync(X, Q));
    }, unlinkSync(X) {
      return F0(`unlinkSync(${X})`, () => h.unlinkSync(X));
    }, renameSync(X, Q) {
      return F0(`renameSync(${X} \u2192 ${Q})`, () => h.renameSync(X, Q));
    }, linkSync(X, Q) {
      return F0(`linkSync(${X} \u2192 ${Q})`, () => h.linkSync(X, Q));
    }, symlinkSync(X, Q) {
      return F0(`symlinkSync(${X} \u2192 ${Q})`, () => h.symlinkSync(X, Q));
    }, readlinkSync(X) {
      return F0(`readlinkSync(${X})`, () => h.readlinkSync(X));
    }, realpathSync(X) {
      return F0(`realpathSync(${X})`, () => h.realpathSync(X));
    }, mkdirSync(X, Q) {
      return F0(`mkdirSync(${X})`, () => {
        if (!h.existsSync(X)) {
          let $ = { recursive: true };
          if (Q?.mode !== void 0) $.mode = Q.mode;
          h.mkdirSync(X, $);
        }
      });
    }, readdirSync(X) {
      return F0(`readdirSync(${X})`, () => h.readdirSync(X, { withFileTypes: true }));
    }, readdirStringSync(X) {
      return F0(`readdirStringSync(${X})`, () => h.readdirSync(X));
    }, isDirEmptySync(X) {
      return F0(`isDirEmptySync(${X})`, () => {
        return this.readdirSync(X).length === 0;
      });
    }, rmdirSync(X) {
      return F0(`rmdirSync(${X})`, () => h.rmdirSync(X));
    }, rmSync(X, Q) {
      return F0(`rmSync(${X})`, () => h.rmSync(X, Q));
    }, createWriteStream(X) {
      return h.createWriteStream(X);
    } };
    dU = pU;
    F1 = class extends Error {
    };
    F4 = null;
    BW = false;
    XX = class {
      options;
      process;
      processStdin;
      processStdout;
      ready = false;
      abortController;
      exitError;
      exitListeners = [];
      processExitHandler;
      abortHandler;
      constructor(X) {
        this.options = X;
        this.abortController = X.abortController || F6(), this.initialize();
      }
      getDefaultExecutable() {
        return M6() ? "bun" : "node";
      }
      spawnLocalProcess(X) {
        let { command: Q, args: $, cwd: Y, env: W, signal: J } = X, G = W.DEBUG_CLAUDE_AGENT_SDK || this.options.stderr ? "pipe" : "ignore", H = (0, import_child_process.spawn)(Q, $, { cwd: Y, stdio: ["pipe", "pipe", G], signal: J, env: W, windowsHide: true });
        if (W.DEBUG_CLAUDE_AGENT_SDK || this.options.stderr) H.stderr.on("data", (z) => {
          let K = z.toString();
          if (N1(K), this.options.stderr) this.options.stderr(K);
        });
        return { stdin: H.stdin, stdout: H.stdout, get killed() {
          return H.killed;
        }, get exitCode() {
          return H.exitCode;
        }, kill: H.kill.bind(H), on: H.on.bind(H), once: H.once.bind(H), off: H.off.bind(H) };
      }
      initialize() {
        try {
          let { additionalDirectories: X = [], agent: Q, betas: $, cwd: Y, executable: W = this.getDefaultExecutable(), executableArgs: J = [], extraArgs: G = {}, pathToClaudeCodeExecutable: H, env: B = { ...process.env }, maxThinkingTokens: z, maxTurns: K, maxBudgetUsd: V, model: L, fallbackModel: U, jsonSchema: F, permissionMode: q, allowDangerouslySkipPermissions: N, permissionPromptToolName: A, continueConversation: M, resume: R, settingSources: S, allowedTools: C = [], disallowedTools: K0 = [], tools: U0, mcpServers: s, strictMcpConfig: D0, canUseTool: q0, includePartialMessages: L1, plugins: P1, sandbox: o1 } = this.options, p = ["--output-format", "stream-json", "--verbose", "--input-format", "stream-json"];
          if (z !== void 0) p.push("--max-thinking-tokens", z.toString());
          if (K) p.push("--max-turns", K.toString());
          if (V !== void 0) p.push("--max-budget-usd", V.toString());
          if (L) p.push("--model", L);
          if (Q) p.push("--agent", Q);
          if ($ && $.length > 0) p.push("--betas", $.join(","));
          if (F) p.push("--json-schema", Z0(F));
          if (this.options.debugFile) p.push("--debug-file", this.options.debugFile);
          else if (this.options.debug) p.push("--debug");
          if (B.DEBUG_CLAUDE_AGENT_SDK) p.push("--debug-to-stderr");
          if (q0) {
            if (A) throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");
            p.push("--permission-prompt-tool", "stdio");
          } else if (A) p.push("--permission-prompt-tool", A);
          if (M) p.push("--continue");
          if (R) p.push("--resume", R);
          if (C.length > 0) p.push("--allowedTools", C.join(","));
          if (K0.length > 0) p.push("--disallowedTools", K0.join(","));
          if (U0 !== void 0) if (Array.isArray(U0)) if (U0.length === 0) p.push("--tools", "");
          else p.push("--tools", U0.join(","));
          else p.push("--tools", "default");
          if (s && Object.keys(s).length > 0) p.push("--mcp-config", Z0({ mcpServers: s }));
          if (S) p.push("--setting-sources", S.join(","));
          if (D0) p.push("--strict-mcp-config");
          if (q) p.push("--permission-mode", q);
          if (N) p.push("--allow-dangerously-skip-permissions");
          if (U) {
            if (L && U === L) throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");
            p.push("--fallback-model", U);
          }
          if (L1) p.push("--include-partial-messages");
          for (let E0 of X) p.push("--add-dir", E0);
          if (P1 && P1.length > 0) for (let E0 of P1) if (E0.type === "local") p.push("--plugin-dir", E0.path);
          else throw Error(`Unsupported plugin type: ${E0.type}`);
          if (this.options.forkSession) p.push("--fork-session");
          if (this.options.resumeSessionAt) p.push("--resume-session-at", this.options.resumeSessionAt);
          if (this.options.persistSession === false) p.push("--no-session-persistence");
          let Q9 = zW(G ?? {}, o1);
          for (let [E0, S1] of Object.entries(Q9)) if (S1 === null) p.push(`--${E0}`);
          else p.push(`--${E0}`, S1);
          if (!B.CLAUDE_CODE_ENTRYPOINT) B.CLAUDE_CODE_ENTRYPOINT = "sdk-ts";
          if (delete B.NODE_OPTIONS, B.DEBUG_CLAUDE_AGENT_SDK) B.DEBUG = "1";
          else delete B.DEBUG;
          let r6 = QV(H), o6 = r6 ? H : W, t6 = r6 ? [...J, ...p] : [...J, H, ...p], a6 = { command: o6, args: t6, cwd: Y, env: B, signal: this.abortController.signal };
          if (this.options.spawnClaudeCodeProcess) N1(`Spawning Claude Code (custom): ${o6} ${t6.join(" ")}`), this.process = this.options.spawnClaudeCodeProcess(a6);
          else {
            if (!n0().existsSync(H)) {
              let S1 = r6 ? `Claude Code native binary not found at ${H}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.` : `Claude Code executable not found at ${H}. Is options.pathToClaudeCodeExecutable set?`;
              throw ReferenceError(S1);
            }
            N1(`Spawning Claude Code: ${o6} ${t6.join(" ")}`), this.process = this.spawnLocalProcess(a6);
          }
          this.processStdin = this.process.stdin, this.processStdout = this.process.stdout;
          let B4 = () => {
            if (this.process && !this.process.killed) this.process.kill("SIGTERM");
          };
          this.processExitHandler = B4, this.abortHandler = B4, process.on("exit", this.processExitHandler), this.abortController.signal.addEventListener("abort", this.abortHandler), this.process.on("error", (E0) => {
            if (this.ready = false, this.abortController.signal.aborted) this.exitError = new F1("Claude Code process aborted by user");
            else this.exitError = Error(`Failed to spawn Claude Code process: ${E0.message}`), N1(this.exitError.message);
          }), this.process.on("exit", (E0, S1) => {
            if (this.ready = false, this.abortController.signal.aborted) this.exitError = new F1("Claude Code process aborted by user");
            else {
              let s6 = this.getProcessExitError(E0, S1);
              if (s6) this.exitError = s6, N1(s6.message);
            }
          }), this.ready = true;
        } catch (X) {
          throw this.ready = false, X;
        }
      }
      getProcessExitError(X, Q) {
        if (X !== 0 && X !== null) return Error(`Claude Code process exited with code ${X}`);
        else if (Q) return Error(`Claude Code process terminated by signal ${Q}`);
        return;
      }
      write(X) {
        if (this.abortController.signal.aborted) throw new F1("Operation aborted");
        if (!this.ready || !this.processStdin) throw Error("ProcessTransport is not ready for writing");
        if (this.process?.killed || this.process?.exitCode !== null) throw Error("Cannot write to terminated process");
        if (this.exitError) throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);
        N1(`[ProcessTransport] Writing to stdin: ${X.substring(0, 100)}`);
        try {
          if (!this.processStdin.write(X)) N1("[ProcessTransport] Write buffer full, data queued");
        } catch (Q) {
          throw this.ready = false, Error(`Failed to write to process stdin: ${Q.message}`);
        }
      }
      close() {
        if (this.processStdin) this.processStdin.end(), this.processStdin = void 0;
        if (this.abortHandler) this.abortController.signal.removeEventListener("abort", this.abortHandler), this.abortHandler = void 0;
        for (let { handler: X } of this.exitListeners) this.process?.off("exit", X);
        if (this.exitListeners = [], this.process && !this.process.killed) this.process.kill("SIGTERM"), setTimeout(() => {
          if (this.process && !this.process.killed) this.process.kill("SIGKILL");
        }, 5e3);
        if (this.ready = false, this.processExitHandler) process.off("exit", this.processExitHandler), this.processExitHandler = void 0;
      }
      isReady() {
        return this.ready;
      }
      async *readMessages() {
        if (!this.processStdout) throw Error("ProcessTransport output stream not available");
        let X = (0, import_readline.createInterface)({ input: this.processStdout });
        try {
          for await (let Q of X) if (Q.trim()) try {
            yield L4(Q);
          } catch ($) {
            throw N1(`Non-JSON stdout: ${Q}`), Error(`CLI output was not valid JSON. This may indicate an error during startup. Output: ${Q.slice(0, 200)}${Q.length > 200 ? "..." : ""}`);
          }
          await this.waitForExit();
        } catch (Q) {
          throw Q;
        } finally {
          X.close();
        }
      }
      endInput() {
        if (this.processStdin) this.processStdin.end();
      }
      getInputStream() {
        return this.processStdin;
      }
      onExit(X) {
        if (!this.process) return () => {
        };
        let Q = ($, Y) => {
          let W = this.getProcessExitError($, Y);
          X(W);
        };
        return this.process.on("exit", Q), this.exitListeners.push({ callback: X, handler: Q }), () => {
          if (this.process) this.process.off("exit", Q);
          let $ = this.exitListeners.findIndex((Y) => Y.handler === Q);
          if ($ !== -1) this.exitListeners.splice($, 1);
        };
      }
      async waitForExit() {
        if (!this.process) {
          if (this.exitError) throw this.exitError;
          return;
        }
        if (this.process.exitCode !== null || this.process.killed) {
          if (this.exitError) throw this.exitError;
          return;
        }
        return new Promise((X, Q) => {
          let $ = (W, J) => {
            if (this.abortController.signal.aborted) {
              Q(new F1("Operation aborted"));
              return;
            }
            let G = this.getProcessExitError(W, J);
            if (G) Q(G);
            else X();
          };
          this.process.once("exit", $);
          let Y = (W) => {
            this.process.off("exit", $), Q(W);
          };
          this.process.once("error", Y), this.process.once("exit", () => {
            this.process.off("error", Y);
          });
        });
      }
    };
    QX = class {
      returned;
      queue = [];
      readResolve;
      readReject;
      isDone = false;
      hasError;
      started = false;
      constructor(X) {
        this.returned = X;
      }
      [Symbol.asyncIterator]() {
        if (this.started) throw Error("Stream can only be iterated once");
        return this.started = true, this;
      }
      next() {
        if (this.queue.length > 0) return Promise.resolve({ done: false, value: this.queue.shift() });
        if (this.isDone) return Promise.resolve({ done: true, value: void 0 });
        if (this.hasError) return Promise.reject(this.hasError);
        return new Promise((X, Q) => {
          this.readResolve = X, this.readReject = Q;
        });
      }
      enqueue(X) {
        if (this.readResolve) {
          let Q = this.readResolve;
          this.readResolve = void 0, this.readReject = void 0, Q({ done: false, value: X });
        } else this.queue.push(X);
      }
      done() {
        if (this.isDone = true, this.readResolve) {
          let X = this.readResolve;
          this.readResolve = void 0, this.readReject = void 0, X({ done: true, value: void 0 });
        }
      }
      error(X) {
        if (this.hasError = X, this.readReject) {
          let Q = this.readReject;
          this.readResolve = void 0, this.readReject = void 0, Q(X);
        }
      }
      return() {
        if (this.isDone = true, this.returned) this.returned();
        return Promise.resolve({ done: true, value: void 0 });
      }
    };
    K9 = class {
      sendMcpMessage;
      isClosed = false;
      constructor(X) {
        this.sendMcpMessage = X;
      }
      onclose;
      onerror;
      onmessage;
      async start() {
      }
      async send(X) {
        if (this.isClosed) throw Error("Transport is closed");
        this.sendMcpMessage(X);
      }
      async close() {
        if (this.isClosed) return;
        this.isClosed = true, this.onclose?.();
      }
    };
    $X = class {
      transport;
      isSingleUserTurn;
      canUseTool;
      hooks;
      abortController;
      jsonSchema;
      initConfig;
      pendingControlResponses = /* @__PURE__ */ new Map();
      cleanupPerformed = false;
      sdkMessages;
      inputStream = new QX();
      initialization;
      cancelControllers = /* @__PURE__ */ new Map();
      hookCallbacks = /* @__PURE__ */ new Map();
      nextCallbackId = 0;
      sdkMcpTransports = /* @__PURE__ */ new Map();
      sdkMcpServerInstances = /* @__PURE__ */ new Map();
      pendingMcpResponses = /* @__PURE__ */ new Map();
      firstResultReceivedResolve;
      firstResultReceived = false;
      hasBidirectionalNeeds() {
        return this.sdkMcpTransports.size > 0 || this.hooks !== void 0 && Object.keys(this.hooks).length > 0 || this.canUseTool !== void 0;
      }
      constructor(X, Q, $, Y, W, J = /* @__PURE__ */ new Map(), G, H) {
        this.transport = X;
        this.isSingleUserTurn = Q;
        this.canUseTool = $;
        this.hooks = Y;
        this.abortController = W;
        this.jsonSchema = G;
        this.initConfig = H;
        for (let [B, z] of J) this.connectSdkMcpServer(B, z);
        this.sdkMessages = this.readSdkMessages(), this.readMessages(), this.initialization = this.initialize(), this.initialization.catch(() => {
        });
      }
      setError(X) {
        this.inputStream.error(X);
      }
      close() {
        this.cleanup();
      }
      cleanup(X) {
        if (this.cleanupPerformed) return;
        this.cleanupPerformed = true;
        try {
          this.transport.close(), this.pendingControlResponses.clear(), this.pendingMcpResponses.clear(), this.cancelControllers.clear(), this.hookCallbacks.clear();
          for (let Q of this.sdkMcpTransports.values()) try {
            Q.close();
          } catch {
          }
          if (this.sdkMcpTransports.clear(), X) this.inputStream.error(X);
          else this.inputStream.done();
        } catch (Q) {
        }
      }
      next(...[X]) {
        return this.sdkMessages.next(...[X]);
      }
      return(X) {
        return this.sdkMessages.return(X);
      }
      throw(X) {
        return this.sdkMessages.throw(X);
      }
      [Symbol.asyncIterator]() {
        return this.sdkMessages;
      }
      [Symbol.asyncDispose]() {
        return this.sdkMessages[Symbol.asyncDispose]();
      }
      async readMessages() {
        try {
          for await (let X of this.transport.readMessages()) {
            if (X.type === "control_response") {
              let Q = this.pendingControlResponses.get(X.response.request_id);
              if (Q) Q(X.response);
              continue;
            } else if (X.type === "control_request") {
              this.handleControlRequest(X);
              continue;
            } else if (X.type === "control_cancel_request") {
              this.handleControlCancelRequest(X);
              continue;
            } else if (X.type === "keep_alive") continue;
            if (X.type === "streamlined_text" || X.type === "streamlined_tool_use_summary") continue;
            if (X.type === "result") {
              if (this.firstResultReceived = true, this.firstResultReceivedResolve) this.firstResultReceivedResolve();
              if (this.isSingleUserTurn) v1("[Query.readMessages] First result received for single-turn query, closing stdin"), this.transport.endInput();
            }
            this.inputStream.enqueue(X);
          }
          if (this.firstResultReceivedResolve) this.firstResultReceivedResolve();
          this.inputStream.done(), this.cleanup();
        } catch (X) {
          if (this.firstResultReceivedResolve) this.firstResultReceivedResolve();
          this.inputStream.error(X), this.cleanup(X);
        }
      }
      async handleControlRequest(X) {
        let Q = new AbortController();
        this.cancelControllers.set(X.request_id, Q);
        try {
          let $ = await this.processControlRequest(X, Q.signal), Y = { type: "control_response", response: { subtype: "success", request_id: X.request_id, response: $ } };
          await Promise.resolve(this.transport.write(Z0(Y) + `
`));
        } catch ($) {
          let Y = { type: "control_response", response: { subtype: "error", request_id: X.request_id, error: $.message || String($) } };
          await Promise.resolve(this.transport.write(Z0(Y) + `
`));
        } finally {
          this.cancelControllers.delete(X.request_id);
        }
      }
      handleControlCancelRequest(X) {
        let Q = this.cancelControllers.get(X.request_id);
        if (Q) Q.abort(), this.cancelControllers.delete(X.request_id);
      }
      async processControlRequest(X, Q) {
        if (X.request.subtype === "can_use_tool") {
          if (!this.canUseTool) throw Error("canUseTool callback is not provided.");
          return { ...await this.canUseTool(X.request.tool_name, X.request.input, { signal: Q, suggestions: X.request.permission_suggestions, blockedPath: X.request.blocked_path, decisionReason: X.request.decision_reason, toolUseID: X.request.tool_use_id, agentID: X.request.agent_id }), toolUseID: X.request.tool_use_id };
        } else if (X.request.subtype === "hook_callback") return await this.handleHookCallbacks(X.request.callback_id, X.request.input, X.request.tool_use_id, Q);
        else if (X.request.subtype === "mcp_message") {
          let $ = X.request, Y = this.sdkMcpTransports.get($.server_name);
          if (!Y) throw Error(`SDK MCP server not found: ${$.server_name}`);
          if ("method" in $.message && "id" in $.message && $.message.id !== null) return { mcp_response: await this.handleMcpControlRequest($.server_name, $, Y) };
          else {
            if (Y.onmessage) Y.onmessage($.message);
            return { mcp_response: { jsonrpc: "2.0", result: {}, id: 0 } };
          }
        }
        throw Error("Unsupported control request subtype: " + X.request.subtype);
      }
      async *readSdkMessages() {
        for await (let X of this.inputStream) yield X;
      }
      async initialize() {
        let X;
        if (this.hooks) {
          X = {};
          for (let [W, J] of Object.entries(this.hooks)) if (J.length > 0) X[W] = J.map((G) => {
            let H = [];
            for (let B of G.hooks) {
              let z = `hook_${this.nextCallbackId++}`;
              this.hookCallbacks.set(z, B), H.push(z);
            }
            return { matcher: G.matcher, hookCallbackIds: H, timeout: G.timeout };
          });
        }
        let Q = this.sdkMcpTransports.size > 0 ? Array.from(this.sdkMcpTransports.keys()) : void 0, $ = { subtype: "initialize", hooks: X, sdkMcpServers: Q, jsonSchema: this.jsonSchema, systemPrompt: this.initConfig?.systemPrompt, appendSystemPrompt: this.initConfig?.appendSystemPrompt, agents: this.initConfig?.agents };
        return (await this.request($)).response;
      }
      async interrupt() {
        await this.request({ subtype: "interrupt" });
      }
      async setPermissionMode(X) {
        await this.request({ subtype: "set_permission_mode", mode: X });
      }
      async setModel(X) {
        await this.request({ subtype: "set_model", model: X });
      }
      async setMaxThinkingTokens(X) {
        await this.request({ subtype: "set_max_thinking_tokens", max_thinking_tokens: X });
      }
      async rewindFiles(X, Q) {
        return (await this.request({ subtype: "rewind_files", user_message_id: X, dry_run: Q?.dryRun })).response;
      }
      async processPendingPermissionRequests(X) {
        for (let Q of X) if (Q.request.subtype === "can_use_tool") this.handleControlRequest(Q).catch(() => {
        });
      }
      request(X) {
        let Q = Math.random().toString(36).substring(2, 15), $ = { request_id: Q, type: "control_request", request: X };
        return new Promise((Y, W) => {
          this.pendingControlResponses.set(Q, (J) => {
            if (J.subtype === "success") Y(J);
            else if (W(Error(J.error)), J.pending_permission_requests) this.processPendingPermissionRequests(J.pending_permission_requests);
          }), Promise.resolve(this.transport.write(Z0($) + `
`));
        });
      }
      async initializationResult() {
        return this.initialization;
      }
      async supportedCommands() {
        return (await this.initialization).commands;
      }
      async supportedModels() {
        return (await this.initialization).models;
      }
      async reconnectMcpServer(X) {
        await this.request({ subtype: "mcp_reconnect", serverName: X });
      }
      async toggleMcpServer(X, Q) {
        await this.request({ subtype: "mcp_toggle", serverName: X, enabled: Q });
      }
      async mcpServerStatus() {
        return (await this.request({ subtype: "mcp_status" })).response.mcpServers;
      }
      async setMcpServers(X) {
        let Q = {}, $ = {};
        for (let [H, B] of Object.entries(X)) if (B.type === "sdk" && "instance" in B) Q[H] = B.instance;
        else $[H] = B;
        let Y = new Set(this.sdkMcpServerInstances.keys()), W = new Set(Object.keys(Q));
        for (let H of Y) if (!W.has(H)) await this.disconnectSdkMcpServer(H);
        for (let [H, B] of Object.entries(Q)) if (!Y.has(H)) this.connectSdkMcpServer(H, B);
        let J = {};
        for (let H of Object.keys(Q)) J[H] = { type: "sdk", name: H };
        return (await this.request({ subtype: "mcp_set_servers", servers: { ...$, ...J } })).response;
      }
      async accountInfo() {
        return (await this.initialization).account;
      }
      async streamInput(X) {
        v1("[Query.streamInput] Starting to process input stream");
        try {
          let Q = 0;
          for await (let $ of X) {
            if (Q++, v1(`[Query.streamInput] Processing message ${Q}: ${$.type}`), this.abortController?.signal.aborted) break;
            await Promise.resolve(this.transport.write(Z0($) + `
`));
          }
          if (v1(`[Query.streamInput] Finished processing ${Q} messages from input stream`), Q > 0 && this.hasBidirectionalNeeds()) v1("[Query.streamInput] Has bidirectional needs, waiting for first result"), await this.waitForFirstResult();
          v1("[Query] Calling transport.endInput() to close stdin to CLI process"), this.transport.endInput();
        } catch (Q) {
          if (!(Q instanceof F1)) throw Q;
        }
      }
      waitForFirstResult() {
        if (this.firstResultReceived) return v1("[Query.waitForFirstResult] Result already received, returning immediately"), Promise.resolve();
        return new Promise((X) => {
          if (this.abortController?.signal.aborted) {
            X();
            return;
          }
          this.abortController?.signal.addEventListener("abort", () => X(), { once: true }), this.firstResultReceivedResolve = X;
        });
      }
      handleHookCallbacks(X, Q, $, Y) {
        let W = this.hookCallbacks.get(X);
        if (!W) throw Error(`No hook callback found for ID: ${X}`);
        return W(Q, $, { signal: Y });
      }
      connectSdkMcpServer(X, Q) {
        let $ = new K9((Y) => this.sendMcpServerMessageToCli(X, Y));
        this.sdkMcpTransports.set(X, $), this.sdkMcpServerInstances.set(X, Q), Q.connect($);
      }
      async disconnectSdkMcpServer(X) {
        let Q = this.sdkMcpTransports.get(X);
        if (Q) await Q.close(), this.sdkMcpTransports.delete(X);
        this.sdkMcpServerInstances.delete(X);
      }
      sendMcpServerMessageToCli(X, Q) {
        if ("id" in Q && Q.id !== null && Q.id !== void 0) {
          let Y = `${X}:${Q.id}`, W = this.pendingMcpResponses.get(Y);
          if (W) {
            W.resolve(Q), this.pendingMcpResponses.delete(Y);
            return;
          }
        }
        let $ = { type: "control_request", request_id: (0, import_crypto3.randomUUID)(), request: { subtype: "mcp_message", server_name: X, message: Q } };
        this.transport.write(Z0($) + `
`);
      }
      handleMcpControlRequest(X, Q, $) {
        let Y = "id" in Q.message ? Q.message.id : null, W = `${X}:${Y}`;
        return new Promise((J, G) => {
          let H = () => {
            this.pendingMcpResponses.delete(W);
          }, B = (K) => {
            H(), J(K);
          }, z = (K) => {
            H(), G(K);
          };
          if (this.pendingMcpResponses.set(W, { resolve: B, reject: z }), $.onmessage) $.onmessage(Q.message);
          else {
            H(), G(Error("No message handler registered"));
            return;
          }
        });
      }
    };
    (function(X) {
      X.assertEqual = (W) => {
      };
      function Q(W) {
      }
      X.assertIs = Q;
      function $(W) {
        throw Error();
      }
      X.assertNever = $, X.arrayToEnum = (W) => {
        let J = {};
        for (let G of W) J[G] = G;
        return J;
      }, X.getValidEnumValues = (W) => {
        let J = X.objectKeys(W).filter((H) => typeof W[W[H]] !== "number"), G = {};
        for (let H of J) G[H] = W[H];
        return X.objectValues(G);
      }, X.objectValues = (W) => {
        return X.objectKeys(W).map(function(J) {
          return W[J];
        });
      }, X.objectKeys = typeof Object.keys === "function" ? (W) => Object.keys(W) : (W) => {
        let J = [];
        for (let G in W) if (Object.prototype.hasOwnProperty.call(W, G)) J.push(G);
        return J;
      }, X.find = (W, J) => {
        for (let G of W) if (J(G)) return G;
        return;
      }, X.isInteger = typeof Number.isInteger === "function" ? (W) => Number.isInteger(W) : (W) => typeof W === "number" && Number.isFinite(W) && Math.floor(W) === W;
      function Y(W, J = " | ") {
        return W.map((G) => typeof G === "string" ? `'${G}'` : G).join(J);
      }
      X.joinValues = Y, X.jsonStringifyReplacer = (W, J) => {
        if (typeof J === "bigint") return J.toString();
        return J;
      };
    })(n || (n = {}));
    (function(X) {
      X.mergeShapes = (Q, $) => {
        return { ...Q, ...$ };
      };
    })(VW || (VW = {}));
    I = n.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]);
    O1 = (X) => {
      switch (typeof X) {
        case "undefined":
          return I.undefined;
        case "string":
          return I.string;
        case "number":
          return Number.isNaN(X) ? I.nan : I.number;
        case "boolean":
          return I.boolean;
        case "function":
          return I.function;
        case "bigint":
          return I.bigint;
        case "symbol":
          return I.symbol;
        case "object":
          if (Array.isArray(X)) return I.array;
          if (X === null) return I.null;
          if (X.then && typeof X.then === "function" && X.catch && typeof X.catch === "function") return I.promise;
          if (typeof Map < "u" && X instanceof Map) return I.map;
          if (typeof Set < "u" && X instanceof Set) return I.set;
          if (typeof Date < "u" && X instanceof Date) return I.date;
          return I.object;
        default:
          return I.unknown;
      }
    };
    w = n.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]);
    h0 = class _h0 extends Error {
      get errors() {
        return this.issues;
      }
      constructor(X) {
        super();
        this.issues = [], this.addIssue = ($) => {
          this.issues = [...this.issues, $];
        }, this.addIssues = ($ = []) => {
          this.issues = [...this.issues, ...$];
        };
        let Q = new.target.prototype;
        if (Object.setPrototypeOf) Object.setPrototypeOf(this, Q);
        else this.__proto__ = Q;
        this.name = "ZodError", this.issues = X;
      }
      format(X) {
        let Q = X || function(W) {
          return W.message;
        }, $ = { _errors: [] }, Y = (W) => {
          for (let J of W.issues) if (J.code === "invalid_union") J.unionErrors.map(Y);
          else if (J.code === "invalid_return_type") Y(J.returnTypeError);
          else if (J.code === "invalid_arguments") Y(J.argumentsError);
          else if (J.path.length === 0) $._errors.push(Q(J));
          else {
            let G = $, H = 0;
            while (H < J.path.length) {
              let B = J.path[H];
              if (H !== J.path.length - 1) G[B] = G[B] || { _errors: [] };
              else G[B] = G[B] || { _errors: [] }, G[B]._errors.push(Q(J));
              G = G[B], H++;
            }
          }
        };
        return Y(this), $;
      }
      static assert(X) {
        if (!(X instanceof _h0)) throw Error(`Not a ZodError: ${X}`);
      }
      toString() {
        return this.message;
      }
      get message() {
        return JSON.stringify(this.issues, n.jsonStringifyReplacer, 2);
      }
      get isEmpty() {
        return this.issues.length === 0;
      }
      flatten(X = (Q) => Q.message) {
        let Q = {}, $ = [];
        for (let Y of this.issues) if (Y.path.length > 0) {
          let W = Y.path[0];
          Q[W] = Q[W] || [], Q[W].push(X(Y));
        } else $.push(X(Y));
        return { formErrors: $, fieldErrors: Q };
      }
      get formErrors() {
        return this.flatten();
      }
    };
    h0.create = (X) => {
      return new h0(X);
    };
    WV = (X, Q) => {
      let $;
      switch (X.code) {
        case w.invalid_type:
          if (X.received === I.undefined) $ = "Required";
          else $ = `Expected ${X.expected}, received ${X.received}`;
          break;
        case w.invalid_literal:
          $ = `Invalid literal value, expected ${JSON.stringify(X.expected, n.jsonStringifyReplacer)}`;
          break;
        case w.unrecognized_keys:
          $ = `Unrecognized key(s) in object: ${n.joinValues(X.keys, ", ")}`;
          break;
        case w.invalid_union:
          $ = "Invalid input";
          break;
        case w.invalid_union_discriminator:
          $ = `Invalid discriminator value. Expected ${n.joinValues(X.options)}`;
          break;
        case w.invalid_enum_value:
          $ = `Invalid enum value. Expected ${n.joinValues(X.options)}, received '${X.received}'`;
          break;
        case w.invalid_arguments:
          $ = "Invalid function arguments";
          break;
        case w.invalid_return_type:
          $ = "Invalid function return type";
          break;
        case w.invalid_date:
          $ = "Invalid date";
          break;
        case w.invalid_string:
          if (typeof X.validation === "object") if ("includes" in X.validation) {
            if ($ = `Invalid input: must include "${X.validation.includes}"`, typeof X.validation.position === "number") $ = `${$} at one or more positions greater than or equal to ${X.validation.position}`;
          } else if ("startsWith" in X.validation) $ = `Invalid input: must start with "${X.validation.startsWith}"`;
          else if ("endsWith" in X.validation) $ = `Invalid input: must end with "${X.validation.endsWith}"`;
          else n.assertNever(X.validation);
          else if (X.validation !== "regex") $ = `Invalid ${X.validation}`;
          else $ = "Invalid";
          break;
        case w.too_small:
          if (X.type === "array") $ = `Array must contain ${X.exact ? "exactly" : X.inclusive ? "at least" : "more than"} ${X.minimum} element(s)`;
          else if (X.type === "string") $ = `String must contain ${X.exact ? "exactly" : X.inclusive ? "at least" : "over"} ${X.minimum} character(s)`;
          else if (X.type === "number") $ = `Number must be ${X.exact ? "exactly equal to " : X.inclusive ? "greater than or equal to " : "greater than "}${X.minimum}`;
          else if (X.type === "bigint") $ = `Number must be ${X.exact ? "exactly equal to " : X.inclusive ? "greater than or equal to " : "greater than "}${X.minimum}`;
          else if (X.type === "date") $ = `Date must be ${X.exact ? "exactly equal to " : X.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(X.minimum))}`;
          else $ = "Invalid input";
          break;
        case w.too_big:
          if (X.type === "array") $ = `Array must contain ${X.exact ? "exactly" : X.inclusive ? "at most" : "less than"} ${X.maximum} element(s)`;
          else if (X.type === "string") $ = `String must contain ${X.exact ? "exactly" : X.inclusive ? "at most" : "under"} ${X.maximum} character(s)`;
          else if (X.type === "number") $ = `Number must be ${X.exact ? "exactly" : X.inclusive ? "less than or equal to" : "less than"} ${X.maximum}`;
          else if (X.type === "bigint") $ = `BigInt must be ${X.exact ? "exactly" : X.inclusive ? "less than or equal to" : "less than"} ${X.maximum}`;
          else if (X.type === "date") $ = `Date must be ${X.exact ? "exactly" : X.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(X.maximum))}`;
          else $ = "Invalid input";
          break;
        case w.custom:
          $ = "Invalid input";
          break;
        case w.invalid_intersection_types:
          $ = "Intersection results could not be merged";
          break;
        case w.not_multiple_of:
          $ = `Number must be a multiple of ${X.multipleOf}`;
          break;
        case w.not_finite:
          $ = "Number must be finite";
          break;
        default:
          $ = Q.defaultError, n.assertNever(X);
      }
      return { message: $ };
    };
    T1 = WV;
    JV = T1;
    N4 = (X) => {
      let { data: Q, path: $, errorMaps: Y, issueData: W } = X, J = [...$, ...W.path || []], G = { ...W, path: J };
      if (W.message !== void 0) return { ...W, path: J, message: W.message };
      let H = "", B = Y.filter((z) => !!z).slice().reverse();
      for (let z of B) H = z(G, { data: Q, defaultError: H }).message;
      return { ...W, path: J, message: H };
    };
    b0 = class _b0 {
      constructor() {
        this.value = "valid";
      }
      dirty() {
        if (this.value === "valid") this.value = "dirty";
      }
      abort() {
        if (this.value !== "aborted") this.value = "aborted";
      }
      static mergeArray(X, Q) {
        let $ = [];
        for (let Y of Q) {
          if (Y.status === "aborted") return g;
          if (Y.status === "dirty") X.dirty();
          $.push(Y.value);
        }
        return { status: X.value, value: $ };
      }
      static async mergeObjectAsync(X, Q) {
        let $ = [];
        for (let Y of Q) {
          let W = await Y.key, J = await Y.value;
          $.push({ key: W, value: J });
        }
        return _b0.mergeObjectSync(X, $);
      }
      static mergeObjectSync(X, Q) {
        let $ = {};
        for (let Y of Q) {
          let { key: W, value: J } = Y;
          if (W.status === "aborted") return g;
          if (J.status === "aborted") return g;
          if (W.status === "dirty") X.dirty();
          if (J.status === "dirty") X.dirty();
          if (W.value !== "__proto__" && (typeof J.value < "u" || Y.alwaysSet)) $[W.value] = J.value;
        }
        return { status: X.value, value: $ };
      }
    };
    g = Object.freeze({ status: "aborted" });
    j6 = (X) => ({ status: "dirty", value: X });
    C0 = (X) => ({ status: "valid", value: X });
    L9 = (X) => X.status === "aborted";
    q9 = (X) => X.status === "dirty";
    t1 = (X) => X.status === "valid";
    WX = (X) => typeof Promise < "u" && X instanceof Promise;
    (function(X) {
      X.errToObj = (Q) => typeof Q === "string" ? { message: Q } : Q || {}, X.toString = (Q) => typeof Q === "string" ? Q : Q?.message;
    })(Z || (Z = {}));
    r0 = class {
      constructor(X, Q, $, Y) {
        this._cachedPath = [], this.parent = X, this.data = Q, this._path = $, this._key = Y;
      }
      get path() {
        if (!this._cachedPath.length) if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key);
        else this._cachedPath.push(...this._path, this._key);
        return this._cachedPath;
      }
    };
    LW = (X, Q) => {
      if (t1(Q)) return { success: true, data: Q.value };
      else {
        if (!X.common.issues.length) throw Error("Validation failed but no issues detected.");
        return { success: false, get error() {
          if (this._error) return this._error;
          let $ = new h0(X.common.issues);
          return this._error = $, this._error;
        } };
      }
    };
    d = class {
      get description() {
        return this._def.description;
      }
      _getType(X) {
        return O1(X.data);
      }
      _getOrReturnCtx(X, Q) {
        return Q || { common: X.parent.common, data: X.data, parsedType: O1(X.data), schemaErrorMap: this._def.errorMap, path: X.path, parent: X.parent };
      }
      _processInputParams(X) {
        return { status: new b0(), ctx: { common: X.parent.common, data: X.data, parsedType: O1(X.data), schemaErrorMap: this._def.errorMap, path: X.path, parent: X.parent } };
      }
      _parseSync(X) {
        let Q = this._parse(X);
        if (WX(Q)) throw Error("Synchronous parse encountered promise.");
        return Q;
      }
      _parseAsync(X) {
        let Q = this._parse(X);
        return Promise.resolve(Q);
      }
      parse(X, Q) {
        let $ = this.safeParse(X, Q);
        if ($.success) return $.data;
        throw $.error;
      }
      safeParse(X, Q) {
        let $ = { common: { issues: [], async: Q?.async ?? false, contextualErrorMap: Q?.errorMap }, path: Q?.path || [], schemaErrorMap: this._def.errorMap, parent: null, data: X, parsedType: O1(X) }, Y = this._parseSync({ data: X, path: $.path, parent: $ });
        return LW($, Y);
      }
      "~validate"(X) {
        let Q = { common: { issues: [], async: !!this["~standard"].async }, path: [], schemaErrorMap: this._def.errorMap, parent: null, data: X, parsedType: O1(X) };
        if (!this["~standard"].async) try {
          let $ = this._parseSync({ data: X, path: [], parent: Q });
          return t1($) ? { value: $.value } : { issues: Q.common.issues };
        } catch ($) {
          if ($?.message?.toLowerCase()?.includes("encountered")) this["~standard"].async = true;
          Q.common = { issues: [], async: true };
        }
        return this._parseAsync({ data: X, path: [], parent: Q }).then(($) => t1($) ? { value: $.value } : { issues: Q.common.issues });
      }
      async parseAsync(X, Q) {
        let $ = await this.safeParseAsync(X, Q);
        if ($.success) return $.data;
        throw $.error;
      }
      async safeParseAsync(X, Q) {
        let $ = { common: { issues: [], contextualErrorMap: Q?.errorMap, async: true }, path: Q?.path || [], schemaErrorMap: this._def.errorMap, parent: null, data: X, parsedType: O1(X) }, Y = this._parse({ data: X, path: $.path, parent: $ }), W = await (WX(Y) ? Y : Promise.resolve(Y));
        return LW($, W);
      }
      refine(X, Q) {
        let $ = (Y) => {
          if (typeof Q === "string" || typeof Q > "u") return { message: Q };
          else if (typeof Q === "function") return Q(Y);
          else return Q;
        };
        return this._refinement((Y, W) => {
          let J = X(Y), G = () => W.addIssue({ code: w.custom, ...$(Y) });
          if (typeof Promise < "u" && J instanceof Promise) return J.then((H) => {
            if (!H) return G(), false;
            else return true;
          });
          if (!J) return G(), false;
          else return true;
        });
      }
      refinement(X, Q) {
        return this._refinement(($, Y) => {
          if (!X($)) return Y.addIssue(typeof Q === "function" ? Q($, Y) : Q), false;
          else return true;
        });
      }
      _refinement(X) {
        return new G1({ schema: this, typeName: j.ZodEffects, effect: { type: "refinement", refinement: X } });
      }
      superRefine(X) {
        return this._refinement(X);
      }
      constructor(X) {
        this.spa = this.safeParseAsync, this._def = X, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = { version: 1, vendor: "zod", validate: (Q) => this["~validate"](Q) };
      }
      optional() {
        return J1.create(this, this._def);
      }
      nullable() {
        return _1.create(this, this._def);
      }
      nullish() {
        return this.nullable().optional();
      }
      array() {
        return W1.create(this);
      }
      promise() {
        return P6.create(this, this._def);
      }
      or(X) {
        return zX.create([this, X], this._def);
      }
      and(X) {
        return KX.create(this, X, this._def);
      }
      transform(X) {
        return new G1({ ...l(this._def), schema: this, typeName: j.ZodEffects, effect: { type: "transform", transform: X } });
      }
      default(X) {
        let Q = typeof X === "function" ? X : () => X;
        return new qX({ ...l(this._def), innerType: this, defaultValue: Q, typeName: j.ZodDefault });
      }
      brand() {
        return new D9({ typeName: j.ZodBranded, type: this, ...l(this._def) });
      }
      catch(X) {
        let Q = typeof X === "function" ? X : () => X;
        return new FX({ ...l(this._def), innerType: this, catchValue: Q, typeName: j.ZodCatch });
      }
      describe(X) {
        return new this.constructor({ ...this._def, description: X });
      }
      pipe(X) {
        return I4.create(this, X);
      }
      readonly() {
        return NX.create(this);
      }
      isOptional() {
        return this.safeParse(void 0).success;
      }
      isNullable() {
        return this.safeParse(null).success;
      }
    };
    GV = /^c[^\s-]{8,}$/i;
    HV = /^[0-9a-z]+$/;
    BV = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
    zV = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
    KV = /^[a-z0-9_-]{21}$/i;
    UV = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
    VV = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
    LV = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
    qV = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
    FV = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
    NV = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
    OV = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
    DV = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
    AV = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
    wV = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
    qW = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))";
    MV = new RegExp(`^${qW}$`);
    A1 = class _A1 extends d {
      _parse(X) {
        if (this._def.coerce) X.data = String(X.data);
        if (this._getType(X) !== I.string) {
          let W = this._getOrReturnCtx(X);
          return b(W, { code: w.invalid_type, expected: I.string, received: W.parsedType }), g;
        }
        let $ = new b0(), Y = void 0;
        for (let W of this._def.checks) if (W.kind === "min") {
          if (X.data.length < W.value) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.too_small, minimum: W.value, type: "string", inclusive: true, exact: false, message: W.message }), $.dirty();
        } else if (W.kind === "max") {
          if (X.data.length > W.value) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.too_big, maximum: W.value, type: "string", inclusive: true, exact: false, message: W.message }), $.dirty();
        } else if (W.kind === "length") {
          let J = X.data.length > W.value, G = X.data.length < W.value;
          if (J || G) {
            if (Y = this._getOrReturnCtx(X, Y), J) b(Y, { code: w.too_big, maximum: W.value, type: "string", inclusive: true, exact: true, message: W.message });
            else if (G) b(Y, { code: w.too_small, minimum: W.value, type: "string", inclusive: true, exact: true, message: W.message });
            $.dirty();
          }
        } else if (W.kind === "email") {
          if (!LV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "email", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "emoji") {
          if (!F9) F9 = new RegExp(qV, "u");
          if (!F9.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "emoji", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "uuid") {
          if (!zV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "uuid", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "nanoid") {
          if (!KV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "nanoid", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "cuid") {
          if (!GV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "cuid", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "cuid2") {
          if (!HV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "cuid2", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "ulid") {
          if (!BV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "ulid", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "url") try {
          new URL(X.data);
        } catch {
          Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "url", code: w.invalid_string, message: W.message }), $.dirty();
        }
        else if (W.kind === "regex") {
          if (W.regex.lastIndex = 0, !W.regex.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "regex", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "trim") X.data = X.data.trim();
        else if (W.kind === "includes") {
          if (!X.data.includes(W.value, W.position)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: { includes: W.value, position: W.position }, message: W.message }), $.dirty();
        } else if (W.kind === "toLowerCase") X.data = X.data.toLowerCase();
        else if (W.kind === "toUpperCase") X.data = X.data.toUpperCase();
        else if (W.kind === "startsWith") {
          if (!X.data.startsWith(W.value)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: { startsWith: W.value }, message: W.message }), $.dirty();
        } else if (W.kind === "endsWith") {
          if (!X.data.endsWith(W.value)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: { endsWith: W.value }, message: W.message }), $.dirty();
        } else if (W.kind === "datetime") {
          if (!RV(W).test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: "datetime", message: W.message }), $.dirty();
        } else if (W.kind === "date") {
          if (!MV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: "date", message: W.message }), $.dirty();
        } else if (W.kind === "time") {
          if (!jV(W).test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.invalid_string, validation: "time", message: W.message }), $.dirty();
        } else if (W.kind === "duration") {
          if (!VV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "duration", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "ip") {
          if (!IV(X.data, W.version)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "ip", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "jwt") {
          if (!EV(X.data, W.alg)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "jwt", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "cidr") {
          if (!bV(X.data, W.version)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "cidr", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "base64") {
          if (!AV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "base64", code: w.invalid_string, message: W.message }), $.dirty();
        } else if (W.kind === "base64url") {
          if (!wV.test(X.data)) Y = this._getOrReturnCtx(X, Y), b(Y, { validation: "base64url", code: w.invalid_string, message: W.message }), $.dirty();
        } else n.assertNever(W);
        return { status: $.value, value: X.data };
      }
      _regex(X, Q, $) {
        return this.refinement((Y) => X.test(Y), { validation: Q, code: w.invalid_string, ...Z.errToObj($) });
      }
      _addCheck(X) {
        return new _A1({ ...this._def, checks: [...this._def.checks, X] });
      }
      email(X) {
        return this._addCheck({ kind: "email", ...Z.errToObj(X) });
      }
      url(X) {
        return this._addCheck({ kind: "url", ...Z.errToObj(X) });
      }
      emoji(X) {
        return this._addCheck({ kind: "emoji", ...Z.errToObj(X) });
      }
      uuid(X) {
        return this._addCheck({ kind: "uuid", ...Z.errToObj(X) });
      }
      nanoid(X) {
        return this._addCheck({ kind: "nanoid", ...Z.errToObj(X) });
      }
      cuid(X) {
        return this._addCheck({ kind: "cuid", ...Z.errToObj(X) });
      }
      cuid2(X) {
        return this._addCheck({ kind: "cuid2", ...Z.errToObj(X) });
      }
      ulid(X) {
        return this._addCheck({ kind: "ulid", ...Z.errToObj(X) });
      }
      base64(X) {
        return this._addCheck({ kind: "base64", ...Z.errToObj(X) });
      }
      base64url(X) {
        return this._addCheck({ kind: "base64url", ...Z.errToObj(X) });
      }
      jwt(X) {
        return this._addCheck({ kind: "jwt", ...Z.errToObj(X) });
      }
      ip(X) {
        return this._addCheck({ kind: "ip", ...Z.errToObj(X) });
      }
      cidr(X) {
        return this._addCheck({ kind: "cidr", ...Z.errToObj(X) });
      }
      datetime(X) {
        if (typeof X === "string") return this._addCheck({ kind: "datetime", precision: null, offset: false, local: false, message: X });
        return this._addCheck({ kind: "datetime", precision: typeof X?.precision > "u" ? null : X?.precision, offset: X?.offset ?? false, local: X?.local ?? false, ...Z.errToObj(X?.message) });
      }
      date(X) {
        return this._addCheck({ kind: "date", message: X });
      }
      time(X) {
        if (typeof X === "string") return this._addCheck({ kind: "time", precision: null, message: X });
        return this._addCheck({ kind: "time", precision: typeof X?.precision > "u" ? null : X?.precision, ...Z.errToObj(X?.message) });
      }
      duration(X) {
        return this._addCheck({ kind: "duration", ...Z.errToObj(X) });
      }
      regex(X, Q) {
        return this._addCheck({ kind: "regex", regex: X, ...Z.errToObj(Q) });
      }
      includes(X, Q) {
        return this._addCheck({ kind: "includes", value: X, position: Q?.position, ...Z.errToObj(Q?.message) });
      }
      startsWith(X, Q) {
        return this._addCheck({ kind: "startsWith", value: X, ...Z.errToObj(Q) });
      }
      endsWith(X, Q) {
        return this._addCheck({ kind: "endsWith", value: X, ...Z.errToObj(Q) });
      }
      min(X, Q) {
        return this._addCheck({ kind: "min", value: X, ...Z.errToObj(Q) });
      }
      max(X, Q) {
        return this._addCheck({ kind: "max", value: X, ...Z.errToObj(Q) });
      }
      length(X, Q) {
        return this._addCheck({ kind: "length", value: X, ...Z.errToObj(Q) });
      }
      nonempty(X) {
        return this.min(1, Z.errToObj(X));
      }
      trim() {
        return new _A1({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] });
      }
      toLowerCase() {
        return new _A1({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] });
      }
      toUpperCase() {
        return new _A1({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] });
      }
      get isDatetime() {
        return !!this._def.checks.find((X) => X.kind === "datetime");
      }
      get isDate() {
        return !!this._def.checks.find((X) => X.kind === "date");
      }
      get isTime() {
        return !!this._def.checks.find((X) => X.kind === "time");
      }
      get isDuration() {
        return !!this._def.checks.find((X) => X.kind === "duration");
      }
      get isEmail() {
        return !!this._def.checks.find((X) => X.kind === "email");
      }
      get isURL() {
        return !!this._def.checks.find((X) => X.kind === "url");
      }
      get isEmoji() {
        return !!this._def.checks.find((X) => X.kind === "emoji");
      }
      get isUUID() {
        return !!this._def.checks.find((X) => X.kind === "uuid");
      }
      get isNANOID() {
        return !!this._def.checks.find((X) => X.kind === "nanoid");
      }
      get isCUID() {
        return !!this._def.checks.find((X) => X.kind === "cuid");
      }
      get isCUID2() {
        return !!this._def.checks.find((X) => X.kind === "cuid2");
      }
      get isULID() {
        return !!this._def.checks.find((X) => X.kind === "ulid");
      }
      get isIP() {
        return !!this._def.checks.find((X) => X.kind === "ip");
      }
      get isCIDR() {
        return !!this._def.checks.find((X) => X.kind === "cidr");
      }
      get isBase64() {
        return !!this._def.checks.find((X) => X.kind === "base64");
      }
      get isBase64url() {
        return !!this._def.checks.find((X) => X.kind === "base64url");
      }
      get minLength() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "min") {
          if (X === null || Q.value > X) X = Q.value;
        }
        return X;
      }
      get maxLength() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "max") {
          if (X === null || Q.value < X) X = Q.value;
        }
        return X;
      }
    };
    A1.create = (X) => {
      return new A1({ checks: [], typeName: j.ZodString, coerce: X?.coerce ?? false, ...l(X) });
    };
    I6 = class _I6 extends d {
      constructor() {
        super(...arguments);
        this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
      }
      _parse(X) {
        if (this._def.coerce) X.data = Number(X.data);
        if (this._getType(X) !== I.number) {
          let W = this._getOrReturnCtx(X);
          return b(W, { code: w.invalid_type, expected: I.number, received: W.parsedType }), g;
        }
        let $ = void 0, Y = new b0();
        for (let W of this._def.checks) if (W.kind === "int") {
          if (!n.isInteger(X.data)) $ = this._getOrReturnCtx(X, $), b($, { code: w.invalid_type, expected: "integer", received: "float", message: W.message }), Y.dirty();
        } else if (W.kind === "min") {
          if (W.inclusive ? X.data < W.value : X.data <= W.value) $ = this._getOrReturnCtx(X, $), b($, { code: w.too_small, minimum: W.value, type: "number", inclusive: W.inclusive, exact: false, message: W.message }), Y.dirty();
        } else if (W.kind === "max") {
          if (W.inclusive ? X.data > W.value : X.data >= W.value) $ = this._getOrReturnCtx(X, $), b($, { code: w.too_big, maximum: W.value, type: "number", inclusive: W.inclusive, exact: false, message: W.message }), Y.dirty();
        } else if (W.kind === "multipleOf") {
          if (PV(X.data, W.value) !== 0) $ = this._getOrReturnCtx(X, $), b($, { code: w.not_multiple_of, multipleOf: W.value, message: W.message }), Y.dirty();
        } else if (W.kind === "finite") {
          if (!Number.isFinite(X.data)) $ = this._getOrReturnCtx(X, $), b($, { code: w.not_finite, message: W.message }), Y.dirty();
        } else n.assertNever(W);
        return { status: Y.value, value: X.data };
      }
      gte(X, Q) {
        return this.setLimit("min", X, true, Z.toString(Q));
      }
      gt(X, Q) {
        return this.setLimit("min", X, false, Z.toString(Q));
      }
      lte(X, Q) {
        return this.setLimit("max", X, true, Z.toString(Q));
      }
      lt(X, Q) {
        return this.setLimit("max", X, false, Z.toString(Q));
      }
      setLimit(X, Q, $, Y) {
        return new _I6({ ...this._def, checks: [...this._def.checks, { kind: X, value: Q, inclusive: $, message: Z.toString(Y) }] });
      }
      _addCheck(X) {
        return new _I6({ ...this._def, checks: [...this._def.checks, X] });
      }
      int(X) {
        return this._addCheck({ kind: "int", message: Z.toString(X) });
      }
      positive(X) {
        return this._addCheck({ kind: "min", value: 0, inclusive: false, message: Z.toString(X) });
      }
      negative(X) {
        return this._addCheck({ kind: "max", value: 0, inclusive: false, message: Z.toString(X) });
      }
      nonpositive(X) {
        return this._addCheck({ kind: "max", value: 0, inclusive: true, message: Z.toString(X) });
      }
      nonnegative(X) {
        return this._addCheck({ kind: "min", value: 0, inclusive: true, message: Z.toString(X) });
      }
      multipleOf(X, Q) {
        return this._addCheck({ kind: "multipleOf", value: X, message: Z.toString(Q) });
      }
      finite(X) {
        return this._addCheck({ kind: "finite", message: Z.toString(X) });
      }
      safe(X) {
        return this._addCheck({ kind: "min", inclusive: true, value: Number.MIN_SAFE_INTEGER, message: Z.toString(X) })._addCheck({ kind: "max", inclusive: true, value: Number.MAX_SAFE_INTEGER, message: Z.toString(X) });
      }
      get minValue() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "min") {
          if (X === null || Q.value > X) X = Q.value;
        }
        return X;
      }
      get maxValue() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "max") {
          if (X === null || Q.value < X) X = Q.value;
        }
        return X;
      }
      get isInt() {
        return !!this._def.checks.find((X) => X.kind === "int" || X.kind === "multipleOf" && n.isInteger(X.value));
      }
      get isFinite() {
        let X = null, Q = null;
        for (let $ of this._def.checks) if ($.kind === "finite" || $.kind === "int" || $.kind === "multipleOf") return true;
        else if ($.kind === "min") {
          if (Q === null || $.value > Q) Q = $.value;
        } else if ($.kind === "max") {
          if (X === null || $.value < X) X = $.value;
        }
        return Number.isFinite(Q) && Number.isFinite(X);
      }
    };
    I6.create = (X) => {
      return new I6({ checks: [], typeName: j.ZodNumber, coerce: X?.coerce || false, ...l(X) });
    };
    E6 = class _E6 extends d {
      constructor() {
        super(...arguments);
        this.min = this.gte, this.max = this.lte;
      }
      _parse(X) {
        if (this._def.coerce) try {
          X.data = BigInt(X.data);
        } catch {
          return this._getInvalidInput(X);
        }
        if (this._getType(X) !== I.bigint) return this._getInvalidInput(X);
        let $ = void 0, Y = new b0();
        for (let W of this._def.checks) if (W.kind === "min") {
          if (W.inclusive ? X.data < W.value : X.data <= W.value) $ = this._getOrReturnCtx(X, $), b($, { code: w.too_small, type: "bigint", minimum: W.value, inclusive: W.inclusive, message: W.message }), Y.dirty();
        } else if (W.kind === "max") {
          if (W.inclusive ? X.data > W.value : X.data >= W.value) $ = this._getOrReturnCtx(X, $), b($, { code: w.too_big, type: "bigint", maximum: W.value, inclusive: W.inclusive, message: W.message }), Y.dirty();
        } else if (W.kind === "multipleOf") {
          if (X.data % W.value !== BigInt(0)) $ = this._getOrReturnCtx(X, $), b($, { code: w.not_multiple_of, multipleOf: W.value, message: W.message }), Y.dirty();
        } else n.assertNever(W);
        return { status: Y.value, value: X.data };
      }
      _getInvalidInput(X) {
        let Q = this._getOrReturnCtx(X);
        return b(Q, { code: w.invalid_type, expected: I.bigint, received: Q.parsedType }), g;
      }
      gte(X, Q) {
        return this.setLimit("min", X, true, Z.toString(Q));
      }
      gt(X, Q) {
        return this.setLimit("min", X, false, Z.toString(Q));
      }
      lte(X, Q) {
        return this.setLimit("max", X, true, Z.toString(Q));
      }
      lt(X, Q) {
        return this.setLimit("max", X, false, Z.toString(Q));
      }
      setLimit(X, Q, $, Y) {
        return new _E6({ ...this._def, checks: [...this._def.checks, { kind: X, value: Q, inclusive: $, message: Z.toString(Y) }] });
      }
      _addCheck(X) {
        return new _E6({ ...this._def, checks: [...this._def.checks, X] });
      }
      positive(X) {
        return this._addCheck({ kind: "min", value: BigInt(0), inclusive: false, message: Z.toString(X) });
      }
      negative(X) {
        return this._addCheck({ kind: "max", value: BigInt(0), inclusive: false, message: Z.toString(X) });
      }
      nonpositive(X) {
        return this._addCheck({ kind: "max", value: BigInt(0), inclusive: true, message: Z.toString(X) });
      }
      nonnegative(X) {
        return this._addCheck({ kind: "min", value: BigInt(0), inclusive: true, message: Z.toString(X) });
      }
      multipleOf(X, Q) {
        return this._addCheck({ kind: "multipleOf", value: X, message: Z.toString(Q) });
      }
      get minValue() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "min") {
          if (X === null || Q.value > X) X = Q.value;
        }
        return X;
      }
      get maxValue() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "max") {
          if (X === null || Q.value < X) X = Q.value;
        }
        return X;
      }
    };
    E6.create = (X) => {
      return new E6({ checks: [], typeName: j.ZodBigInt, coerce: X?.coerce ?? false, ...l(X) });
    };
    O4 = class extends d {
      _parse(X) {
        if (this._def.coerce) X.data = Boolean(X.data);
        if (this._getType(X) !== I.boolean) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.boolean, received: $.parsedType }), g;
        }
        return C0(X.data);
      }
    };
    O4.create = (X) => {
      return new O4({ typeName: j.ZodBoolean, coerce: X?.coerce || false, ...l(X) });
    };
    GX = class _GX extends d {
      _parse(X) {
        if (this._def.coerce) X.data = new Date(X.data);
        if (this._getType(X) !== I.date) {
          let W = this._getOrReturnCtx(X);
          return b(W, { code: w.invalid_type, expected: I.date, received: W.parsedType }), g;
        }
        if (Number.isNaN(X.data.getTime())) {
          let W = this._getOrReturnCtx(X);
          return b(W, { code: w.invalid_date }), g;
        }
        let $ = new b0(), Y = void 0;
        for (let W of this._def.checks) if (W.kind === "min") {
          if (X.data.getTime() < W.value) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.too_small, message: W.message, inclusive: true, exact: false, minimum: W.value, type: "date" }), $.dirty();
        } else if (W.kind === "max") {
          if (X.data.getTime() > W.value) Y = this._getOrReturnCtx(X, Y), b(Y, { code: w.too_big, message: W.message, inclusive: true, exact: false, maximum: W.value, type: "date" }), $.dirty();
        } else n.assertNever(W);
        return { status: $.value, value: new Date(X.data.getTime()) };
      }
      _addCheck(X) {
        return new _GX({ ...this._def, checks: [...this._def.checks, X] });
      }
      min(X, Q) {
        return this._addCheck({ kind: "min", value: X.getTime(), message: Z.toString(Q) });
      }
      max(X, Q) {
        return this._addCheck({ kind: "max", value: X.getTime(), message: Z.toString(Q) });
      }
      get minDate() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "min") {
          if (X === null || Q.value > X) X = Q.value;
        }
        return X != null ? new Date(X) : null;
      }
      get maxDate() {
        let X = null;
        for (let Q of this._def.checks) if (Q.kind === "max") {
          if (X === null || Q.value < X) X = Q.value;
        }
        return X != null ? new Date(X) : null;
      }
    };
    GX.create = (X) => {
      return new GX({ checks: [], coerce: X?.coerce || false, typeName: j.ZodDate, ...l(X) });
    };
    D4 = class extends d {
      _parse(X) {
        if (this._getType(X) !== I.symbol) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.symbol, received: $.parsedType }), g;
        }
        return C0(X.data);
      }
    };
    D4.create = (X) => {
      return new D4({ typeName: j.ZodSymbol, ...l(X) });
    };
    HX = class extends d {
      _parse(X) {
        if (this._getType(X) !== I.undefined) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.undefined, received: $.parsedType }), g;
        }
        return C0(X.data);
      }
    };
    HX.create = (X) => {
      return new HX({ typeName: j.ZodUndefined, ...l(X) });
    };
    BX = class extends d {
      _parse(X) {
        if (this._getType(X) !== I.null) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.null, received: $.parsedType }), g;
        }
        return C0(X.data);
      }
    };
    BX.create = (X) => {
      return new BX({ typeName: j.ZodNull, ...l(X) });
    };
    A4 = class extends d {
      constructor() {
        super(...arguments);
        this._any = true;
      }
      _parse(X) {
        return C0(X.data);
      }
    };
    A4.create = (X) => {
      return new A4({ typeName: j.ZodAny, ...l(X) });
    };
    a1 = class extends d {
      constructor() {
        super(...arguments);
        this._unknown = true;
      }
      _parse(X) {
        return C0(X.data);
      }
    };
    a1.create = (X) => {
      return new a1({ typeName: j.ZodUnknown, ...l(X) });
    };
    w1 = class extends d {
      _parse(X) {
        let Q = this._getOrReturnCtx(X);
        return b(Q, { code: w.invalid_type, expected: I.never, received: Q.parsedType }), g;
      }
    };
    w1.create = (X) => {
      return new w1({ typeName: j.ZodNever, ...l(X) });
    };
    w4 = class extends d {
      _parse(X) {
        if (this._getType(X) !== I.undefined) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.void, received: $.parsedType }), g;
        }
        return C0(X.data);
      }
    };
    w4.create = (X) => {
      return new w4({ typeName: j.ZodVoid, ...l(X) });
    };
    W1 = class _W1 extends d {
      _parse(X) {
        let { ctx: Q, status: $ } = this._processInputParams(X), Y = this._def;
        if (Q.parsedType !== I.array) return b(Q, { code: w.invalid_type, expected: I.array, received: Q.parsedType }), g;
        if (Y.exactLength !== null) {
          let J = Q.data.length > Y.exactLength.value, G = Q.data.length < Y.exactLength.value;
          if (J || G) b(Q, { code: J ? w.too_big : w.too_small, minimum: G ? Y.exactLength.value : void 0, maximum: J ? Y.exactLength.value : void 0, type: "array", inclusive: true, exact: true, message: Y.exactLength.message }), $.dirty();
        }
        if (Y.minLength !== null) {
          if (Q.data.length < Y.minLength.value) b(Q, { code: w.too_small, minimum: Y.minLength.value, type: "array", inclusive: true, exact: false, message: Y.minLength.message }), $.dirty();
        }
        if (Y.maxLength !== null) {
          if (Q.data.length > Y.maxLength.value) b(Q, { code: w.too_big, maximum: Y.maxLength.value, type: "array", inclusive: true, exact: false, message: Y.maxLength.message }), $.dirty();
        }
        if (Q.common.async) return Promise.all([...Q.data].map((J, G) => {
          return Y.type._parseAsync(new r0(Q, J, Q.path, G));
        })).then((J) => {
          return b0.mergeArray($, J);
        });
        let W = [...Q.data].map((J, G) => {
          return Y.type._parseSync(new r0(Q, J, Q.path, G));
        });
        return b0.mergeArray($, W);
      }
      get element() {
        return this._def.type;
      }
      min(X, Q) {
        return new _W1({ ...this._def, minLength: { value: X, message: Z.toString(Q) } });
      }
      max(X, Q) {
        return new _W1({ ...this._def, maxLength: { value: X, message: Z.toString(Q) } });
      }
      length(X, Q) {
        return new _W1({ ...this._def, exactLength: { value: X, message: Z.toString(Q) } });
      }
      nonempty(X) {
        return this.min(1, X);
      }
    };
    W1.create = (X, Q) => {
      return new W1({ type: X, minLength: null, maxLength: null, exactLength: null, typeName: j.ZodArray, ...l(Q) });
    };
    V0 = class _V0 extends d {
      constructor() {
        super(...arguments);
        this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
      }
      _getCached() {
        if (this._cached !== null) return this._cached;
        let X = this._def.shape(), Q = n.objectKeys(X);
        return this._cached = { shape: X, keys: Q }, this._cached;
      }
      _parse(X) {
        if (this._getType(X) !== I.object) {
          let B = this._getOrReturnCtx(X);
          return b(B, { code: w.invalid_type, expected: I.object, received: B.parsedType }), g;
        }
        let { status: $, ctx: Y } = this._processInputParams(X), { shape: W, keys: J } = this._getCached(), G = [];
        if (!(this._def.catchall instanceof w1 && this._def.unknownKeys === "strip")) {
          for (let B in Y.data) if (!J.includes(B)) G.push(B);
        }
        let H = [];
        for (let B of J) {
          let z = W[B], K = Y.data[B];
          H.push({ key: { status: "valid", value: B }, value: z._parse(new r0(Y, K, Y.path, B)), alwaysSet: B in Y.data });
        }
        if (this._def.catchall instanceof w1) {
          let B = this._def.unknownKeys;
          if (B === "passthrough") for (let z of G) H.push({ key: { status: "valid", value: z }, value: { status: "valid", value: Y.data[z] } });
          else if (B === "strict") {
            if (G.length > 0) b(Y, { code: w.unrecognized_keys, keys: G }), $.dirty();
          } else if (B === "strip") ;
          else throw Error("Internal ZodObject error: invalid unknownKeys value.");
        } else {
          let B = this._def.catchall;
          for (let z of G) {
            let K = Y.data[z];
            H.push({ key: { status: "valid", value: z }, value: B._parse(new r0(Y, K, Y.path, z)), alwaysSet: z in Y.data });
          }
        }
        if (Y.common.async) return Promise.resolve().then(async () => {
          let B = [];
          for (let z of H) {
            let K = await z.key, V = await z.value;
            B.push({ key: K, value: V, alwaysSet: z.alwaysSet });
          }
          return B;
        }).then((B) => {
          return b0.mergeObjectSync($, B);
        });
        else return b0.mergeObjectSync($, H);
      }
      get shape() {
        return this._def.shape();
      }
      strict(X) {
        return Z.errToObj, new _V0({ ...this._def, unknownKeys: "strict", ...X !== void 0 ? { errorMap: (Q, $) => {
          let Y = this._def.errorMap?.(Q, $).message ?? $.defaultError;
          if (Q.code === "unrecognized_keys") return { message: Z.errToObj(X).message ?? Y };
          return { message: Y };
        } } : {} });
      }
      strip() {
        return new _V0({ ...this._def, unknownKeys: "strip" });
      }
      passthrough() {
        return new _V0({ ...this._def, unknownKeys: "passthrough" });
      }
      extend(X) {
        return new _V0({ ...this._def, shape: () => ({ ...this._def.shape(), ...X }) });
      }
      merge(X) {
        return new _V0({ unknownKeys: X._def.unknownKeys, catchall: X._def.catchall, shape: () => ({ ...this._def.shape(), ...X._def.shape() }), typeName: j.ZodObject });
      }
      setKey(X, Q) {
        return this.augment({ [X]: Q });
      }
      catchall(X) {
        return new _V0({ ...this._def, catchall: X });
      }
      pick(X) {
        let Q = {};
        for (let $ of n.objectKeys(X)) if (X[$] && this.shape[$]) Q[$] = this.shape[$];
        return new _V0({ ...this._def, shape: () => Q });
      }
      omit(X) {
        let Q = {};
        for (let $ of n.objectKeys(this.shape)) if (!X[$]) Q[$] = this.shape[$];
        return new _V0({ ...this._def, shape: () => Q });
      }
      deepPartial() {
        return R6(this);
      }
      partial(X) {
        let Q = {};
        for (let $ of n.objectKeys(this.shape)) {
          let Y = this.shape[$];
          if (X && !X[$]) Q[$] = Y;
          else Q[$] = Y.optional();
        }
        return new _V0({ ...this._def, shape: () => Q });
      }
      required(X) {
        let Q = {};
        for (let $ of n.objectKeys(this.shape)) if (X && !X[$]) Q[$] = this.shape[$];
        else {
          let W = this.shape[$];
          while (W instanceof J1) W = W._def.innerType;
          Q[$] = W;
        }
        return new _V0({ ...this._def, shape: () => Q });
      }
      keyof() {
        return NW(n.objectKeys(this.shape));
      }
    };
    V0.create = (X, Q) => {
      return new V0({ shape: () => X, unknownKeys: "strip", catchall: w1.create(), typeName: j.ZodObject, ...l(Q) });
    };
    V0.strictCreate = (X, Q) => {
      return new V0({ shape: () => X, unknownKeys: "strict", catchall: w1.create(), typeName: j.ZodObject, ...l(Q) });
    };
    V0.lazycreate = (X, Q) => {
      return new V0({ shape: X, unknownKeys: "strip", catchall: w1.create(), typeName: j.ZodObject, ...l(Q) });
    };
    zX = class extends d {
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X), $ = this._def.options;
        function Y(W) {
          for (let G of W) if (G.result.status === "valid") return G.result;
          for (let G of W) if (G.result.status === "dirty") return Q.common.issues.push(...G.ctx.common.issues), G.result;
          let J = W.map((G) => new h0(G.ctx.common.issues));
          return b(Q, { code: w.invalid_union, unionErrors: J }), g;
        }
        if (Q.common.async) return Promise.all($.map(async (W) => {
          let J = { ...Q, common: { ...Q.common, issues: [] }, parent: null };
          return { result: await W._parseAsync({ data: Q.data, path: Q.path, parent: J }), ctx: J };
        })).then(Y);
        else {
          let W = void 0, J = [];
          for (let H of $) {
            let B = { ...Q, common: { ...Q.common, issues: [] }, parent: null }, z = H._parseSync({ data: Q.data, path: Q.path, parent: B });
            if (z.status === "valid") return z;
            else if (z.status === "dirty" && !W) W = { result: z, ctx: B };
            if (B.common.issues.length) J.push(B.common.issues);
          }
          if (W) return Q.common.issues.push(...W.ctx.common.issues), W.result;
          let G = J.map((H) => new h0(H));
          return b(Q, { code: w.invalid_union, unionErrors: G }), g;
        }
      }
      get options() {
        return this._def.options;
      }
    };
    zX.create = (X, Q) => {
      return new zX({ options: X, typeName: j.ZodUnion, ...l(Q) });
    };
    D1 = (X) => {
      if (X instanceof UX) return D1(X.schema);
      else if (X instanceof G1) return D1(X.innerType());
      else if (X instanceof VX) return [X.value];
      else if (X instanceof s1) return X.options;
      else if (X instanceof LX) return n.objectValues(X.enum);
      else if (X instanceof qX) return D1(X._def.innerType);
      else if (X instanceof HX) return [void 0];
      else if (X instanceof BX) return [null];
      else if (X instanceof J1) return [void 0, ...D1(X.unwrap())];
      else if (X instanceof _1) return [null, ...D1(X.unwrap())];
      else if (X instanceof D9) return D1(X.unwrap());
      else if (X instanceof NX) return D1(X.unwrap());
      else if (X instanceof FX) return D1(X._def.innerType);
      else return [];
    };
    O9 = class _O9 extends d {
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X);
        if (Q.parsedType !== I.object) return b(Q, { code: w.invalid_type, expected: I.object, received: Q.parsedType }), g;
        let $ = this.discriminator, Y = Q.data[$], W = this.optionsMap.get(Y);
        if (!W) return b(Q, { code: w.invalid_union_discriminator, options: Array.from(this.optionsMap.keys()), path: [$] }), g;
        if (Q.common.async) return W._parseAsync({ data: Q.data, path: Q.path, parent: Q });
        else return W._parseSync({ data: Q.data, path: Q.path, parent: Q });
      }
      get discriminator() {
        return this._def.discriminator;
      }
      get options() {
        return this._def.options;
      }
      get optionsMap() {
        return this._def.optionsMap;
      }
      static create(X, Q, $) {
        let Y = /* @__PURE__ */ new Map();
        for (let W of Q) {
          let J = D1(W.shape[X]);
          if (!J.length) throw Error(`A discriminator value for key \`${X}\` could not be extracted from all schema options`);
          for (let G of J) {
            if (Y.has(G)) throw Error(`Discriminator property ${String(X)} has duplicate value ${String(G)}`);
            Y.set(G, W);
          }
        }
        return new _O9({ typeName: j.ZodDiscriminatedUnion, discriminator: X, options: Q, optionsMap: Y, ...l($) });
      }
    };
    KX = class extends d {
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X), Y = (W, J) => {
          if (L9(W) || L9(J)) return g;
          let G = N9(W.value, J.value);
          if (!G.valid) return b($, { code: w.invalid_intersection_types }), g;
          if (q9(W) || q9(J)) Q.dirty();
          return { status: Q.value, value: G.data };
        };
        if ($.common.async) return Promise.all([this._def.left._parseAsync({ data: $.data, path: $.path, parent: $ }), this._def.right._parseAsync({ data: $.data, path: $.path, parent: $ })]).then(([W, J]) => Y(W, J));
        else return Y(this._def.left._parseSync({ data: $.data, path: $.path, parent: $ }), this._def.right._parseSync({ data: $.data, path: $.path, parent: $ }));
      }
    };
    KX.create = (X, Q, $) => {
      return new KX({ left: X, right: Q, typeName: j.ZodIntersection, ...l($) });
    };
    M1 = class _M1 extends d {
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X);
        if ($.parsedType !== I.array) return b($, { code: w.invalid_type, expected: I.array, received: $.parsedType }), g;
        if ($.data.length < this._def.items.length) return b($, { code: w.too_small, minimum: this._def.items.length, inclusive: true, exact: false, type: "array" }), g;
        if (!this._def.rest && $.data.length > this._def.items.length) b($, { code: w.too_big, maximum: this._def.items.length, inclusive: true, exact: false, type: "array" }), Q.dirty();
        let W = [...$.data].map((J, G) => {
          let H = this._def.items[G] || this._def.rest;
          if (!H) return null;
          return H._parse(new r0($, J, $.path, G));
        }).filter((J) => !!J);
        if ($.common.async) return Promise.all(W).then((J) => {
          return b0.mergeArray(Q, J);
        });
        else return b0.mergeArray(Q, W);
      }
      get items() {
        return this._def.items;
      }
      rest(X) {
        return new _M1({ ...this._def, rest: X });
      }
    };
    M1.create = (X, Q) => {
      if (!Array.isArray(X)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
      return new M1({ items: X, typeName: j.ZodTuple, rest: null, ...l(Q) });
    };
    M4 = class _M4 extends d {
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X);
        if ($.parsedType !== I.object) return b($, { code: w.invalid_type, expected: I.object, received: $.parsedType }), g;
        let Y = [], W = this._def.keyType, J = this._def.valueType;
        for (let G in $.data) Y.push({ key: W._parse(new r0($, G, $.path, G)), value: J._parse(new r0($, $.data[G], $.path, G)), alwaysSet: G in $.data });
        if ($.common.async) return b0.mergeObjectAsync(Q, Y);
        else return b0.mergeObjectSync(Q, Y);
      }
      get element() {
        return this._def.valueType;
      }
      static create(X, Q, $) {
        if (Q instanceof d) return new _M4({ keyType: X, valueType: Q, typeName: j.ZodRecord, ...l($) });
        return new _M4({ keyType: A1.create(), valueType: X, typeName: j.ZodRecord, ...l(Q) });
      }
    };
    j4 = class extends d {
      get keySchema() {
        return this._def.keyType;
      }
      get valueSchema() {
        return this._def.valueType;
      }
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X);
        if ($.parsedType !== I.map) return b($, { code: w.invalid_type, expected: I.map, received: $.parsedType }), g;
        let Y = this._def.keyType, W = this._def.valueType, J = [...$.data.entries()].map(([G, H], B) => {
          return { key: Y._parse(new r0($, G, $.path, [B, "key"])), value: W._parse(new r0($, H, $.path, [B, "value"])) };
        });
        if ($.common.async) {
          let G = /* @__PURE__ */ new Map();
          return Promise.resolve().then(async () => {
            for (let H of J) {
              let B = await H.key, z = await H.value;
              if (B.status === "aborted" || z.status === "aborted") return g;
              if (B.status === "dirty" || z.status === "dirty") Q.dirty();
              G.set(B.value, z.value);
            }
            return { status: Q.value, value: G };
          });
        } else {
          let G = /* @__PURE__ */ new Map();
          for (let H of J) {
            let { key: B, value: z } = H;
            if (B.status === "aborted" || z.status === "aborted") return g;
            if (B.status === "dirty" || z.status === "dirty") Q.dirty();
            G.set(B.value, z.value);
          }
          return { status: Q.value, value: G };
        }
      }
    };
    j4.create = (X, Q, $) => {
      return new j4({ valueType: Q, keyType: X, typeName: j.ZodMap, ...l($) });
    };
    b6 = class _b6 extends d {
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X);
        if ($.parsedType !== I.set) return b($, { code: w.invalid_type, expected: I.set, received: $.parsedType }), g;
        let Y = this._def;
        if (Y.minSize !== null) {
          if ($.data.size < Y.minSize.value) b($, { code: w.too_small, minimum: Y.minSize.value, type: "set", inclusive: true, exact: false, message: Y.minSize.message }), Q.dirty();
        }
        if (Y.maxSize !== null) {
          if ($.data.size > Y.maxSize.value) b($, { code: w.too_big, maximum: Y.maxSize.value, type: "set", inclusive: true, exact: false, message: Y.maxSize.message }), Q.dirty();
        }
        let W = this._def.valueType;
        function J(H) {
          let B = /* @__PURE__ */ new Set();
          for (let z of H) {
            if (z.status === "aborted") return g;
            if (z.status === "dirty") Q.dirty();
            B.add(z.value);
          }
          return { status: Q.value, value: B };
        }
        let G = [...$.data.values()].map((H, B) => W._parse(new r0($, H, $.path, B)));
        if ($.common.async) return Promise.all(G).then((H) => J(H));
        else return J(G);
      }
      min(X, Q) {
        return new _b6({ ...this._def, minSize: { value: X, message: Z.toString(Q) } });
      }
      max(X, Q) {
        return new _b6({ ...this._def, maxSize: { value: X, message: Z.toString(Q) } });
      }
      size(X, Q) {
        return this.min(X, Q).max(X, Q);
      }
      nonempty(X) {
        return this.min(1, X);
      }
    };
    b6.create = (X, Q) => {
      return new b6({ valueType: X, minSize: null, maxSize: null, typeName: j.ZodSet, ...l(Q) });
    };
    JX = class _JX extends d {
      constructor() {
        super(...arguments);
        this.validate = this.implement;
      }
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X);
        if (Q.parsedType !== I.function) return b(Q, { code: w.invalid_type, expected: I.function, received: Q.parsedType }), g;
        function $(G, H) {
          return N4({ data: G, path: Q.path, errorMaps: [Q.common.contextualErrorMap, Q.schemaErrorMap, YX(), T1].filter((B) => !!B), issueData: { code: w.invalid_arguments, argumentsError: H } });
        }
        function Y(G, H) {
          return N4({ data: G, path: Q.path, errorMaps: [Q.common.contextualErrorMap, Q.schemaErrorMap, YX(), T1].filter((B) => !!B), issueData: { code: w.invalid_return_type, returnTypeError: H } });
        }
        let W = { errorMap: Q.common.contextualErrorMap }, J = Q.data;
        if (this._def.returns instanceof P6) {
          let G = this;
          return C0(async function(...H) {
            let B = new h0([]), z = await G._def.args.parseAsync(H, W).catch((L) => {
              throw B.addIssue($(H, L)), B;
            }), K = await Reflect.apply(J, this, z);
            return await G._def.returns._def.type.parseAsync(K, W).catch((L) => {
              throw B.addIssue(Y(K, L)), B;
            });
          });
        } else {
          let G = this;
          return C0(function(...H) {
            let B = G._def.args.safeParse(H, W);
            if (!B.success) throw new h0([$(H, B.error)]);
            let z = Reflect.apply(J, this, B.data), K = G._def.returns.safeParse(z, W);
            if (!K.success) throw new h0([Y(z, K.error)]);
            return K.data;
          });
        }
      }
      parameters() {
        return this._def.args;
      }
      returnType() {
        return this._def.returns;
      }
      args(...X) {
        return new _JX({ ...this._def, args: M1.create(X).rest(a1.create()) });
      }
      returns(X) {
        return new _JX({ ...this._def, returns: X });
      }
      implement(X) {
        return this.parse(X);
      }
      strictImplement(X) {
        return this.parse(X);
      }
      static create(X, Q, $) {
        return new _JX({ args: X ? X : M1.create([]).rest(a1.create()), returns: Q || a1.create(), typeName: j.ZodFunction, ...l($) });
      }
    };
    UX = class extends d {
      get schema() {
        return this._def.getter();
      }
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X);
        return this._def.getter()._parse({ data: Q.data, path: Q.path, parent: Q });
      }
    };
    UX.create = (X, Q) => {
      return new UX({ getter: X, typeName: j.ZodLazy, ...l(Q) });
    };
    VX = class extends d {
      _parse(X) {
        if (X.data !== this._def.value) {
          let Q = this._getOrReturnCtx(X);
          return b(Q, { received: Q.data, code: w.invalid_literal, expected: this._def.value }), g;
        }
        return { status: "valid", value: X.data };
      }
      get value() {
        return this._def.value;
      }
    };
    VX.create = (X, Q) => {
      return new VX({ value: X, typeName: j.ZodLiteral, ...l(Q) });
    };
    s1 = class _s1 extends d {
      _parse(X) {
        if (typeof X.data !== "string") {
          let Q = this._getOrReturnCtx(X), $ = this._def.values;
          return b(Q, { expected: n.joinValues($), received: Q.parsedType, code: w.invalid_type }), g;
        }
        if (!this._cache) this._cache = new Set(this._def.values);
        if (!this._cache.has(X.data)) {
          let Q = this._getOrReturnCtx(X), $ = this._def.values;
          return b(Q, { received: Q.data, code: w.invalid_enum_value, options: $ }), g;
        }
        return C0(X.data);
      }
      get options() {
        return this._def.values;
      }
      get enum() {
        let X = {};
        for (let Q of this._def.values) X[Q] = Q;
        return X;
      }
      get Values() {
        let X = {};
        for (let Q of this._def.values) X[Q] = Q;
        return X;
      }
      get Enum() {
        let X = {};
        for (let Q of this._def.values) X[Q] = Q;
        return X;
      }
      extract(X, Q = this._def) {
        return _s1.create(X, { ...this._def, ...Q });
      }
      exclude(X, Q = this._def) {
        return _s1.create(this.options.filter(($) => !X.includes($)), { ...this._def, ...Q });
      }
    };
    s1.create = NW;
    LX = class extends d {
      _parse(X) {
        let Q = n.getValidEnumValues(this._def.values), $ = this._getOrReturnCtx(X);
        if ($.parsedType !== I.string && $.parsedType !== I.number) {
          let Y = n.objectValues(Q);
          return b($, { expected: n.joinValues(Y), received: $.parsedType, code: w.invalid_type }), g;
        }
        if (!this._cache) this._cache = new Set(n.getValidEnumValues(this._def.values));
        if (!this._cache.has(X.data)) {
          let Y = n.objectValues(Q);
          return b($, { received: $.data, code: w.invalid_enum_value, options: Y }), g;
        }
        return C0(X.data);
      }
      get enum() {
        return this._def.values;
      }
    };
    LX.create = (X, Q) => {
      return new LX({ values: X, typeName: j.ZodNativeEnum, ...l(Q) });
    };
    P6 = class extends d {
      unwrap() {
        return this._def.type;
      }
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X);
        if (Q.parsedType !== I.promise && Q.common.async === false) return b(Q, { code: w.invalid_type, expected: I.promise, received: Q.parsedType }), g;
        let $ = Q.parsedType === I.promise ? Q.data : Promise.resolve(Q.data);
        return C0($.then((Y) => {
          return this._def.type.parseAsync(Y, { path: Q.path, errorMap: Q.common.contextualErrorMap });
        }));
      }
    };
    P6.create = (X, Q) => {
      return new P6({ type: X, typeName: j.ZodPromise, ...l(Q) });
    };
    G1 = class extends d {
      innerType() {
        return this._def.schema;
      }
      sourceType() {
        return this._def.schema._def.typeName === j.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
      }
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X), Y = this._def.effect || null, W = { addIssue: (J) => {
          if (b($, J), J.fatal) Q.abort();
          else Q.dirty();
        }, get path() {
          return $.path;
        } };
        if (W.addIssue = W.addIssue.bind(W), Y.type === "preprocess") {
          let J = Y.transform($.data, W);
          if ($.common.async) return Promise.resolve(J).then(async (G) => {
            if (Q.value === "aborted") return g;
            let H = await this._def.schema._parseAsync({ data: G, path: $.path, parent: $ });
            if (H.status === "aborted") return g;
            if (H.status === "dirty") return j6(H.value);
            if (Q.value === "dirty") return j6(H.value);
            return H;
          });
          else {
            if (Q.value === "aborted") return g;
            let G = this._def.schema._parseSync({ data: J, path: $.path, parent: $ });
            if (G.status === "aborted") return g;
            if (G.status === "dirty") return j6(G.value);
            if (Q.value === "dirty") return j6(G.value);
            return G;
          }
        }
        if (Y.type === "refinement") {
          let J = (G) => {
            let H = Y.refinement(G, W);
            if ($.common.async) return Promise.resolve(H);
            if (H instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
            return G;
          };
          if ($.common.async === false) {
            let G = this._def.schema._parseSync({ data: $.data, path: $.path, parent: $ });
            if (G.status === "aborted") return g;
            if (G.status === "dirty") Q.dirty();
            return J(G.value), { status: Q.value, value: G.value };
          } else return this._def.schema._parseAsync({ data: $.data, path: $.path, parent: $ }).then((G) => {
            if (G.status === "aborted") return g;
            if (G.status === "dirty") Q.dirty();
            return J(G.value).then(() => {
              return { status: Q.value, value: G.value };
            });
          });
        }
        if (Y.type === "transform") if ($.common.async === false) {
          let J = this._def.schema._parseSync({ data: $.data, path: $.path, parent: $ });
          if (!t1(J)) return g;
          let G = Y.transform(J.value, W);
          if (G instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
          return { status: Q.value, value: G };
        } else return this._def.schema._parseAsync({ data: $.data, path: $.path, parent: $ }).then((J) => {
          if (!t1(J)) return g;
          return Promise.resolve(Y.transform(J.value, W)).then((G) => ({ status: Q.value, value: G }));
        });
        n.assertNever(Y);
      }
    };
    G1.create = (X, Q, $) => {
      return new G1({ schema: X, typeName: j.ZodEffects, effect: Q, ...l($) });
    };
    G1.createWithPreprocess = (X, Q, $) => {
      return new G1({ schema: Q, effect: { type: "preprocess", transform: X }, typeName: j.ZodEffects, ...l($) });
    };
    J1 = class extends d {
      _parse(X) {
        if (this._getType(X) === I.undefined) return C0(void 0);
        return this._def.innerType._parse(X);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    J1.create = (X, Q) => {
      return new J1({ innerType: X, typeName: j.ZodOptional, ...l(Q) });
    };
    _1 = class extends d {
      _parse(X) {
        if (this._getType(X) === I.null) return C0(null);
        return this._def.innerType._parse(X);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    _1.create = (X, Q) => {
      return new _1({ innerType: X, typeName: j.ZodNullable, ...l(Q) });
    };
    qX = class extends d {
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X), $ = Q.data;
        if (Q.parsedType === I.undefined) $ = this._def.defaultValue();
        return this._def.innerType._parse({ data: $, path: Q.path, parent: Q });
      }
      removeDefault() {
        return this._def.innerType;
      }
    };
    qX.create = (X, Q) => {
      return new qX({ innerType: X, typeName: j.ZodDefault, defaultValue: typeof Q.default === "function" ? Q.default : () => Q.default, ...l(Q) });
    };
    FX = class extends d {
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X), $ = { ...Q, common: { ...Q.common, issues: [] } }, Y = this._def.innerType._parse({ data: $.data, path: $.path, parent: { ...$ } });
        if (WX(Y)) return Y.then((W) => {
          return { status: "valid", value: W.status === "valid" ? W.value : this._def.catchValue({ get error() {
            return new h0($.common.issues);
          }, input: $.data }) };
        });
        else return { status: "valid", value: Y.status === "valid" ? Y.value : this._def.catchValue({ get error() {
          return new h0($.common.issues);
        }, input: $.data }) };
      }
      removeCatch() {
        return this._def.innerType;
      }
    };
    FX.create = (X, Q) => {
      return new FX({ innerType: X, typeName: j.ZodCatch, catchValue: typeof Q.catch === "function" ? Q.catch : () => Q.catch, ...l(Q) });
    };
    R4 = class extends d {
      _parse(X) {
        if (this._getType(X) !== I.nan) {
          let $ = this._getOrReturnCtx(X);
          return b($, { code: w.invalid_type, expected: I.nan, received: $.parsedType }), g;
        }
        return { status: "valid", value: X.data };
      }
    };
    R4.create = (X) => {
      return new R4({ typeName: j.ZodNaN, ...l(X) });
    };
    w2 = Symbol("zod_brand");
    D9 = class extends d {
      _parse(X) {
        let { ctx: Q } = this._processInputParams(X), $ = Q.data;
        return this._def.type._parse({ data: $, path: Q.path, parent: Q });
      }
      unwrap() {
        return this._def.type;
      }
    };
    I4 = class _I4 extends d {
      _parse(X) {
        let { status: Q, ctx: $ } = this._processInputParams(X);
        if ($.common.async) return (async () => {
          let W = await this._def.in._parseAsync({ data: $.data, path: $.path, parent: $ });
          if (W.status === "aborted") return g;
          if (W.status === "dirty") return Q.dirty(), j6(W.value);
          else return this._def.out._parseAsync({ data: W.value, path: $.path, parent: $ });
        })();
        else {
          let Y = this._def.in._parseSync({ data: $.data, path: $.path, parent: $ });
          if (Y.status === "aborted") return g;
          if (Y.status === "dirty") return Q.dirty(), { status: "dirty", value: Y.value };
          else return this._def.out._parseSync({ data: Y.value, path: $.path, parent: $ });
        }
      }
      static create(X, Q) {
        return new _I4({ in: X, out: Q, typeName: j.ZodPipeline });
      }
    };
    NX = class extends d {
      _parse(X) {
        let Q = this._def.innerType._parse(X), $ = (Y) => {
          if (t1(Y)) Y.value = Object.freeze(Y.value);
          return Y;
        };
        return WX(Q) ? Q.then((Y) => $(Y)) : $(Q);
      }
      unwrap() {
        return this._def.innerType;
      }
    };
    NX.create = (X, Q) => {
      return new NX({ innerType: X, typeName: j.ZodReadonly, ...l(Q) });
    };
    M2 = { object: V0.lazycreate };
    (function(X) {
      X.ZodString = "ZodString", X.ZodNumber = "ZodNumber", X.ZodNaN = "ZodNaN", X.ZodBigInt = "ZodBigInt", X.ZodBoolean = "ZodBoolean", X.ZodDate = "ZodDate", X.ZodSymbol = "ZodSymbol", X.ZodUndefined = "ZodUndefined", X.ZodNull = "ZodNull", X.ZodAny = "ZodAny", X.ZodUnknown = "ZodUnknown", X.ZodNever = "ZodNever", X.ZodVoid = "ZodVoid", X.ZodArray = "ZodArray", X.ZodObject = "ZodObject", X.ZodUnion = "ZodUnion", X.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", X.ZodIntersection = "ZodIntersection", X.ZodTuple = "ZodTuple", X.ZodRecord = "ZodRecord", X.ZodMap = "ZodMap", X.ZodSet = "ZodSet", X.ZodFunction = "ZodFunction", X.ZodLazy = "ZodLazy", X.ZodLiteral = "ZodLiteral", X.ZodEnum = "ZodEnum", X.ZodEffects = "ZodEffects", X.ZodNativeEnum = "ZodNativeEnum", X.ZodOptional = "ZodOptional", X.ZodNullable = "ZodNullable", X.ZodDefault = "ZodDefault", X.ZodCatch = "ZodCatch", X.ZodPromise = "ZodPromise", X.ZodBranded = "ZodBranded", X.ZodPipeline = "ZodPipeline", X.ZodReadonly = "ZodReadonly";
    })(j || (j = {}));
    j2 = A1.create;
    R2 = I6.create;
    I2 = R4.create;
    E2 = E6.create;
    b2 = O4.create;
    P2 = GX.create;
    S2 = D4.create;
    Z2 = HX.create;
    C2 = BX.create;
    k2 = A4.create;
    v2 = a1.create;
    T2 = w1.create;
    _2 = w4.create;
    x2 = W1.create;
    OW = V0.create;
    y2 = V0.strictCreate;
    g2 = zX.create;
    f2 = O9.create;
    h2 = KX.create;
    u2 = M1.create;
    l2 = M4.create;
    m2 = j4.create;
    c2 = b6.create;
    p2 = JX.create;
    d2 = UX.create;
    i2 = VX.create;
    n2 = s1.create;
    r2 = LX.create;
    o2 = P6.create;
    t2 = G1.create;
    a2 = J1.create;
    s2 = _1.create;
    e2 = G1.createWithPreprocess;
    XS = I4.create;
    SV = Object.freeze({ status: "aborted" });
    ZV = Symbol("zod_brand");
    x1 = class extends Error {
      constructor() {
        super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
      }
    };
    E4 = {};
    i = {};
    U7(i, { unwrapMessage: () => OX, stringifyPrimitive: () => S4, required: () => iV, randomString: () => gV, propertyKeyTypes: () => I9, promiseAllObject: () => yV, primitiveTypes: () => DW, prefixIssues: () => H1, pick: () => lV, partial: () => dV, optionalKeys: () => E9, omit: () => mV, numKeys: () => fV, nullish: () => wX, normalizeParams: () => y, merge: () => pV, jsonStringifyReplacer: () => w9, joinValues: () => b4, issue: () => P9, isPlainObject: () => Z6, isObject: () => S6, getSizableOrigin: () => wW, getParsedType: () => hV, getLengthableOrigin: () => jX, getEnumValues: () => DX, getElementAtPath: () => xV, floatSafeRemainder: () => M9, finalizeIssue: () => o0, extend: () => cV, escapeRegex: () => y1, esc: () => e1, defineLazy: () => Y0, createTransparentProxy: () => uV, clone: () => l0, cleanRegex: () => MX, cleanEnum: () => nV, captureStackTrace: () => P4, cached: () => AX, assignProp: () => j9, assertNotEqual: () => kV, assertNever: () => TV, assertIs: () => vV, assertEqual: () => CV, assert: () => _V, allowsEval: () => R9, aborted: () => X6, NUMBER_FORMAT_RANGES: () => b9, Class: () => MW, BIGINT_FORMAT_RANGES: () => AW });
    P4 = Error.captureStackTrace ? Error.captureStackTrace : (...X) => {
    };
    R9 = AX(() => {
      if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return false;
      try {
        return new Function(""), true;
      } catch (X) {
        return false;
      }
    });
    hV = (X) => {
      let Q = typeof X;
      switch (Q) {
        case "undefined":
          return "undefined";
        case "string":
          return "string";
        case "number":
          return Number.isNaN(X) ? "nan" : "number";
        case "boolean":
          return "boolean";
        case "function":
          return "function";
        case "bigint":
          return "bigint";
        case "symbol":
          return "symbol";
        case "object":
          if (Array.isArray(X)) return "array";
          if (X === null) return "null";
          if (X.then && typeof X.then === "function" && X.catch && typeof X.catch === "function") return "promise";
          if (typeof Map < "u" && X instanceof Map) return "map";
          if (typeof Set < "u" && X instanceof Set) return "set";
          if (typeof Date < "u" && X instanceof Date) return "date";
          if (typeof File < "u" && X instanceof File) return "file";
          return "object";
        default:
          throw Error(`Unknown data type: ${Q}`);
      }
    };
    I9 = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
    DW = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
    b9 = { safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], int32: [-2147483648, 2147483647], uint32: [0, 4294967295], float32: [-34028234663852886e22, 34028234663852886e22], float64: [-Number.MAX_VALUE, Number.MAX_VALUE] };
    AW = { int64: [BigInt("-9223372036854775808"), BigInt("9223372036854775807")], uint64: [BigInt(0), BigInt("18446744073709551615")] };
    MW = class {
      constructor(...X) {
      }
    };
    jW = (X, Q) => {
      X.name = "$ZodError", Object.defineProperty(X, "_zod", { value: X._zod, enumerable: false }), Object.defineProperty(X, "issues", { value: Q, enumerable: false }), Object.defineProperty(X, "message", { get() {
        return JSON.stringify(Q, w9, 2);
      }, enumerable: true });
    };
    Z4 = O("$ZodError", jW);
    RX = O("$ZodError", jW, { Parent: Error });
    C9 = (X) => (Q, $, Y, W) => {
      let J = Y ? Object.assign(Y, { async: false }) : { async: false }, G = Q._zod.run({ value: $, issues: [] }, J);
      if (G instanceof Promise) throw new x1();
      if (G.issues.length) {
        let H = new (W?.Err ?? X)(G.issues.map((B) => o0(B, J, u0())));
        throw P4(H, W?.callee), H;
      }
      return G.value;
    };
    k9 = C9(RX);
    v9 = (X) => async (Q, $, Y, W) => {
      let J = Y ? Object.assign(Y, { async: true }) : { async: true }, G = Q._zod.run({ value: $, issues: [] }, J);
      if (G instanceof Promise) G = await G;
      if (G.issues.length) {
        let H = new (W?.Err ?? X)(G.issues.map((B) => o0(B, J, u0())));
        throw P4(H, W?.callee), H;
      }
      return G.value;
    };
    T9 = v9(RX);
    _9 = (X) => (Q, $, Y) => {
      let W = Y ? { ...Y, async: false } : { async: false }, J = Q._zod.run({ value: $, issues: [] }, W);
      if (J instanceof Promise) throw new x1();
      return J.issues.length ? { success: false, error: new (X ?? Z4)(J.issues.map((G) => o0(G, W, u0()))) } : { success: true, data: J.value };
    };
    Q6 = _9(RX);
    x9 = (X) => async (Q, $, Y) => {
      let W = Y ? Object.assign(Y, { async: true }) : { async: true }, J = Q._zod.run({ value: $, issues: [] }, W);
      if (J instanceof Promise) J = await J;
      return J.issues.length ? { success: false, error: new X(J.issues.map((G) => o0(G, W, u0()))) } : { success: true, data: J.value };
    };
    $6 = x9(RX);
    RW = /^[cC][^\s-]{8,}$/;
    IW = /^[0-9a-z]+$/;
    EW = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
    bW = /^[0-9a-vA-V]{20}$/;
    PW = /^[A-Za-z0-9]{27}$/;
    SW = /^[a-zA-Z0-9_-]{21}$/;
    ZW = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
    CW = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
    y9 = (X) => {
      if (!X) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
      return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${X}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
    };
    kW = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
    TW = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
    _W = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
    xW = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
    yW = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
    gW = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
    g9 = /^[A-Za-z0-9_-]*$/;
    fW = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
    hW = /^\+(?:[0-9]){6,14}[0-9]$/;
    uW = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
    lW = new RegExp(`^${uW}$`);
    dW = (X) => {
      let Q = X ? `[\\s\\S]{${X?.minimum ?? 0},${X?.maximum ?? ""}}` : "[\\s\\S]*";
      return new RegExp(`^${Q}$`);
    };
    iW = /^\d+$/;
    nW = /^-?\d+(?:\.\d+)?/i;
    rW = /true|false/i;
    oW = /null/i;
    tW = /^[^A-Z]*$/;
    aW = /^[^a-z]*$/;
    w0 = O("$ZodCheck", (X, Q) => {
      var $;
      X._zod ?? (X._zod = {}), X._zod.def = Q, ($ = X._zod).onattach ?? ($.onattach = []);
    });
    sW = { number: "number", bigint: "bigint", object: "date" };
    f9 = O("$ZodCheckLessThan", (X, Q) => {
      w0.init(X, Q);
      let $ = sW[typeof Q.value];
      X._zod.onattach.push((Y) => {
        let W = Y._zod.bag, J = (Q.inclusive ? W.maximum : W.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
        if (Q.value < J) if (Q.inclusive) W.maximum = Q.value;
        else W.exclusiveMaximum = Q.value;
      }), X._zod.check = (Y) => {
        if (Q.inclusive ? Y.value <= Q.value : Y.value < Q.value) return;
        Y.issues.push({ origin: $, code: "too_big", maximum: Q.value, input: Y.value, inclusive: Q.inclusive, inst: X, continue: !Q.abort });
      };
    });
    h9 = O("$ZodCheckGreaterThan", (X, Q) => {
      w0.init(X, Q);
      let $ = sW[typeof Q.value];
      X._zod.onattach.push((Y) => {
        let W = Y._zod.bag, J = (Q.inclusive ? W.minimum : W.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
        if (Q.value > J) if (Q.inclusive) W.minimum = Q.value;
        else W.exclusiveMinimum = Q.value;
      }), X._zod.check = (Y) => {
        if (Q.inclusive ? Y.value >= Q.value : Y.value > Q.value) return;
        Y.issues.push({ origin: $, code: "too_small", minimum: Q.value, input: Y.value, inclusive: Q.inclusive, inst: X, continue: !Q.abort });
      };
    });
    eW = O("$ZodCheckMultipleOf", (X, Q) => {
      w0.init(X, Q), X._zod.onattach.push(($) => {
        var Y;
        (Y = $._zod.bag).multipleOf ?? (Y.multipleOf = Q.value);
      }), X._zod.check = ($) => {
        if (typeof $.value !== typeof Q.value) throw Error("Cannot mix number and bigint in multiple_of check.");
        if (typeof $.value === "bigint" ? $.value % Q.value === BigInt(0) : M9($.value, Q.value) === 0) return;
        $.issues.push({ origin: typeof $.value, code: "not_multiple_of", divisor: Q.value, input: $.value, inst: X, continue: !Q.abort });
      };
    });
    XJ = O("$ZodCheckNumberFormat", (X, Q) => {
      w0.init(X, Q), Q.format = Q.format || "float64";
      let $ = Q.format?.includes("int"), Y = $ ? "int" : "number", [W, J] = b9[Q.format];
      X._zod.onattach.push((G) => {
        let H = G._zod.bag;
        if (H.format = Q.format, H.minimum = W, H.maximum = J, $) H.pattern = iW;
      }), X._zod.check = (G) => {
        let H = G.value;
        if ($) {
          if (!Number.isInteger(H)) {
            G.issues.push({ expected: Y, format: Q.format, code: "invalid_type", input: H, inst: X });
            return;
          }
          if (!Number.isSafeInteger(H)) {
            if (H > 0) G.issues.push({ input: H, code: "too_big", maximum: Number.MAX_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst: X, origin: Y, continue: !Q.abort });
            else G.issues.push({ input: H, code: "too_small", minimum: Number.MIN_SAFE_INTEGER, note: "Integers must be within the safe integer range.", inst: X, origin: Y, continue: !Q.abort });
            return;
          }
        }
        if (H < W) G.issues.push({ origin: "number", input: H, code: "too_small", minimum: W, inclusive: true, inst: X, continue: !Q.abort });
        if (H > J) G.issues.push({ origin: "number", input: H, code: "too_big", maximum: J, inst: X });
      };
    });
    QJ = O("$ZodCheckMaxLength", (X, Q) => {
      w0.init(X, Q), X._zod.when = ($) => {
        let Y = $.value;
        return !wX(Y) && Y.length !== void 0;
      }, X._zod.onattach.push(($) => {
        let Y = $._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
        if (Q.maximum < Y) $._zod.bag.maximum = Q.maximum;
      }), X._zod.check = ($) => {
        let Y = $.value;
        if (Y.length <= Q.maximum) return;
        let J = jX(Y);
        $.issues.push({ origin: J, code: "too_big", maximum: Q.maximum, inclusive: true, input: Y, inst: X, continue: !Q.abort });
      };
    });
    $J = O("$ZodCheckMinLength", (X, Q) => {
      w0.init(X, Q), X._zod.when = ($) => {
        let Y = $.value;
        return !wX(Y) && Y.length !== void 0;
      }, X._zod.onattach.push(($) => {
        let Y = $._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
        if (Q.minimum > Y) $._zod.bag.minimum = Q.minimum;
      }), X._zod.check = ($) => {
        let Y = $.value;
        if (Y.length >= Q.minimum) return;
        let J = jX(Y);
        $.issues.push({ origin: J, code: "too_small", minimum: Q.minimum, inclusive: true, input: Y, inst: X, continue: !Q.abort });
      };
    });
    YJ = O("$ZodCheckLengthEquals", (X, Q) => {
      w0.init(X, Q), X._zod.when = ($) => {
        let Y = $.value;
        return !wX(Y) && Y.length !== void 0;
      }, X._zod.onattach.push(($) => {
        let Y = $._zod.bag;
        Y.minimum = Q.length, Y.maximum = Q.length, Y.length = Q.length;
      }), X._zod.check = ($) => {
        let Y = $.value, W = Y.length;
        if (W === Q.length) return;
        let J = jX(Y), G = W > Q.length;
        $.issues.push({ origin: J, ...G ? { code: "too_big", maximum: Q.length } : { code: "too_small", minimum: Q.length }, inclusive: true, exact: true, input: $.value, inst: X, continue: !Q.abort });
      };
    });
    IX = O("$ZodCheckStringFormat", (X, Q) => {
      var $, Y;
      if (w0.init(X, Q), X._zod.onattach.push((W) => {
        let J = W._zod.bag;
        if (J.format = Q.format, Q.pattern) J.patterns ?? (J.patterns = /* @__PURE__ */ new Set()), J.patterns.add(Q.pattern);
      }), Q.pattern) ($ = X._zod).check ?? ($.check = (W) => {
        if (Q.pattern.lastIndex = 0, Q.pattern.test(W.value)) return;
        W.issues.push({ origin: "string", code: "invalid_format", format: Q.format, input: W.value, ...Q.pattern ? { pattern: Q.pattern.toString() } : {}, inst: X, continue: !Q.abort });
      });
      else (Y = X._zod).check ?? (Y.check = () => {
      });
    });
    WJ = O("$ZodCheckRegex", (X, Q) => {
      IX.init(X, Q), X._zod.check = ($) => {
        if (Q.pattern.lastIndex = 0, Q.pattern.test($.value)) return;
        $.issues.push({ origin: "string", code: "invalid_format", format: "regex", input: $.value, pattern: Q.pattern.toString(), inst: X, continue: !Q.abort });
      };
    });
    JJ = O("$ZodCheckLowerCase", (X, Q) => {
      Q.pattern ?? (Q.pattern = tW), IX.init(X, Q);
    });
    GJ = O("$ZodCheckUpperCase", (X, Q) => {
      Q.pattern ?? (Q.pattern = aW), IX.init(X, Q);
    });
    HJ = O("$ZodCheckIncludes", (X, Q) => {
      w0.init(X, Q);
      let $ = y1(Q.includes), Y = new RegExp(typeof Q.position === "number" ? `^.{${Q.position}}${$}` : $);
      Q.pattern = Y, X._zod.onattach.push((W) => {
        let J = W._zod.bag;
        J.patterns ?? (J.patterns = /* @__PURE__ */ new Set()), J.patterns.add(Y);
      }), X._zod.check = (W) => {
        if (W.value.includes(Q.includes, Q.position)) return;
        W.issues.push({ origin: "string", code: "invalid_format", format: "includes", includes: Q.includes, input: W.value, inst: X, continue: !Q.abort });
      };
    });
    BJ = O("$ZodCheckStartsWith", (X, Q) => {
      w0.init(X, Q);
      let $ = new RegExp(`^${y1(Q.prefix)}.*`);
      Q.pattern ?? (Q.pattern = $), X._zod.onattach.push((Y) => {
        let W = Y._zod.bag;
        W.patterns ?? (W.patterns = /* @__PURE__ */ new Set()), W.patterns.add($);
      }), X._zod.check = (Y) => {
        if (Y.value.startsWith(Q.prefix)) return;
        Y.issues.push({ origin: "string", code: "invalid_format", format: "starts_with", prefix: Q.prefix, input: Y.value, inst: X, continue: !Q.abort });
      };
    });
    zJ = O("$ZodCheckEndsWith", (X, Q) => {
      w0.init(X, Q);
      let $ = new RegExp(`.*${y1(Q.suffix)}$`);
      Q.pattern ?? (Q.pattern = $), X._zod.onattach.push((Y) => {
        let W = Y._zod.bag;
        W.patterns ?? (W.patterns = /* @__PURE__ */ new Set()), W.patterns.add($);
      }), X._zod.check = (Y) => {
        if (Y.value.endsWith(Q.suffix)) return;
        Y.issues.push({ origin: "string", code: "invalid_format", format: "ends_with", suffix: Q.suffix, input: Y.value, inst: X, continue: !Q.abort });
      };
    });
    KJ = O("$ZodCheckOverwrite", (X, Q) => {
      w0.init(X, Q), X._zod.check = ($) => {
        $.value = Q.tx($.value);
      };
    });
    u9 = class {
      constructor(X = []) {
        if (this.content = [], this.indent = 0, this) this.args = X;
      }
      indented(X) {
        this.indent += 1, X(this), this.indent -= 1;
      }
      write(X) {
        if (typeof X === "function") {
          X(this, { execution: "sync" }), X(this, { execution: "async" });
          return;
        }
        let $ = X.split(`
`).filter((J) => J), Y = Math.min(...$.map((J) => J.length - J.trimStart().length)), W = $.map((J) => J.slice(Y)).map((J) => " ".repeat(this.indent * 2) + J);
        for (let J of W) this.content.push(J);
      }
      compile() {
        let X = Function, Q = this?.args, Y = [...(this?.content ?? [""]).map((W) => `  ${W}`)];
        return new X(...Q, Y.join(`
`));
      }
    };
    VJ = { major: 4, minor: 0, patch: 0 };
    X0 = O("$ZodType", (X, Q) => {
      var $;
      X ?? (X = {}), X._zod.def = Q, X._zod.bag = X._zod.bag || {}, X._zod.version = VJ;
      let Y = [...X._zod.def.checks ?? []];
      if (X._zod.traits.has("$ZodCheck")) Y.unshift(X);
      for (let W of Y) for (let J of W._zod.onattach) J(X);
      if (Y.length === 0) ($ = X._zod).deferred ?? ($.deferred = []), X._zod.deferred?.push(() => {
        X._zod.run = X._zod.parse;
      });
      else {
        let W = (J, G, H) => {
          let B = X6(J), z;
          for (let K of G) {
            if (K._zod.when) {
              if (!K._zod.when(J)) continue;
            } else if (B) continue;
            let V = J.issues.length, L = K._zod.check(J);
            if (L instanceof Promise && H?.async === false) throw new x1();
            if (z || L instanceof Promise) z = (z ?? Promise.resolve()).then(async () => {
              if (await L, J.issues.length === V) return;
              if (!B) B = X6(J, V);
            });
            else {
              if (J.issues.length === V) continue;
              if (!B) B = X6(J, V);
            }
          }
          if (z) return z.then(() => {
            return J;
          });
          return J;
        };
        X._zod.run = (J, G) => {
          let H = X._zod.parse(J, G);
          if (H instanceof Promise) {
            if (G.async === false) throw new x1();
            return H.then((B) => W(B, Y, G));
          }
          return W(H, Y, G);
        };
      }
      X["~standard"] = { validate: (W) => {
        try {
          let J = Q6(X, W);
          return J.success ? { value: J.data } : { issues: J.error?.issues };
        } catch (J) {
          return $6(X, W).then((G) => G.success ? { value: G.data } : { issues: G.error?.issues });
        }
      }, vendor: "zod", version: 1 };
    });
    EX = O("$ZodString", (X, Q) => {
      X0.init(X, Q), X._zod.pattern = [...X?._zod.bag?.patterns ?? []].pop() ?? dW(X._zod.bag), X._zod.parse = ($, Y) => {
        if (Q.coerce) try {
          $.value = String($.value);
        } catch (W) {
        }
        if (typeof $.value === "string") return $;
        return $.issues.push({ expected: "string", code: "invalid_type", input: $.value, inst: X }), $;
      };
    });
    W0 = O("$ZodStringFormat", (X, Q) => {
      IX.init(X, Q), EX.init(X, Q);
    });
    m9 = O("$ZodGUID", (X, Q) => {
      Q.pattern ?? (Q.pattern = CW), W0.init(X, Q);
    });
    c9 = O("$ZodUUID", (X, Q) => {
      if (Q.version) {
        let Y = { v1: 1, v2: 2, v3: 3, v4: 4, v5: 5, v6: 6, v7: 7, v8: 8 }[Q.version];
        if (Y === void 0) throw Error(`Invalid UUID version: "${Q.version}"`);
        Q.pattern ?? (Q.pattern = y9(Y));
      } else Q.pattern ?? (Q.pattern = y9());
      W0.init(X, Q);
    });
    p9 = O("$ZodEmail", (X, Q) => {
      Q.pattern ?? (Q.pattern = kW), W0.init(X, Q);
    });
    d9 = O("$ZodURL", (X, Q) => {
      W0.init(X, Q), X._zod.check = ($) => {
        try {
          let Y = $.value, W = new URL(Y), J = W.href;
          if (Q.hostname) {
            if (Q.hostname.lastIndex = 0, !Q.hostname.test(W.hostname)) $.issues.push({ code: "invalid_format", format: "url", note: "Invalid hostname", pattern: fW.source, input: $.value, inst: X, continue: !Q.abort });
          }
          if (Q.protocol) {
            if (Q.protocol.lastIndex = 0, !Q.protocol.test(W.protocol.endsWith(":") ? W.protocol.slice(0, -1) : W.protocol)) $.issues.push({ code: "invalid_format", format: "url", note: "Invalid protocol", pattern: Q.protocol.source, input: $.value, inst: X, continue: !Q.abort });
          }
          if (!Y.endsWith("/") && J.endsWith("/")) $.value = J.slice(0, -1);
          else $.value = J;
          return;
        } catch (Y) {
          $.issues.push({ code: "invalid_format", format: "url", input: $.value, inst: X, continue: !Q.abort });
        }
      };
    });
    i9 = O("$ZodEmoji", (X, Q) => {
      Q.pattern ?? (Q.pattern = vW()), W0.init(X, Q);
    });
    n9 = O("$ZodNanoID", (X, Q) => {
      Q.pattern ?? (Q.pattern = SW), W0.init(X, Q);
    });
    r9 = O("$ZodCUID", (X, Q) => {
      Q.pattern ?? (Q.pattern = RW), W0.init(X, Q);
    });
    o9 = O("$ZodCUID2", (X, Q) => {
      Q.pattern ?? (Q.pattern = IW), W0.init(X, Q);
    });
    t9 = O("$ZodULID", (X, Q) => {
      Q.pattern ?? (Q.pattern = EW), W0.init(X, Q);
    });
    a9 = O("$ZodXID", (X, Q) => {
      Q.pattern ?? (Q.pattern = bW), W0.init(X, Q);
    });
    s9 = O("$ZodKSUID", (X, Q) => {
      Q.pattern ?? (Q.pattern = PW), W0.init(X, Q);
    });
    jJ = O("$ZodISODateTime", (X, Q) => {
      Q.pattern ?? (Q.pattern = pW(Q)), W0.init(X, Q);
    });
    RJ = O("$ZodISODate", (X, Q) => {
      Q.pattern ?? (Q.pattern = lW), W0.init(X, Q);
    });
    IJ = O("$ZodISOTime", (X, Q) => {
      Q.pattern ?? (Q.pattern = cW(Q)), W0.init(X, Q);
    });
    EJ = O("$ZodISODuration", (X, Q) => {
      Q.pattern ?? (Q.pattern = ZW), W0.init(X, Q);
    });
    e9 = O("$ZodIPv4", (X, Q) => {
      Q.pattern ?? (Q.pattern = TW), W0.init(X, Q), X._zod.onattach.push(($) => {
        let Y = $._zod.bag;
        Y.format = "ipv4";
      });
    });
    XQ = O("$ZodIPv6", (X, Q) => {
      Q.pattern ?? (Q.pattern = _W), W0.init(X, Q), X._zod.onattach.push(($) => {
        let Y = $._zod.bag;
        Y.format = "ipv6";
      }), X._zod.check = ($) => {
        try {
          new URL(`http://[${$.value}]`);
        } catch {
          $.issues.push({ code: "invalid_format", format: "ipv6", input: $.value, inst: X, continue: !Q.abort });
        }
      };
    });
    QQ = O("$ZodCIDRv4", (X, Q) => {
      Q.pattern ?? (Q.pattern = xW), W0.init(X, Q);
    });
    $Q = O("$ZodCIDRv6", (X, Q) => {
      Q.pattern ?? (Q.pattern = yW), W0.init(X, Q), X._zod.check = ($) => {
        let [Y, W] = $.value.split("/");
        try {
          if (!W) throw Error();
          let J = Number(W);
          if (`${J}` !== W) throw Error();
          if (J < 0 || J > 128) throw Error();
          new URL(`http://[${Y}]`);
        } catch {
          $.issues.push({ code: "invalid_format", format: "cidrv6", input: $.value, inst: X, continue: !Q.abort });
        }
      };
    });
    YQ = O("$ZodBase64", (X, Q) => {
      Q.pattern ?? (Q.pattern = gW), W0.init(X, Q), X._zod.onattach.push(($) => {
        $._zod.bag.contentEncoding = "base64";
      }), X._zod.check = ($) => {
        if (bJ($.value)) return;
        $.issues.push({ code: "invalid_format", format: "base64", input: $.value, inst: X, continue: !Q.abort });
      };
    });
    WQ = O("$ZodBase64URL", (X, Q) => {
      Q.pattern ?? (Q.pattern = g9), W0.init(X, Q), X._zod.onattach.push(($) => {
        $._zod.bag.contentEncoding = "base64url";
      }), X._zod.check = ($) => {
        if (oV($.value)) return;
        $.issues.push({ code: "invalid_format", format: "base64url", input: $.value, inst: X, continue: !Q.abort });
      };
    });
    JQ = O("$ZodE164", (X, Q) => {
      Q.pattern ?? (Q.pattern = hW), W0.init(X, Q);
    });
    GQ = O("$ZodJWT", (X, Q) => {
      W0.init(X, Q), X._zod.check = ($) => {
        if (tV($.value, Q.alg)) return;
        $.issues.push({ code: "invalid_format", format: "jwt", input: $.value, inst: X, continue: !Q.abort });
      };
    });
    v4 = O("$ZodNumber", (X, Q) => {
      X0.init(X, Q), X._zod.pattern = X._zod.bag.pattern ?? nW, X._zod.parse = ($, Y) => {
        if (Q.coerce) try {
          $.value = Number($.value);
        } catch (G) {
        }
        let W = $.value;
        if (typeof W === "number" && !Number.isNaN(W) && Number.isFinite(W)) return $;
        let J = typeof W === "number" ? Number.isNaN(W) ? "NaN" : !Number.isFinite(W) ? "Infinity" : void 0 : void 0;
        return $.issues.push({ expected: "number", code: "invalid_type", input: W, inst: X, ...J ? { received: J } : {} }), $;
      };
    });
    HQ = O("$ZodNumber", (X, Q) => {
      XJ.init(X, Q), v4.init(X, Q);
    });
    BQ = O("$ZodBoolean", (X, Q) => {
      X0.init(X, Q), X._zod.pattern = rW, X._zod.parse = ($, Y) => {
        if (Q.coerce) try {
          $.value = Boolean($.value);
        } catch (J) {
        }
        let W = $.value;
        if (typeof W === "boolean") return $;
        return $.issues.push({ expected: "boolean", code: "invalid_type", input: W, inst: X }), $;
      };
    });
    zQ = O("$ZodNull", (X, Q) => {
      X0.init(X, Q), X._zod.pattern = oW, X._zod.values = /* @__PURE__ */ new Set([null]), X._zod.parse = ($, Y) => {
        let W = $.value;
        if (W === null) return $;
        return $.issues.push({ expected: "null", code: "invalid_type", input: W, inst: X }), $;
      };
    });
    KQ = O("$ZodUnknown", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($) => $;
    });
    UQ = O("$ZodNever", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($, Y) => {
        return $.issues.push({ expected: "never", code: "invalid_type", input: $.value, inst: X }), $;
      };
    });
    VQ = O("$ZodArray", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($, Y) => {
        let W = $.value;
        if (!Array.isArray(W)) return $.issues.push({ expected: "array", code: "invalid_type", input: W, inst: X }), $;
        $.value = Array(W.length);
        let J = [];
        for (let G = 0; G < W.length; G++) {
          let H = W[G], B = Q.element._zod.run({ value: H, issues: [] }, Y);
          if (B instanceof Promise) J.push(B.then((z) => LJ(z, $, G)));
          else LJ(B, $, G);
        }
        if (J.length) return Promise.all(J).then(() => $);
        return $;
      };
    });
    T4 = O("$ZodObject", (X, Q) => {
      X0.init(X, Q);
      let $ = AX(() => {
        let V = Object.keys(Q.shape);
        for (let U of V) if (!(Q.shape[U] instanceof X0)) throw Error(`Invalid element at key "${U}": expected a Zod schema`);
        let L = E9(Q.shape);
        return { shape: Q.shape, keys: V, keySet: new Set(V), numKeys: V.length, optionalKeys: new Set(L) };
      });
      Y0(X._zod, "propValues", () => {
        let V = Q.shape, L = {};
        for (let U in V) {
          let F = V[U]._zod;
          if (F.values) {
            L[U] ?? (L[U] = /* @__PURE__ */ new Set());
            for (let q of F.values) L[U].add(q);
          }
        }
        return L;
      });
      let Y = (V) => {
        let L = new u9(["shape", "payload", "ctx"]), U = $.value, F = (M) => {
          let R = e1(M);
          return `shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`;
        };
        L.write("const input = payload.value;");
        let q = /* @__PURE__ */ Object.create(null), N = 0;
        for (let M of U.keys) q[M] = `key_${N++}`;
        L.write("const newResult = {}");
        for (let M of U.keys) if (U.optionalKeys.has(M)) {
          let R = q[M];
          L.write(`const ${R} = ${F(M)};`);
          let S = e1(M);
          L.write(`
        if (${R}.issues.length) {
          if (input[${S}] === undefined) {
            if (${S} in input) {
              newResult[${S}] = undefined;
            }
          } else {
            payload.issues = payload.issues.concat(
              ${R}.issues.map((iss) => ({
                ...iss,
                path: iss.path ? [${S}, ...iss.path] : [${S}],
              }))
            );
          }
        } else if (${R}.value === undefined) {
          if (${S} in input) newResult[${S}] = undefined;
        } else {
          newResult[${S}] = ${R}.value;
        }
        `);
        } else {
          let R = q[M];
          L.write(`const ${R} = ${F(M)};`), L.write(`
          if (${R}.issues.length) payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${e1(M)}, ...iss.path] : [${e1(M)}]
          })));`), L.write(`newResult[${e1(M)}] = ${R}.value`);
        }
        L.write("payload.value = newResult;"), L.write("return payload;");
        let A = L.compile();
        return (M, R) => A(V, M, R);
      }, W, J = S6, G = !E4.jitless, B = G && R9.value, z = Q.catchall, K;
      X._zod.parse = (V, L) => {
        K ?? (K = $.value);
        let U = V.value;
        if (!J(U)) return V.issues.push({ expected: "object", code: "invalid_type", input: U, inst: X }), V;
        let F = [];
        if (G && B && L?.async === false && L.jitless !== true) {
          if (!W) W = Y(Q.shape);
          V = W(V, L);
        } else {
          V.value = {};
          let R = K.shape;
          for (let S of K.keys) {
            let C = R[S], K0 = C._zod.run({ value: U[S], issues: [] }, L), U0 = C._zod.optin === "optional" && C._zod.optout === "optional";
            if (K0 instanceof Promise) F.push(K0.then((s) => U0 ? qJ(s, V, S, U) : k4(s, V, S)));
            else if (U0) qJ(K0, V, S, U);
            else k4(K0, V, S);
          }
        }
        if (!z) return F.length ? Promise.all(F).then(() => V) : V;
        let q = [], N = K.keySet, A = z._zod, M = A.def.type;
        for (let R of Object.keys(U)) {
          if (N.has(R)) continue;
          if (M === "never") {
            q.push(R);
            continue;
          }
          let S = A.run({ value: U[R], issues: [] }, L);
          if (S instanceof Promise) F.push(S.then((C) => k4(C, V, R)));
          else k4(S, V, R);
        }
        if (q.length) V.issues.push({ code: "unrecognized_keys", keys: q, input: U, inst: X });
        if (!F.length) return V;
        return Promise.all(F).then(() => {
          return V;
        });
      };
    });
    _4 = O("$ZodUnion", (X, Q) => {
      X0.init(X, Q), Y0(X._zod, "optin", () => Q.options.some(($) => $._zod.optin === "optional") ? "optional" : void 0), Y0(X._zod, "optout", () => Q.options.some(($) => $._zod.optout === "optional") ? "optional" : void 0), Y0(X._zod, "values", () => {
        if (Q.options.every(($) => $._zod.values)) return new Set(Q.options.flatMap(($) => Array.from($._zod.values)));
        return;
      }), Y0(X._zod, "pattern", () => {
        if (Q.options.every(($) => $._zod.pattern)) {
          let $ = Q.options.map((Y) => Y._zod.pattern);
          return new RegExp(`^(${$.map((Y) => MX(Y.source)).join("|")})$`);
        }
        return;
      }), X._zod.parse = ($, Y) => {
        let W = false, J = [];
        for (let G of Q.options) {
          let H = G._zod.run({ value: $.value, issues: [] }, Y);
          if (H instanceof Promise) J.push(H), W = true;
          else {
            if (H.issues.length === 0) return H;
            J.push(H);
          }
        }
        if (!W) return FJ(J, $, X, Y);
        return Promise.all(J).then((G) => {
          return FJ(G, $, X, Y);
        });
      };
    });
    LQ = O("$ZodDiscriminatedUnion", (X, Q) => {
      _4.init(X, Q);
      let $ = X._zod.parse;
      Y0(X._zod, "propValues", () => {
        let W = {};
        for (let J of Q.options) {
          let G = J._zod.propValues;
          if (!G || Object.keys(G).length === 0) throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(J)}"`);
          for (let [H, B] of Object.entries(G)) {
            if (!W[H]) W[H] = /* @__PURE__ */ new Set();
            for (let z of B) W[H].add(z);
          }
        }
        return W;
      });
      let Y = AX(() => {
        let W = Q.options, J = /* @__PURE__ */ new Map();
        for (let G of W) {
          let H = G._zod.propValues[Q.discriminator];
          if (!H || H.size === 0) throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(G)}"`);
          for (let B of H) {
            if (J.has(B)) throw Error(`Duplicate discriminator value "${String(B)}"`);
            J.set(B, G);
          }
        }
        return J;
      });
      X._zod.parse = (W, J) => {
        let G = W.value;
        if (!S6(G)) return W.issues.push({ code: "invalid_type", expected: "object", input: G, inst: X }), W;
        let H = Y.value.get(G?.[Q.discriminator]);
        if (H) return H._zod.run(W, J);
        if (Q.unionFallback) return $(W, J);
        return W.issues.push({ code: "invalid_union", errors: [], note: "No matching discriminator", input: G, path: [Q.discriminator], inst: X }), W;
      };
    });
    qQ = O("$ZodIntersection", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($, Y) => {
        let W = $.value, J = Q.left._zod.run({ value: W, issues: [] }, Y), G = Q.right._zod.run({ value: W, issues: [] }, Y);
        if (J instanceof Promise || G instanceof Promise) return Promise.all([J, G]).then(([B, z]) => {
          return NJ($, B, z);
        });
        return NJ($, J, G);
      };
    });
    FQ = O("$ZodRecord", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($, Y) => {
        let W = $.value;
        if (!Z6(W)) return $.issues.push({ expected: "record", code: "invalid_type", input: W, inst: X }), $;
        let J = [];
        if (Q.keyType._zod.values) {
          let G = Q.keyType._zod.values;
          $.value = {};
          for (let B of G) if (typeof B === "string" || typeof B === "number" || typeof B === "symbol") {
            let z = Q.valueType._zod.run({ value: W[B], issues: [] }, Y);
            if (z instanceof Promise) J.push(z.then((K) => {
              if (K.issues.length) $.issues.push(...H1(B, K.issues));
              $.value[B] = K.value;
            }));
            else {
              if (z.issues.length) $.issues.push(...H1(B, z.issues));
              $.value[B] = z.value;
            }
          }
          let H;
          for (let B in W) if (!G.has(B)) H = H ?? [], H.push(B);
          if (H && H.length > 0) $.issues.push({ code: "unrecognized_keys", input: W, inst: X, keys: H });
        } else {
          $.value = {};
          for (let G of Reflect.ownKeys(W)) {
            if (G === "__proto__") continue;
            let H = Q.keyType._zod.run({ value: G, issues: [] }, Y);
            if (H instanceof Promise) throw Error("Async schemas not supported in object keys currently");
            if (H.issues.length) {
              $.issues.push({ origin: "record", code: "invalid_key", issues: H.issues.map((z) => o0(z, Y, u0())), input: G, path: [G], inst: X }), $.value[H.value] = H.value;
              continue;
            }
            let B = Q.valueType._zod.run({ value: W[G], issues: [] }, Y);
            if (B instanceof Promise) J.push(B.then((z) => {
              if (z.issues.length) $.issues.push(...H1(G, z.issues));
              $.value[H.value] = z.value;
            }));
            else {
              if (B.issues.length) $.issues.push(...H1(G, B.issues));
              $.value[H.value] = B.value;
            }
          }
        }
        if (J.length) return Promise.all(J).then(() => $);
        return $;
      };
    });
    NQ = O("$ZodEnum", (X, Q) => {
      X0.init(X, Q);
      let $ = DX(Q.entries);
      X._zod.values = new Set($), X._zod.pattern = new RegExp(`^(${$.filter((Y) => I9.has(typeof Y)).map((Y) => typeof Y === "string" ? y1(Y) : Y.toString()).join("|")})$`), X._zod.parse = (Y, W) => {
        let J = Y.value;
        if (X._zod.values.has(J)) return Y;
        return Y.issues.push({ code: "invalid_value", values: $, input: J, inst: X }), Y;
      };
    });
    OQ = O("$ZodLiteral", (X, Q) => {
      X0.init(X, Q), X._zod.values = new Set(Q.values), X._zod.pattern = new RegExp(`^(${Q.values.map(($) => typeof $ === "string" ? y1($) : $ ? $.toString() : String($)).join("|")})$`), X._zod.parse = ($, Y) => {
        let W = $.value;
        if (X._zod.values.has(W)) return $;
        return $.issues.push({ code: "invalid_value", values: Q.values, input: W, inst: X }), $;
      };
    });
    DQ = O("$ZodTransform", (X, Q) => {
      X0.init(X, Q), X._zod.parse = ($, Y) => {
        let W = Q.transform($.value, $);
        if (Y.async) return (W instanceof Promise ? W : Promise.resolve(W)).then((G) => {
          return $.value = G, $;
        });
        if (W instanceof Promise) throw new x1();
        return $.value = W, $;
      };
    });
    AQ = O("$ZodOptional", (X, Q) => {
      X0.init(X, Q), X._zod.optin = "optional", X._zod.optout = "optional", Y0(X._zod, "values", () => {
        return Q.innerType._zod.values ? /* @__PURE__ */ new Set([...Q.innerType._zod.values, void 0]) : void 0;
      }), Y0(X._zod, "pattern", () => {
        let $ = Q.innerType._zod.pattern;
        return $ ? new RegExp(`^(${MX($.source)})?$`) : void 0;
      }), X._zod.parse = ($, Y) => {
        if (Q.innerType._zod.optin === "optional") return Q.innerType._zod.run($, Y);
        if ($.value === void 0) return $;
        return Q.innerType._zod.run($, Y);
      };
    });
    wQ = O("$ZodNullable", (X, Q) => {
      X0.init(X, Q), Y0(X._zod, "optin", () => Q.innerType._zod.optin), Y0(X._zod, "optout", () => Q.innerType._zod.optout), Y0(X._zod, "pattern", () => {
        let $ = Q.innerType._zod.pattern;
        return $ ? new RegExp(`^(${MX($.source)}|null)$`) : void 0;
      }), Y0(X._zod, "values", () => {
        return Q.innerType._zod.values ? /* @__PURE__ */ new Set([...Q.innerType._zod.values, null]) : void 0;
      }), X._zod.parse = ($, Y) => {
        if ($.value === null) return $;
        return Q.innerType._zod.run($, Y);
      };
    });
    MQ = O("$ZodDefault", (X, Q) => {
      X0.init(X, Q), X._zod.optin = "optional", Y0(X._zod, "values", () => Q.innerType._zod.values), X._zod.parse = ($, Y) => {
        if ($.value === void 0) return $.value = Q.defaultValue, $;
        let W = Q.innerType._zod.run($, Y);
        if (W instanceof Promise) return W.then((J) => OJ(J, Q));
        return OJ(W, Q);
      };
    });
    jQ = O("$ZodPrefault", (X, Q) => {
      X0.init(X, Q), X._zod.optin = "optional", Y0(X._zod, "values", () => Q.innerType._zod.values), X._zod.parse = ($, Y) => {
        if ($.value === void 0) $.value = Q.defaultValue;
        return Q.innerType._zod.run($, Y);
      };
    });
    RQ = O("$ZodNonOptional", (X, Q) => {
      X0.init(X, Q), Y0(X._zod, "values", () => {
        let $ = Q.innerType._zod.values;
        return $ ? new Set([...$].filter((Y) => Y !== void 0)) : void 0;
      }), X._zod.parse = ($, Y) => {
        let W = Q.innerType._zod.run($, Y);
        if (W instanceof Promise) return W.then((J) => DJ(J, X));
        return DJ(W, X);
      };
    });
    IQ = O("$ZodCatch", (X, Q) => {
      X0.init(X, Q), X._zod.optin = "optional", Y0(X._zod, "optout", () => Q.innerType._zod.optout), Y0(X._zod, "values", () => Q.innerType._zod.values), X._zod.parse = ($, Y) => {
        let W = Q.innerType._zod.run($, Y);
        if (W instanceof Promise) return W.then((J) => {
          if ($.value = J.value, J.issues.length) $.value = Q.catchValue({ ...$, error: { issues: J.issues.map((G) => o0(G, Y, u0())) }, input: $.value }), $.issues = [];
          return $;
        });
        if ($.value = W.value, W.issues.length) $.value = Q.catchValue({ ...$, error: { issues: W.issues.map((J) => o0(J, Y, u0())) }, input: $.value }), $.issues = [];
        return $;
      };
    });
    EQ = O("$ZodPipe", (X, Q) => {
      X0.init(X, Q), Y0(X._zod, "values", () => Q.in._zod.values), Y0(X._zod, "optin", () => Q.in._zod.optin), Y0(X._zod, "optout", () => Q.out._zod.optout), X._zod.parse = ($, Y) => {
        let W = Q.in._zod.run($, Y);
        if (W instanceof Promise) return W.then((J) => AJ(J, Q, Y));
        return AJ(W, Q, Y);
      };
    });
    bQ = O("$ZodReadonly", (X, Q) => {
      X0.init(X, Q), Y0(X._zod, "propValues", () => Q.innerType._zod.propValues), Y0(X._zod, "values", () => Q.innerType._zod.values), Y0(X._zod, "optin", () => Q.innerType._zod.optin), Y0(X._zod, "optout", () => Q.innerType._zod.optout), X._zod.parse = ($, Y) => {
        let W = Q.innerType._zod.run($, Y);
        if (W instanceof Promise) return W.then(wJ);
        return wJ(W);
      };
    });
    PQ = O("$ZodCustom", (X, Q) => {
      w0.init(X, Q), X0.init(X, Q), X._zod.parse = ($, Y) => {
        return $;
      }, X._zod.check = ($) => {
        let Y = $.value, W = Q.fn(Y);
        if (W instanceof Promise) return W.then((J) => MJ(J, $, Y, X));
        MJ(W, $, Y, X);
        return;
      };
    });
    aV = (X) => {
      let Q = typeof X;
      switch (Q) {
        case "number":
          return Number.isNaN(X) ? "NaN" : "number";
        case "object": {
          if (Array.isArray(X)) return "array";
          if (X === null) return "null";
          if (Object.getPrototypeOf(X) !== Object.prototype && X.constructor) return X.constructor.name;
        }
      }
      return Q;
    };
    sV = () => {
      let X = { string: { unit: "characters", verb: "to have" }, file: { unit: "bytes", verb: "to have" }, array: { unit: "items", verb: "to have" }, set: { unit: "items", verb: "to have" } };
      function Q(Y) {
        return X[Y] ?? null;
      }
      let $ = { regex: "input", email: "email address", url: "URL", emoji: "emoji", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO datetime", date: "ISO date", time: "ISO time", duration: "ISO duration", ipv4: "IPv4 address", ipv6: "IPv6 address", cidrv4: "IPv4 range", cidrv6: "IPv6 range", base64: "base64-encoded string", base64url: "base64url-encoded string", json_string: "JSON string", e164: "E.164 number", jwt: "JWT", template_literal: "input" };
      return (Y) => {
        switch (Y.code) {
          case "invalid_type":
            return `Invalid input: expected ${Y.expected}, received ${aV(Y.input)}`;
          case "invalid_value":
            if (Y.values.length === 1) return `Invalid input: expected ${S4(Y.values[0])}`;
            return `Invalid option: expected one of ${b4(Y.values, "|")}`;
          case "too_big": {
            let W = Y.inclusive ? "<=" : "<", J = Q(Y.origin);
            if (J) return `Too big: expected ${Y.origin ?? "value"} to have ${W}${Y.maximum.toString()} ${J.unit ?? "elements"}`;
            return `Too big: expected ${Y.origin ?? "value"} to be ${W}${Y.maximum.toString()}`;
          }
          case "too_small": {
            let W = Y.inclusive ? ">=" : ">", J = Q(Y.origin);
            if (J) return `Too small: expected ${Y.origin} to have ${W}${Y.minimum.toString()} ${J.unit}`;
            return `Too small: expected ${Y.origin} to be ${W}${Y.minimum.toString()}`;
          }
          case "invalid_format": {
            let W = Y;
            if (W.format === "starts_with") return `Invalid string: must start with "${W.prefix}"`;
            if (W.format === "ends_with") return `Invalid string: must end with "${W.suffix}"`;
            if (W.format === "includes") return `Invalid string: must include "${W.includes}"`;
            if (W.format === "regex") return `Invalid string: must match pattern ${W.pattern}`;
            return `Invalid ${$[W.format] ?? Y.format}`;
          }
          case "not_multiple_of":
            return `Invalid number: must be a multiple of ${Y.divisor}`;
          case "unrecognized_keys":
            return `Unrecognized key${Y.keys.length > 1 ? "s" : ""}: ${b4(Y.keys, ", ")}`;
          case "invalid_key":
            return `Invalid key in ${Y.origin}`;
          case "invalid_union":
            return "Invalid input";
          case "invalid_element":
            return `Invalid value in ${Y.origin}`;
          default:
            return "Invalid input";
        }
      };
    };
    eV = Symbol("ZodOutput");
    XL = Symbol("ZodInput");
    x4 = class {
      constructor() {
        this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
      }
      add(X, ...Q) {
        let $ = Q[0];
        if (this._map.set(X, $), $ && typeof $ === "object" && "id" in $) {
          if (this._idmap.has($.id)) throw Error(`ID ${$.id} already exists in the registry`);
          this._idmap.set($.id, X);
        }
        return this;
      }
      remove(X) {
        return this._map.delete(X), this;
      }
      get(X) {
        let Q = X._zod.parent;
        if (Q) {
          let $ = { ...this.get(Q) ?? {} };
          return delete $.id, { ...$, ...this._map.get(X) };
        }
        return this._map.get(X);
      }
      has(X) {
        return this._map.has(X);
      }
    };
    g1 = PJ();
    xL = O("ZodMiniType", (X, Q) => {
      if (!X._zod) throw Error("Uninitialized schema in ZodMiniType.");
      X0.init(X, Q), X.def = Q, X.parse = ($, Y) => k9(X, $, Y, { callee: X.parse }), X.safeParse = ($, Y) => Q6(X, $, Y), X.parseAsync = async ($, Y) => T9(X, $, Y, { callee: X.parseAsync }), X.safeParseAsync = async ($, Y) => $6(X, $, Y), X.check = (...$) => {
        return X.clone({ ...Q, checks: [...Q.checks ?? [], ...$.map((Y) => typeof Y === "function" ? { _zod: { check: Y, def: { check: "custom" }, onattach: [] } } : Y)] });
      }, X.clone = ($, Y) => l0(X, $, Y), X.brand = () => X, X.register = ($, Y) => {
        return $.add(X, Y), X;
      };
    });
    yL = O("ZodMiniObject", (X, Q) => {
      T4.init(X, Q), xL.init(X, Q), i.defineLazy(X, "shape", () => Q.shape);
    });
    SX = {};
    U7(SX, { time: () => w$, duration: () => M$, datetime: () => D$, date: () => A$, ZodISOTime: () => fJ, ZodISODuration: () => hJ, ZodISODateTime: () => yJ, ZodISODate: () => gJ });
    yJ = O("ZodISODateTime", (X, Q) => {
      jJ.init(X, Q), H0.init(X, Q);
    });
    gJ = O("ZodISODate", (X, Q) => {
      RJ.init(X, Q), H0.init(X, Q);
    });
    fJ = O("ZodISOTime", (X, Q) => {
      IJ.init(X, Q), H0.init(X, Q);
    });
    hJ = O("ZodISODuration", (X, Q) => {
      EJ.init(X, Q), H0.init(X, Q);
    });
    uJ = (X, Q) => {
      Z4.init(X, Q), X.name = "ZodError", Object.defineProperties(X, { format: { value: ($) => Z9(X, $) }, flatten: { value: ($) => S9(X, $) }, addIssue: { value: ($) => X.issues.push($) }, addIssues: { value: ($) => X.issues.push(...$) }, isEmpty: { get() {
        return X.issues.length === 0;
      } } });
    };
    GZ = O("ZodError", uJ);
    ZX = O("ZodError", uJ, { Parent: Error });
    lJ = C9(ZX);
    mJ = v9(ZX);
    cJ = _9(ZX);
    pJ = x9(ZX);
    z0 = O("ZodType", (X, Q) => {
      return X0.init(X, Q), X.def = Q, Object.defineProperty(X, "_def", { value: Q }), X.check = (...$) => {
        return X.clone({ ...Q, checks: [...Q.checks ?? [], ...$.map((Y) => typeof Y === "function" ? { _zod: { check: Y, def: { check: "custom" }, onattach: [] } } : Y)] });
      }, X.clone = ($, Y) => l0(X, $, Y), X.brand = () => X, X.register = ($, Y) => {
        return $.add(X, Y), X;
      }, X.parse = ($, Y) => lJ(X, $, Y, { callee: X.parse }), X.safeParse = ($, Y) => cJ(X, $, Y), X.parseAsync = async ($, Y) => mJ(X, $, Y, { callee: X.parseAsync }), X.safeParseAsync = async ($, Y) => pJ(X, $, Y), X.spa = X.safeParseAsync, X.refine = ($, Y) => X.check(Tq($, Y)), X.superRefine = ($) => X.check(_q($)), X.overwrite = ($) => X.check(Y6($)), X.optional = () => v(X), X.nullable = () => nJ(X), X.nullish = () => v(nJ(X)), X.nonoptional = ($) => bq(X, $), X.array = () => r(X), X.or = ($) => J0([X, $]), X.and = ($) => i4(X, $), X.transform = ($) => R$(X, sJ($)), X.default = ($) => Rq(X, $), X.prefault = ($) => Eq(X, $), X.catch = ($) => Sq(X, $), X.pipe = ($) => R$(X, $), X.readonly = () => kq(X), X.describe = ($) => {
        let Y = X.clone();
        return g1.add(Y, { description: $ }), Y;
      }, Object.defineProperty(X, "description", { get() {
        return g1.get(X)?.description;
      }, configurable: true }), X.meta = (...$) => {
        if ($.length === 0) return g1.get(X);
        let Y = X.clone();
        return g1.add(Y, $[0]), Y;
      }, X.isOptional = () => X.safeParse(void 0).success, X.isNullable = () => X.safeParse(null).success, X;
    });
    rJ = O("_ZodString", (X, Q) => {
      EX.init(X, Q), z0.init(X, Q);
      let $ = X._zod.bag;
      X.format = $.format ?? null, X.minLength = $.minimum ?? null, X.maxLength = $.maximum ?? null, X.regex = (...Y) => X.check(Y$(...Y)), X.includes = (...Y) => X.check(G$(...Y)), X.startsWith = (...Y) => X.check(H$(...Y)), X.endsWith = (...Y) => X.check(B$(...Y)), X.min = (...Y) => X.check(C6(...Y)), X.max = (...Y) => X.check(u4(...Y)), X.length = (...Y) => X.check(l4(...Y)), X.nonempty = (...Y) => X.check(C6(1, ...Y)), X.lowercase = (Y) => X.check(W$(Y)), X.uppercase = (Y) => X.check(J$(Y)), X.trim = () => X.check(K$()), X.normalize = (...Y) => X.check(z$(...Y)), X.toLowerCase = () => X.check(U$()), X.toUpperCase = () => X.check(V$());
    });
    dL = O("ZodString", (X, Q) => {
      EX.init(X, Q), rJ.init(X, Q), X.email = ($) => X.check(CQ(iL, $)), X.url = ($) => X.check(xQ(nL, $)), X.jwt = ($) => X.check(tQ(Bq, $)), X.emoji = ($) => X.check(yQ(rL, $)), X.guid = ($) => X.check(y4(dJ, $)), X.uuid = ($) => X.check(kQ(d4, $)), X.uuidv4 = ($) => X.check(vQ(d4, $)), X.uuidv6 = ($) => X.check(TQ(d4, $)), X.uuidv7 = ($) => X.check(_Q(d4, $)), X.nanoid = ($) => X.check(gQ(oL, $)), X.guid = ($) => X.check(y4(dJ, $)), X.cuid = ($) => X.check(fQ(tL, $)), X.cuid2 = ($) => X.check(hQ(aL, $)), X.ulid = ($) => X.check(uQ(sL, $)), X.base64 = ($) => X.check(nQ(Jq, $)), X.base64url = ($) => X.check(rQ(Gq, $)), X.xid = ($) => X.check(lQ(eL, $)), X.ksuid = ($) => X.check(mQ(Xq, $)), X.ipv4 = ($) => X.check(cQ(Qq, $)), X.ipv6 = ($) => X.check(pQ($q, $)), X.cidrv4 = ($) => X.check(dQ(Yq, $)), X.cidrv6 = ($) => X.check(iQ(Wq, $)), X.e164 = ($) => X.check(oQ(Hq, $)), X.datetime = ($) => X.check(D$($)), X.date = ($) => X.check(A$($)), X.time = ($) => X.check(w$($)), X.duration = ($) => X.check(M$($));
    });
    H0 = O("ZodStringFormat", (X, Q) => {
      W0.init(X, Q), rJ.init(X, Q);
    });
    iL = O("ZodEmail", (X, Q) => {
      p9.init(X, Q), H0.init(X, Q);
    });
    dJ = O("ZodGUID", (X, Q) => {
      m9.init(X, Q), H0.init(X, Q);
    });
    d4 = O("ZodUUID", (X, Q) => {
      c9.init(X, Q), H0.init(X, Q);
    });
    nL = O("ZodURL", (X, Q) => {
      d9.init(X, Q), H0.init(X, Q);
    });
    rL = O("ZodEmoji", (X, Q) => {
      i9.init(X, Q), H0.init(X, Q);
    });
    oL = O("ZodNanoID", (X, Q) => {
      n9.init(X, Q), H0.init(X, Q);
    });
    tL = O("ZodCUID", (X, Q) => {
      r9.init(X, Q), H0.init(X, Q);
    });
    aL = O("ZodCUID2", (X, Q) => {
      o9.init(X, Q), H0.init(X, Q);
    });
    sL = O("ZodULID", (X, Q) => {
      t9.init(X, Q), H0.init(X, Q);
    });
    eL = O("ZodXID", (X, Q) => {
      a9.init(X, Q), H0.init(X, Q);
    });
    Xq = O("ZodKSUID", (X, Q) => {
      s9.init(X, Q), H0.init(X, Q);
    });
    Qq = O("ZodIPv4", (X, Q) => {
      e9.init(X, Q), H0.init(X, Q);
    });
    $q = O("ZodIPv6", (X, Q) => {
      XQ.init(X, Q), H0.init(X, Q);
    });
    Yq = O("ZodCIDRv4", (X, Q) => {
      QQ.init(X, Q), H0.init(X, Q);
    });
    Wq = O("ZodCIDRv6", (X, Q) => {
      $Q.init(X, Q), H0.init(X, Q);
    });
    Jq = O("ZodBase64", (X, Q) => {
      YQ.init(X, Q), H0.init(X, Q);
    });
    Gq = O("ZodBase64URL", (X, Q) => {
      WQ.init(X, Q), H0.init(X, Q);
    });
    Hq = O("ZodE164", (X, Q) => {
      JQ.init(X, Q), H0.init(X, Q);
    });
    Bq = O("ZodJWT", (X, Q) => {
      GQ.init(X, Q), H0.init(X, Q);
    });
    oJ = O("ZodNumber", (X, Q) => {
      v4.init(X, Q), z0.init(X, Q), X.gt = (Y, W) => X.check(f4(Y, W)), X.gte = (Y, W) => X.check(PX(Y, W)), X.min = (Y, W) => X.check(PX(Y, W)), X.lt = (Y, W) => X.check(g4(Y, W)), X.lte = (Y, W) => X.check(bX(Y, W)), X.max = (Y, W) => X.check(bX(Y, W)), X.int = (Y) => X.check(iJ(Y)), X.safe = (Y) => X.check(iJ(Y)), X.positive = (Y) => X.check(f4(0, Y)), X.nonnegative = (Y) => X.check(PX(0, Y)), X.negative = (Y) => X.check(g4(0, Y)), X.nonpositive = (Y) => X.check(bX(0, Y)), X.multipleOf = (Y, W) => X.check(h4(Y, W)), X.step = (Y, W) => X.check(h4(Y, W)), X.finite = () => X;
      let $ = X._zod.bag;
      X.minValue = Math.max($.minimum ?? Number.NEGATIVE_INFINITY, $.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, X.maxValue = Math.min($.maximum ?? Number.POSITIVE_INFINITY, $.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, X.isInt = ($.format ?? "").includes("int") || Number.isSafeInteger($.multipleOf ?? 0.5), X.isFinite = true, X.format = $.format ?? null;
    });
    zq = O("ZodNumberFormat", (X, Q) => {
      HQ.init(X, Q), oJ.init(X, Q);
    });
    Kq = O("ZodBoolean", (X, Q) => {
      BQ.init(X, Q), z0.init(X, Q);
    });
    Uq = O("ZodNull", (X, Q) => {
      zQ.init(X, Q), z0.init(X, Q);
    });
    Vq = O("ZodUnknown", (X, Q) => {
      KQ.init(X, Q), z0.init(X, Q);
    });
    Lq = O("ZodNever", (X, Q) => {
      UQ.init(X, Q), z0.init(X, Q);
    });
    Fq = O("ZodArray", (X, Q) => {
      VQ.init(X, Q), z0.init(X, Q), X.element = Q.element, X.min = ($, Y) => X.check(C6($, Y)), X.nonempty = ($) => X.check(C6(1, $)), X.max = ($, Y) => X.check(u4($, Y)), X.length = ($, Y) => X.check(l4($, Y)), X.unwrap = () => X.element;
    });
    tJ = O("ZodObject", (X, Q) => {
      T4.init(X, Q), z0.init(X, Q), i.defineLazy(X, "shape", () => Q.shape), X.keyof = () => j0(Object.keys(X._zod.def.shape)), X.catchall = ($) => X.clone({ ...X._zod.def, catchall: $ }), X.passthrough = () => X.clone({ ...X._zod.def, catchall: N0() }), X.loose = () => X.clone({ ...X._zod.def, catchall: N0() }), X.strict = () => X.clone({ ...X._zod.def, catchall: qq() }), X.strip = () => X.clone({ ...X._zod.def, catchall: void 0 }), X.extend = ($) => {
        return i.extend(X, $);
      }, X.merge = ($) => i.merge(X, $), X.pick = ($) => i.pick(X, $), X.omit = ($) => i.omit(X, $), X.partial = (...$) => i.partial(eJ, X, $[0]), X.required = (...$) => i.required(X5, X, $[0]);
    });
    aJ = O("ZodUnion", (X, Q) => {
      _4.init(X, Q), z0.init(X, Q), X.options = Q.options;
    });
    Nq = O("ZodDiscriminatedUnion", (X, Q) => {
      aJ.init(X, Q), LQ.init(X, Q);
    });
    Oq = O("ZodIntersection", (X, Q) => {
      qQ.init(X, Q), z0.init(X, Q);
    });
    Dq = O("ZodRecord", (X, Q) => {
      FQ.init(X, Q), z0.init(X, Q), X.keyType = Q.keyType, X.valueType = Q.valueType;
    });
    j$ = O("ZodEnum", (X, Q) => {
      NQ.init(X, Q), z0.init(X, Q), X.enum = Q.entries, X.options = Object.values(Q.entries);
      let $ = new Set(Object.keys(Q.entries));
      X.extract = (Y, W) => {
        let J = {};
        for (let G of Y) if ($.has(G)) J[G] = Q.entries[G];
        else throw Error(`Key ${G} not found in enum`);
        return new j$({ ...Q, checks: [], ...i.normalizeParams(W), entries: J });
      }, X.exclude = (Y, W) => {
        let J = { ...Q.entries };
        for (let G of Y) if ($.has(G)) delete J[G];
        else throw Error(`Key ${G} not found in enum`);
        return new j$({ ...Q, checks: [], ...i.normalizeParams(W), entries: J });
      };
    });
    Aq = O("ZodLiteral", (X, Q) => {
      OQ.init(X, Q), z0.init(X, Q), X.values = new Set(Q.values), Object.defineProperty(X, "value", { get() {
        if (Q.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
        return Q.values[0];
      } });
    });
    wq = O("ZodTransform", (X, Q) => {
      DQ.init(X, Q), z0.init(X, Q), X._zod.parse = ($, Y) => {
        $.addIssue = (J) => {
          if (typeof J === "string") $.issues.push(i.issue(J, $.value, Q));
          else {
            let G = J;
            if (G.fatal) G.continue = false;
            G.code ?? (G.code = "custom"), G.input ?? (G.input = $.value), G.inst ?? (G.inst = X), G.continue ?? (G.continue = true), $.issues.push(i.issue(G));
          }
        };
        let W = Q.transform($.value, $);
        if (W instanceof Promise) return W.then((J) => {
          return $.value = J, $;
        });
        return $.value = W, $;
      };
    });
    eJ = O("ZodOptional", (X, Q) => {
      AQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType;
    });
    Mq = O("ZodNullable", (X, Q) => {
      wQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType;
    });
    jq = O("ZodDefault", (X, Q) => {
      MQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType, X.removeDefault = X.unwrap;
    });
    Iq = O("ZodPrefault", (X, Q) => {
      jQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType;
    });
    X5 = O("ZodNonOptional", (X, Q) => {
      RQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType;
    });
    Pq = O("ZodCatch", (X, Q) => {
      IQ.init(X, Q), z0.init(X, Q), X.unwrap = () => X._zod.def.innerType, X.removeCatch = X.unwrap;
    });
    Zq = O("ZodPipe", (X, Q) => {
      EQ.init(X, Q), z0.init(X, Q), X.in = Q.in, X.out = Q.out;
    });
    Cq = O("ZodReadonly", (X, Q) => {
      bQ.init(X, Q), z0.init(X, Q);
    });
    Q5 = O("ZodCustom", (X, Q) => {
      PQ.init(X, Q), z0.init(X, Q);
    });
    u0(SQ());
    z1 = "io.modelcontextprotocol/related-task";
    r4 = "2.0";
    B1 = $5((X) => X !== null && (typeof X === "object" || typeof X === "function"));
    W5 = J0([D(), Q0().int()]);
    J5 = D();
    xq = c0({ ttl: J0([Q0(), I$()]).optional(), pollInterval: Q0().optional() });
    S$ = c0({ taskId: D() });
    yq = c0({ progressToken: W5.optional(), [z1]: S$.optional() });
    _0 = c0({ task: xq.optional(), _meta: yq.optional() });
    R0 = E({ method: D(), params: _0.optional() });
    J6 = c0({ _meta: E({ [z1]: v(S$) }).passthrough().optional() });
    p0 = E({ method: D(), params: J6.optional() });
    P0 = c0({ _meta: c0({ [z1]: S$.optional() }).optional() });
    o4 = J0([D(), Q0().int()]);
    G5 = E({ jsonrpc: T(r4), id: o4, ...R0.shape }).strict();
    H5 = E({ jsonrpc: T(r4), ...p0.shape }).strict();
    z5 = E({ jsonrpc: T(r4), id: o4, result: P0 }).strict();
    (function(X) {
      X[X.ConnectionClosed = -32e3] = "ConnectionClosed", X[X.RequestTimeout = -32001] = "RequestTimeout", X[X.ParseError = -32700] = "ParseError", X[X.InvalidRequest = -32600] = "InvalidRequest", X[X.MethodNotFound = -32601] = "MethodNotFound", X[X.InvalidParams = -32602] = "InvalidParams", X[X.InternalError = -32603] = "InternalError", X[X.UrlElicitationRequired = -32042] = "UrlElicitationRequired";
    })(x || (x = {}));
    K5 = E({ jsonrpc: T(r4), id: o4, error: E({ code: Q0().int(), message: D(), data: v(N0()) }) }).strict();
    wZ = J0([G5, H5, z5, K5]);
    t4 = P0.strict();
    gq = J6.extend({ requestId: o4, reason: D().optional() });
    a4 = p0.extend({ method: T("notifications/cancelled"), params: gq });
    fq = E({ src: D(), mimeType: D().optional(), sizes: r(D()).optional() });
    kX = E({ icons: r(fq).optional() });
    T6 = E({ name: D(), title: D().optional() });
    V5 = T6.extend({ ...T6.shape, ...kX.shape, version: D(), websiteUrl: D().optional() });
    hq = i4(E({ applyDefaults: M0().optional() }), O0(D(), N0()));
    uq = b$((X) => {
      if (X && typeof X === "object" && !Array.isArray(X)) {
        if (Object.keys(X).length === 0) return { form: {} };
      }
      return X;
    }, i4(E({ form: hq.optional(), url: B1.optional() }), O0(D(), N0()).optional()));
    lq = E({ list: v(E({}).passthrough()), cancel: v(E({}).passthrough()), requests: v(E({ sampling: v(E({ createMessage: v(E({}).passthrough()) }).passthrough()), elicitation: v(E({ create: v(E({}).passthrough()) }).passthrough()) }).passthrough()) }).passthrough();
    mq = E({ list: v(E({}).passthrough()), cancel: v(E({}).passthrough()), requests: v(E({ tools: v(E({ call: v(E({}).passthrough()) }).passthrough()) }).passthrough()) }).passthrough();
    cq = E({ experimental: O0(D(), B1).optional(), sampling: E({ context: B1.optional(), tools: B1.optional() }).optional(), elicitation: uq.optional(), roots: E({ listChanged: M0().optional() }).optional(), tasks: v(lq) });
    pq = _0.extend({ protocolVersion: D(), capabilities: cq, clientInfo: V5 });
    C$ = R0.extend({ method: T("initialize"), params: pq });
    dq = E({ experimental: O0(D(), B1).optional(), logging: B1.optional(), completions: B1.optional(), prompts: v(E({ listChanged: v(M0()) })), resources: E({ subscribe: M0().optional(), listChanged: M0().optional() }).optional(), tools: E({ listChanged: M0().optional() }).optional(), tasks: v(mq) }).passthrough();
    iq = P0.extend({ protocolVersion: D(), capabilities: dq, serverInfo: V5, instructions: D().optional() });
    k$ = p0.extend({ method: T("notifications/initialized") });
    s4 = R0.extend({ method: T("ping") });
    nq = E({ progress: Q0(), total: v(Q0()), message: v(D()) });
    rq = E({ ...J6.shape, ...nq.shape, progressToken: W5 });
    e4 = p0.extend({ method: T("notifications/progress"), params: rq });
    oq = _0.extend({ cursor: J5.optional() });
    vX = R0.extend({ params: oq.optional() });
    TX = P0.extend({ nextCursor: v(J5) });
    _X = E({ taskId: D(), status: j0(["working", "input_required", "completed", "failed", "cancelled"]), ttl: J0([Q0(), I$()]), createdAt: D(), lastUpdatedAt: D(), pollInterval: v(Q0()), statusMessage: v(D()) });
    _6 = P0.extend({ task: _X });
    tq = J6.merge(_X);
    xX = p0.extend({ method: T("notifications/tasks/status"), params: tq });
    X8 = R0.extend({ method: T("tasks/get"), params: _0.extend({ taskId: D() }) });
    Q8 = P0.merge(_X);
    $8 = R0.extend({ method: T("tasks/result"), params: _0.extend({ taskId: D() }) });
    Y8 = vX.extend({ method: T("tasks/list") });
    W8 = TX.extend({ tasks: r(_X) });
    L5 = R0.extend({ method: T("tasks/cancel"), params: _0.extend({ taskId: D() }) });
    q5 = P0.merge(_X);
    F5 = E({ uri: D(), mimeType: v(D()), _meta: O0(D(), N0()).optional() });
    N5 = F5.extend({ text: D() });
    v$ = D().refine((X) => {
      try {
        return atob(X), true;
      } catch (Q) {
        return false;
      }
    }, { message: "Invalid Base64 string" });
    O5 = F5.extend({ blob: v$ });
    x6 = E({ audience: r(j0(["user", "assistant"])).optional(), priority: Q0().min(0).max(1).optional(), lastModified: SX.datetime({ offset: true }).optional() });
    D5 = E({ ...T6.shape, ...kX.shape, uri: D(), description: v(D()), mimeType: v(D()), annotations: x6.optional(), _meta: v(c0({})) });
    aq = E({ ...T6.shape, ...kX.shape, uriTemplate: D(), description: v(D()), mimeType: v(D()), annotations: x6.optional(), _meta: v(c0({})) });
    J8 = vX.extend({ method: T("resources/list") });
    sq = TX.extend({ resources: r(D5) });
    G8 = vX.extend({ method: T("resources/templates/list") });
    eq = TX.extend({ resourceTemplates: r(aq) });
    T$ = _0.extend({ uri: D() });
    XF = T$;
    H8 = R0.extend({ method: T("resources/read"), params: XF });
    QF = P0.extend({ contents: r(J0([N5, O5])) });
    $F = p0.extend({ method: T("notifications/resources/list_changed") });
    YF = T$;
    WF = R0.extend({ method: T("resources/subscribe"), params: YF });
    JF = T$;
    GF = R0.extend({ method: T("resources/unsubscribe"), params: JF });
    HF = J6.extend({ uri: D() });
    BF = p0.extend({ method: T("notifications/resources/updated"), params: HF });
    zF = E({ name: D(), description: v(D()), required: v(M0()) });
    KF = E({ ...T6.shape, ...kX.shape, description: v(D()), arguments: v(r(zF)), _meta: v(c0({})) });
    B8 = vX.extend({ method: T("prompts/list") });
    UF = TX.extend({ prompts: r(KF) });
    VF = _0.extend({ name: D(), arguments: O0(D(), D()).optional() });
    z8 = R0.extend({ method: T("prompts/get"), params: VF });
    _$ = E({ type: T("text"), text: D(), annotations: x6.optional(), _meta: O0(D(), N0()).optional() });
    x$ = E({ type: T("image"), data: v$, mimeType: D(), annotations: x6.optional(), _meta: O0(D(), N0()).optional() });
    y$ = E({ type: T("audio"), data: v$, mimeType: D(), annotations: x6.optional(), _meta: O0(D(), N0()).optional() });
    LF = E({ type: T("tool_use"), name: D(), id: D(), input: E({}).passthrough(), _meta: v(E({}).passthrough()) }).passthrough();
    qF = E({ type: T("resource"), resource: J0([N5, O5]), annotations: x6.optional(), _meta: O0(D(), N0()).optional() });
    FF = D5.extend({ type: T("resource_link") });
    g$ = J0([_$, x$, y$, FF, qF]);
    NF = E({ role: j0(["user", "assistant"]), content: g$ });
    OF = P0.extend({ description: v(D()), messages: r(NF) });
    DF = p0.extend({ method: T("notifications/prompts/list_changed") });
    AF = E({ title: D().optional(), readOnlyHint: M0().optional(), destructiveHint: M0().optional(), idempotentHint: M0().optional(), openWorldHint: M0().optional() });
    wF = E({ taskSupport: j0(["required", "optional", "forbidden"]).optional() });
    A5 = E({ ...T6.shape, ...kX.shape, description: D().optional(), inputSchema: E({ type: T("object"), properties: O0(D(), B1).optional(), required: r(D()).optional() }).catchall(N0()), outputSchema: E({ type: T("object"), properties: O0(D(), B1).optional(), required: r(D()).optional() }).catchall(N0()).optional(), annotations: v(AF), execution: v(wF), _meta: O0(D(), N0()).optional() });
    K8 = vX.extend({ method: T("tools/list") });
    MF = TX.extend({ tools: r(A5) });
    U8 = P0.extend({ content: r(g$).default([]), structuredContent: O0(D(), N0()).optional(), isError: v(M0()) });
    MZ = U8.or(P0.extend({ toolResult: N0() }));
    jF = _0.extend({ name: D(), arguments: v(O0(D(), N0())) });
    y6 = R0.extend({ method: T("tools/call"), params: jF });
    RF = p0.extend({ method: T("notifications/tools/list_changed") });
    yX = j0(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
    IF = _0.extend({ level: yX });
    f$ = R0.extend({ method: T("logging/setLevel"), params: IF });
    EF = J6.extend({ level: yX, logger: D().optional(), data: N0() });
    bF = p0.extend({ method: T("notifications/message"), params: EF });
    PF = E({ name: D().optional() });
    SF = E({ hints: v(r(PF)), costPriority: v(Q0().min(0).max(1)), speedPriority: v(Q0().min(0).max(1)), intelligencePriority: v(Q0().min(0).max(1)) });
    ZF = E({ mode: v(j0(["auto", "required", "none"])) });
    CF = E({ type: T("tool_result"), toolUseId: D().describe("The unique identifier for the corresponding tool call."), content: r(g$).default([]), structuredContent: E({}).passthrough().optional(), isError: v(M0()), _meta: v(E({}).passthrough()) }).passthrough();
    kF = E$("type", [_$, x$, y$]);
    n4 = E$("type", [_$, x$, y$, LF, CF]);
    vF = E({ role: j0(["user", "assistant"]), content: J0([n4, r(n4)]), _meta: v(E({}).passthrough()) }).passthrough();
    TF = _0.extend({ messages: r(vF), modelPreferences: SF.optional(), systemPrompt: D().optional(), includeContext: j0(["none", "thisServer", "allServers"]).optional(), temperature: Q0().optional(), maxTokens: Q0().int(), stopSequences: r(D()).optional(), metadata: B1.optional(), tools: v(r(A5)), toolChoice: v(ZF) });
    _F = R0.extend({ method: T("sampling/createMessage"), params: TF });
    h$ = P0.extend({ model: D(), stopReason: v(j0(["endTurn", "stopSequence", "maxTokens"]).or(D())), role: j0(["user", "assistant"]), content: kF });
    u$ = P0.extend({ model: D(), stopReason: v(j0(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(D())), role: j0(["user", "assistant"]), content: J0([n4, r(n4)]) });
    xF = E({ type: T("boolean"), title: D().optional(), description: D().optional(), default: M0().optional() });
    yF = E({ type: T("string"), title: D().optional(), description: D().optional(), minLength: Q0().optional(), maxLength: Q0().optional(), format: j0(["email", "uri", "date", "date-time"]).optional(), default: D().optional() });
    gF = E({ type: j0(["number", "integer"]), title: D().optional(), description: D().optional(), minimum: Q0().optional(), maximum: Q0().optional(), default: Q0().optional() });
    fF = E({ type: T("string"), title: D().optional(), description: D().optional(), enum: r(D()), default: D().optional() });
    hF = E({ type: T("string"), title: D().optional(), description: D().optional(), oneOf: r(E({ const: D(), title: D() })), default: D().optional() });
    uF = E({ type: T("string"), title: D().optional(), description: D().optional(), enum: r(D()), enumNames: r(D()).optional(), default: D().optional() });
    lF = J0([fF, hF]);
    mF = E({ type: T("array"), title: D().optional(), description: D().optional(), minItems: Q0().optional(), maxItems: Q0().optional(), items: E({ type: T("string"), enum: r(D()) }), default: r(D()).optional() });
    cF = E({ type: T("array"), title: D().optional(), description: D().optional(), minItems: Q0().optional(), maxItems: Q0().optional(), items: E({ anyOf: r(E({ const: D(), title: D() })) }), default: r(D()).optional() });
    pF = J0([mF, cF]);
    dF = J0([uF, lF, pF]);
    iF = J0([dF, xF, yF, gF]);
    nF = _0.extend({ mode: T("form").optional(), message: D(), requestedSchema: E({ type: T("object"), properties: O0(D(), iF), required: r(D()).optional() }) });
    rF = _0.extend({ mode: T("url"), message: D(), elicitationId: D(), url: D().url() });
    oF = J0([nF, rF]);
    tF = R0.extend({ method: T("elicitation/create"), params: oF });
    aF = J6.extend({ elicitationId: D() });
    sF = p0.extend({ method: T("notifications/elicitation/complete"), params: aF });
    V8 = P0.extend({ action: j0(["accept", "decline", "cancel"]), content: b$((X) => X === null ? void 0 : X, O0(D(), J0([D(), Q0(), M0(), r(D())])).optional()) });
    eF = E({ type: T("ref/resource"), uri: D() });
    XN = E({ type: T("ref/prompt"), name: D() });
    QN = _0.extend({ ref: J0([XN, eF]), argument: E({ name: D(), value: D() }), context: E({ arguments: O0(D(), D()).optional() }).optional() });
    L8 = R0.extend({ method: T("completion/complete"), params: QN });
    $N = P0.extend({ completion: c0({ values: r(D()).max(100), total: v(Q0().int()), hasMore: v(M0()) }) });
    YN = E({ uri: D().startsWith("file://"), name: D().optional(), _meta: O0(D(), N0()).optional() });
    WN = R0.extend({ method: T("roots/list") });
    l$ = P0.extend({ roots: r(YN) });
    JN = p0.extend({ method: T("notifications/roots/list_changed") });
    jZ = J0([s4, C$, L8, f$, z8, B8, J8, G8, H8, WF, GF, y6, K8, X8, $8, Y8]);
    RZ = J0([a4, e4, k$, JN, xX]);
    IZ = J0([t4, h$, u$, V8, l$, Q8, W8, _6]);
    EZ = J0([s4, _F, tF, WN, X8, $8, Y8]);
    bZ = J0([a4, e4, bF, BF, $F, RF, DF, xX, sF]);
    PZ = J0([t4, iq, $N, OF, UF, sq, eq, QF, U8, MF, Q8, W8, _6]);
    I5 = Symbol("Let zodToJsonSchema decide on which parser to use");
    BN = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
    hz = K7(cY(), 1);
    uz = K7(fz(), 1);
    pz = Symbol.for("mcp.completable");
    (function(X) {
      X.Completable = "McpCompletable";
    })(cz || (cz = {}));
  }
});

// ../../../packages/persistence/dist/index.js
var dist_exports2 = {};
__export(dist_exports2, {
  StorageContainerRepository: () => StorageContainerRepository,
  StorageImageRepository: () => StorageImageRepository,
  StorageSessionRepository: () => StorageSessionRepository,
  createPersistence: () => createPersistence,
  memoryDriver: () => memoryDriver
});
async function createPersistence(driver) {
  logger42.debug("Creating persistence", { driver: driver.constructor.name });
  const storage = await driver.createStorage();
  const persistence = new PersistenceImpl(storage);
  logger42.info("Persistence created successfully", { driver: driver.constructor.name });
  return persistence;
}
function jsonParseTransform(key, value) {
  if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
    warnKeyDropped(key);
    return;
  }
  return value;
}
function warnKeyDropped(key) {
  console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
}
function destr(value, options = {}) {
  if (typeof value !== "string") {
    return value;
  }
  if (value[0] === '"' && value[value.length - 1] === '"' && value.indexOf("\\") === -1) {
    return value.slice(1, -1);
  }
  const _value = value.trim();
  if (_value.length <= 9) {
    switch (_value.toLowerCase()) {
      case "true": {
        return true;
      }
      case "false": {
        return false;
      }
      case "undefined": {
        return;
      }
      case "null": {
        return null;
      }
      case "nan": {
        return Number.NaN;
      }
      case "infinity": {
        return Number.POSITIVE_INFINITY;
      }
      case "-infinity": {
        return Number.NEGATIVE_INFINITY;
      }
    }
  }
  if (!JsonSigRx.test(value)) {
    if (options.strict) {
      throw new SyntaxError("[destr] Invalid JSON");
    }
    return value;
  }
  try {
    if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
      if (options.strict) {
        throw new Error("[destr] Possible prototype pollution");
      }
      return JSON.parse(value, jsonParseTransform);
    }
    return JSON.parse(value);
  } catch (error) {
    if (options.strict) {
      throw error;
    }
    return value;
  }
}
function wrapToPromise(value) {
  if (!value || typeof value.then !== "function") {
    return Promise.resolve(value);
  }
  return value;
}
function asyncCall(function_, ...arguments_) {
  try {
    return wrapToPromise(function_(...arguments_));
  } catch (error) {
    return Promise.reject(error);
  }
}
function isPrimitive(value) {
  const type = typeof value;
  return value === null || type !== "object" && type !== "function";
}
function isPureObject(value) {
  const proto = Object.getPrototypeOf(value);
  return !proto || proto.isPrototypeOf(Object);
}
function stringify(value) {
  if (isPrimitive(value)) {
    return String(value);
  }
  if (isPureObject(value) || Array.isArray(value)) {
    return JSON.stringify(value);
  }
  if (typeof value.toJSON === "function") {
    return stringify(value.toJSON());
  }
  throw new Error("[unstorage] Cannot stringify value!");
}
function serializeRaw(value) {
  if (typeof value === "string") {
    return value;
  }
  return BASE64_PREFIX + base64Encode(value);
}
function deserializeRaw(value) {
  if (typeof value !== "string") {
    return value;
  }
  if (!value.startsWith(BASE64_PREFIX)) {
    return value;
  }
  return base64Decode(value.slice(BASE64_PREFIX.length));
}
function base64Decode(input) {
  if (globalThis.Buffer) {
    return Buffer.from(input, "base64");
  }
  return Uint8Array.from(globalThis.atob(input), (c3) => c3.codePointAt(0));
}
function base64Encode(input) {
  if (globalThis.Buffer) {
    return Buffer.from(input).toString("base64");
  }
  return globalThis.btoa(String.fromCodePoint(...input));
}
function normalizeKey(key) {
  if (!key) {
    return "";
  }
  return key.split("?")[0]?.replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") || "";
}
function joinKeys(...keys) {
  return normalizeKey(keys.join(":"));
}
function normalizeBaseKey(base) {
  base = normalizeKey(base);
  return base ? base + ":" : "";
}
function filterKeyByDepth(key, depth) {
  if (depth === void 0) {
    return true;
  }
  let substrCount = 0;
  let index = key.indexOf(":");
  while (index > -1) {
    substrCount++;
    index = key.indexOf(":", index + 1);
  }
  return substrCount <= depth;
}
function filterKeyByBase(key, base) {
  if (base) {
    return key.startsWith(base) && key[key.length - 1] !== "$";
  }
  return key[key.length - 1] !== "$";
}
function defineDriver(factory) {
  return factory;
}
function createStorage(options = {}) {
  const context = {
    mounts: { "": options.driver || memory() },
    mountpoints: [""],
    watching: false,
    watchListeners: [],
    unwatch: {}
  };
  const getMount = (key) => {
    for (const base of context.mountpoints) {
      if (key.startsWith(base)) {
        return {
          base,
          relativeKey: key.slice(base.length),
          driver: context.mounts[base]
        };
      }
    }
    return {
      base: "",
      relativeKey: key,
      driver: context.mounts[""]
    };
  };
  const getMounts = (base, includeParent) => {
    return context.mountpoints.filter((mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint)).map((mountpoint) => ({
      relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0,
      mountpoint,
      driver: context.mounts[mountpoint]
    }));
  };
  const onChange = (event, key) => {
    if (!context.watching) {
      return;
    }
    key = normalizeKey(key);
    for (const listener of context.watchListeners) {
      listener(event, key);
    }
  };
  const startWatch = async () => {
    if (context.watching) {
      return;
    }
    context.watching = true;
    for (const mountpoint in context.mounts) {
      context.unwatch[mountpoint] = await watch(context.mounts[mountpoint], onChange, mountpoint);
    }
  };
  const stopWatch = async () => {
    if (!context.watching) {
      return;
    }
    for (const mountpoint in context.unwatch) {
      await context.unwatch[mountpoint]();
    }
    context.unwatch = {};
    context.watching = false;
  };
  const runBatch = (items, commonOptions, cb) => {
    const batches = /* @__PURE__ */ new Map();
    const getBatch = (mount) => {
      let batch = batches.get(mount.base);
      if (!batch) {
        batch = {
          driver: mount.driver,
          base: mount.base,
          items: []
        };
        batches.set(mount.base, batch);
      }
      return batch;
    };
    for (const item of items) {
      const isStringItem = typeof item === "string";
      const key = normalizeKey(isStringItem ? item : item.key);
      const value = isStringItem ? void 0 : item.value;
      const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options };
      const mount = getMount(key);
      getBatch(mount).items.push({
        key,
        value,
        relativeKey: mount.relativeKey,
        options: options2
      });
    }
    return Promise.all([...batches.values()].map((batch) => cb(batch))).then((r3) => r3.flat());
  };
  const storage = {
    hasItem(key, opts = {}) {
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      return asyncCall(driver.hasItem, relativeKey, opts);
    },
    getItem(key, opts = {}) {
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      return asyncCall(driver.getItem, relativeKey, opts).then((value) => destr(value));
    },
    getItems(items, commonOptions = {}) {
      return runBatch(items, commonOptions, (batch) => {
        if (batch.driver.getItems) {
          return asyncCall(batch.driver.getItems, batch.items.map((item) => ({
            key: item.relativeKey,
            options: item.options
          })), commonOptions).then((r3) => r3.map((item) => ({
            key: joinKeys(batch.base, item.key),
            value: destr(item.value)
          })));
        }
        return Promise.all(batch.items.map((item) => {
          return asyncCall(batch.driver.getItem, item.relativeKey, item.options).then((value) => ({
            key: item.key,
            value: destr(value)
          }));
        }));
      });
    },
    getItemRaw(key, opts = {}) {
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      if (driver.getItemRaw) {
        return asyncCall(driver.getItemRaw, relativeKey, opts);
      }
      return asyncCall(driver.getItem, relativeKey, opts).then((value) => deserializeRaw(value));
    },
    async setItem(key, value, opts = {}) {
      if (value === void 0) {
        return storage.removeItem(key);
      }
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      if (!driver.setItem) {
        return;
      }
      await asyncCall(driver.setItem, relativeKey, stringify(value), opts);
      if (!driver.watch) {
        onChange("update", key);
      }
    },
    async setItems(items, commonOptions) {
      await runBatch(items, commonOptions, async (batch) => {
        if (batch.driver.setItems) {
          return asyncCall(batch.driver.setItems, batch.items.map((item) => ({
            key: item.relativeKey,
            value: stringify(item.value),
            options: item.options
          })), commonOptions);
        }
        if (!batch.driver.setItem) {
          return;
        }
        await Promise.all(batch.items.map((item) => {
          return asyncCall(batch.driver.setItem, item.relativeKey, stringify(item.value), item.options);
        }));
      });
    },
    async setItemRaw(key, value, opts = {}) {
      if (value === void 0) {
        return storage.removeItem(key, opts);
      }
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      if (driver.setItemRaw) {
        await asyncCall(driver.setItemRaw, relativeKey, value, opts);
      } else if (driver.setItem) {
        await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts);
      } else {
        return;
      }
      if (!driver.watch) {
        onChange("update", key);
      }
    },
    async removeItem(key, opts = {}) {
      if (typeof opts === "boolean") {
        opts = { removeMeta: opts };
      }
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      if (!driver.removeItem) {
        return;
      }
      await asyncCall(driver.removeItem, relativeKey, opts);
      if (opts.removeMeta || opts.removeMata) {
        await asyncCall(driver.removeItem, relativeKey + "$", opts);
      }
      if (!driver.watch) {
        onChange("remove", key);
      }
    },
    async getMeta(key, opts = {}) {
      if (typeof opts === "boolean") {
        opts = { nativeOnly: opts };
      }
      key = normalizeKey(key);
      const { relativeKey, driver } = getMount(key);
      const meta = /* @__PURE__ */ Object.create(null);
      if (driver.getMeta) {
        Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts));
      }
      if (!opts.nativeOnly) {
        const value = await asyncCall(driver.getItem, relativeKey + "$", opts).then((value_) => destr(value_));
        if (value && typeof value === "object") {
          if (typeof value.atime === "string") {
            value.atime = new Date(value.atime);
          }
          if (typeof value.mtime === "string") {
            value.mtime = new Date(value.mtime);
          }
          Object.assign(meta, value);
        }
      }
      return meta;
    },
    setMeta(key, value, opts = {}) {
      return this.setItem(key + "$", value, opts);
    },
    removeMeta(key, opts = {}) {
      return this.removeItem(key + "$", opts);
    },
    async getKeys(base, opts = {}) {
      base = normalizeBaseKey(base);
      const mounts = getMounts(base, true);
      let maskedMounts = [];
      const allKeys = [];
      let allMountsSupportMaxDepth = true;
      for (const mount of mounts) {
        if (!mount.driver.flags?.maxDepth) {
          allMountsSupportMaxDepth = false;
        }
        const rawKeys = await asyncCall(mount.driver.getKeys, mount.relativeBase, opts);
        for (const key of rawKeys) {
          const fullKey = mount.mountpoint + normalizeKey(key);
          if (!maskedMounts.some((p) => fullKey.startsWith(p))) {
            allKeys.push(fullKey);
          }
        }
        maskedMounts = [
          mount.mountpoint,
          ...maskedMounts.filter((p) => !p.startsWith(mount.mountpoint))
        ];
      }
      const shouldFilterByDepth = opts.maxDepth !== void 0 && !allMountsSupportMaxDepth;
      return allKeys.filter((key) => (!shouldFilterByDepth || filterKeyByDepth(key, opts.maxDepth)) && filterKeyByBase(key, base));
    },
    async clear(base, opts = {}) {
      base = normalizeBaseKey(base);
      await Promise.all(getMounts(base, false).map(async (m) => {
        if (m.driver.clear) {
          return asyncCall(m.driver.clear, m.relativeBase, opts);
        }
        if (m.driver.removeItem) {
          const keys = await m.driver.getKeys(m.relativeBase || "", opts);
          return Promise.all(keys.map((key) => m.driver.removeItem(key, opts)));
        }
      }));
    },
    async dispose() {
      await Promise.all(Object.values(context.mounts).map((driver) => dispose(driver)));
    },
    async watch(callback) {
      await startWatch();
      context.watchListeners.push(callback);
      return async () => {
        context.watchListeners = context.watchListeners.filter((listener) => listener !== callback);
        if (context.watchListeners.length === 0) {
          await stopWatch();
        }
      };
    },
    async unwatch() {
      context.watchListeners = [];
      await stopWatch();
    },
    mount(base, driver) {
      base = normalizeBaseKey(base);
      if (base && context.mounts[base]) {
        throw new Error(`already mounted at ${base}`);
      }
      if (base) {
        context.mountpoints.push(base);
        context.mountpoints.sort((a, b3) => b3.length - a.length);
      }
      context.mounts[base] = driver;
      if (context.watching) {
        Promise.resolve(watch(driver, onChange, base)).then((unwatcher) => {
          context.unwatch[base] = unwatcher;
        }).catch(console.error);
      }
      return storage;
    },
    async unmount(base, _dispose = true) {
      base = normalizeBaseKey(base);
      if (!base || !context.mounts[base]) {
        return;
      }
      if (context.watching && base in context.unwatch) {
        context.unwatch[base]?.();
        delete context.unwatch[base];
      }
      if (_dispose) {
        await dispose(context.mounts[base]);
      }
      context.mountpoints = context.mountpoints.filter((key) => key !== base);
      delete context.mounts[base];
    },
    getMount(key = "") {
      key = normalizeKey(key) + ":";
      const m = getMount(key);
      return {
        driver: m.driver,
        base: m.base
      };
    },
    getMounts(base = "", opts = {}) {
      base = normalizeKey(base);
      const mounts = getMounts(base, opts.parents);
      return mounts.map((m) => ({
        driver: m.driver,
        base: m.mountpoint
      }));
    },
    keys: (base, opts = {}) => storage.getKeys(base, opts),
    get: (key, opts = {}) => storage.getItem(key, opts),
    set: (key, value, opts = {}) => storage.setItem(key, value, opts),
    has: (key, opts = {}) => storage.hasItem(key, opts),
    del: (key, opts = {}) => storage.removeItem(key, opts),
    remove: (key, opts = {}) => storage.removeItem(key, opts)
  };
  return storage;
}
function watch(driver, onChange, base) {
  return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => {
  };
}
async function dispose(driver) {
  if (typeof driver.dispose === "function") {
    await asyncCall(driver.dispose);
  }
}
function memoryDriver() {
  return {
    async createStorage() {
      return createStorage();
    }
  };
}
var logger6, PREFIX, INDEX_BY_NAME, INDEX_BY_CONTAINER, StorageImageRepository, logger23, PREFIX2, StorageContainerRepository, logger33, PREFIX3, MESSAGES_PREFIX, INDEX_BY_IMAGE, INDEX_BY_CONTAINER2, StorageSessionRepository, logger42, PersistenceImpl, suspectProtoRx, suspectConstructorRx, JsonSigRx, BASE64_PREFIX, DRIVER_NAME, memory;
var init_dist3 = __esm({
  "../../../packages/persistence/dist/index.js"() {
    init_dist();
    init_dist();
    init_dist();
    init_dist();
    logger6 = createLogger("persistence/ImageRepository");
    PREFIX = "images";
    INDEX_BY_NAME = "idx:images:name";
    INDEX_BY_CONTAINER = "idx:images:container";
    StorageImageRepository = class {
      storage;
      constructor(storage) {
        this.storage = storage;
      }
      key(imageId) {
        return `${PREFIX}:${imageId}`;
      }
      nameIndexKey(name, imageId) {
        return `${INDEX_BY_NAME}:${name}:${imageId}`;
      }
      containerIndexKey(containerId, imageId) {
        return `${INDEX_BY_CONTAINER}:${containerId}:${imageId}`;
      }
      async saveImage(record) {
        await this.storage.setItem(this.key(record.imageId), record);
        await this.storage.setItem(this.nameIndexKey(record.name, record.imageId), record.imageId);
        await this.storage.setItem(this.containerIndexKey(record.containerId, record.imageId), record.imageId);
        logger6.debug("Image saved", { imageId: record.imageId });
      }
      async findImageById(imageId) {
        const record = await this.storage.getItem(this.key(imageId));
        return record ?? null;
      }
      async findAllImages() {
        const keys = await this.storage.getKeys(`${PREFIX}:`);
        const records = [];
        for (const key of keys) {
          if (key.startsWith("idx:"))
            continue;
          const record = await this.storage.getItem(key);
          if (record) {
            records.push(record);
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async findImagesByName(name) {
        const indexPrefix = `${INDEX_BY_NAME}:${name}:`;
        const keys = await this.storage.getKeys(indexPrefix);
        const records = [];
        for (const key of keys) {
          const imageId = await this.storage.getItem(key);
          if (imageId) {
            const record = await this.findImageById(imageId);
            if (record) {
              records.push(record);
            }
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async findImagesByContainerId(containerId) {
        const indexPrefix = `${INDEX_BY_CONTAINER}:${containerId}:`;
        const keys = await this.storage.getKeys(indexPrefix);
        const records = [];
        for (const key of keys) {
          const imageId = await this.storage.getItem(key);
          if (imageId) {
            const record = await this.findImageById(imageId);
            if (record) {
              records.push(record);
            }
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async deleteImage(imageId) {
        const record = await this.findImageById(imageId);
        await this.storage.removeItem(this.key(imageId));
        if (record) {
          await this.storage.removeItem(this.nameIndexKey(record.name, imageId));
          await this.storage.removeItem(this.containerIndexKey(record.containerId, imageId));
        }
        logger6.debug("Image deleted", { imageId });
      }
      async imageExists(imageId) {
        return await this.storage.hasItem(this.key(imageId));
      }
      async updateMetadata(imageId, metadata) {
        const record = await this.findImageById(imageId);
        if (!record) {
          throw new Error(`Image not found: ${imageId}`);
        }
        const updatedRecord = {
          ...record,
          metadata: {
            ...record.metadata,
            ...metadata
          },
          updatedAt: Date.now()
        };
        await this.storage.setItem(this.key(imageId), updatedRecord);
        logger6.debug("Image metadata updated", { imageId, metadata });
      }
    };
    logger23 = createLogger("persistence/ContainerRepository");
    PREFIX2 = "containers";
    StorageContainerRepository = class {
      storage;
      constructor(storage) {
        this.storage = storage;
      }
      key(containerId) {
        return `${PREFIX2}:${containerId}`;
      }
      async saveContainer(record) {
        await this.storage.setItem(this.key(record.containerId), record);
        logger23.debug("Container saved", { containerId: record.containerId });
      }
      async findContainerById(containerId) {
        const record = await this.storage.getItem(this.key(containerId));
        return record ?? null;
      }
      async findAllContainers() {
        const keys = await this.storage.getKeys(PREFIX2);
        const records = [];
        for (const key of keys) {
          const record = await this.storage.getItem(key);
          if (record) {
            records.push(record);
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async deleteContainer(containerId) {
        await this.storage.removeItem(this.key(containerId));
        logger23.debug("Container deleted", { containerId });
      }
      async containerExists(containerId) {
        return await this.storage.hasItem(this.key(containerId));
      }
    };
    logger33 = createLogger("persistence/SessionRepository");
    PREFIX3 = "sessions";
    MESSAGES_PREFIX = "messages";
    INDEX_BY_IMAGE = "idx:sessions:image";
    INDEX_BY_CONTAINER2 = "idx:sessions:container";
    StorageSessionRepository = class {
      storage;
      constructor(storage) {
        this.storage = storage;
      }
      key(sessionId) {
        return `${PREFIX3}:${sessionId}`;
      }
      messagesKey(sessionId) {
        return `${MESSAGES_PREFIX}:${sessionId}`;
      }
      imageIndexKey(imageId, sessionId) {
        return `${INDEX_BY_IMAGE}:${imageId}:${sessionId}`;
      }
      containerIndexKey(containerId, sessionId) {
        return `${INDEX_BY_CONTAINER2}:${containerId}:${sessionId}`;
      }
      async saveSession(record) {
        await this.storage.setItem(this.key(record.sessionId), record);
        await this.storage.setItem(this.imageIndexKey(record.imageId, record.sessionId), record.sessionId);
        await this.storage.setItem(this.containerIndexKey(record.containerId, record.sessionId), record.sessionId);
        logger33.debug("Session saved", { sessionId: record.sessionId });
      }
      async findSessionById(sessionId) {
        const record = await this.storage.getItem(this.key(sessionId));
        return record ?? null;
      }
      async findSessionByImageId(imageId) {
        const indexPrefix = `${INDEX_BY_IMAGE}:${imageId}`;
        const keys = await this.storage.getKeys(indexPrefix);
        if (keys.length === 0)
          return null;
        const sessionId = await this.storage.getItem(keys[0]);
        if (!sessionId)
          return null;
        return this.findSessionById(sessionId);
      }
      async findSessionsByContainerId(containerId) {
        const indexPrefix = `${INDEX_BY_CONTAINER2}:${containerId}`;
        const keys = await this.storage.getKeys(indexPrefix);
        const records = [];
        for (const key of keys) {
          const sessionId = await this.storage.getItem(key);
          if (sessionId) {
            const record = await this.findSessionById(sessionId);
            if (record) {
              records.push(record);
            }
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async findAllSessions() {
        const keys = await this.storage.getKeys(PREFIX3);
        const records = [];
        for (const key of keys) {
          if (key.startsWith("idx:"))
            continue;
          const record = await this.storage.getItem(key);
          if (record) {
            records.push(record);
          }
        }
        return records.sort((a, b3) => b3.createdAt - a.createdAt);
      }
      async deleteSession(sessionId) {
        const record = await this.findSessionById(sessionId);
        await this.storage.removeItem(this.key(sessionId));
        await this.storage.removeItem(this.messagesKey(sessionId));
        if (record) {
          await this.storage.removeItem(this.imageIndexKey(record.imageId, sessionId));
          await this.storage.removeItem(this.containerIndexKey(record.containerId, sessionId));
        }
        logger33.debug("Session deleted", { sessionId });
      }
      async sessionExists(sessionId) {
        return await this.storage.hasItem(this.key(sessionId));
      }
      async addMessage(sessionId, message) {
        const messages = await this.getMessages(sessionId);
        messages.push(message);
        await this.storage.setItem(this.messagesKey(sessionId), messages);
        logger33.debug("Message added to session", { sessionId, subtype: message.subtype });
      }
      async getMessages(sessionId) {
        const messages = await this.storage.getItem(this.messagesKey(sessionId));
        if (!messages || !Array.isArray(messages)) {
          if (messages) {
            logger33.warn("Messages data is not an array, resetting", {
              sessionId,
              type: typeof messages
            });
          }
          return [];
        }
        return messages;
      }
      async clearMessages(sessionId) {
        await this.storage.removeItem(this.messagesKey(sessionId));
        logger33.debug("Messages cleared for session", { sessionId });
      }
    };
    logger42 = createLogger("persistence/Persistence");
    PersistenceImpl = class {
      images;
      containers;
      sessions;
      constructor(storage) {
        this.images = new StorageImageRepository(storage);
        this.containers = new StorageContainerRepository(storage);
        this.sessions = new StorageSessionRepository(storage);
      }
    };
    suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
    suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
    JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
    BASE64_PREFIX = "base64:";
    DRIVER_NAME = "memory";
    memory = defineDriver(() => {
      const data = /* @__PURE__ */ new Map();
      return {
        name: DRIVER_NAME,
        getInstance: () => data,
        hasItem(key) {
          return data.has(key);
        },
        getItem(key) {
          return data.get(key) ?? null;
        },
        getItemRaw(key) {
          return data.get(key) ?? null;
        },
        setItem(key, value) {
          data.set(key, value);
        },
        setItemRaw(key, value) {
          data.set(key, value);
        },
        removeItem(key) {
          data.delete(key);
        },
        getKeys() {
          return [...data.keys()];
        },
        clear() {
          data.clear();
        },
        dispose() {
          data.clear();
        }
      };
    });
  }
});

// ../../../packages/runtime/dist/index.js
var dist_exports3 = {};
__export(dist_exports3, {
  RuntimeEnvironment: () => RuntimeEnvironment,
  createPersistence: () => createPersistence,
  createRuntime: () => createRuntime,
  memoryDriver: () => memoryDriver
});
function isTextPart(part) {
  return part.type === "text";
}
function isImagePart(part) {
  return part.type === "image";
}
function isFilePart(part) {
  return part.type === "file";
}
function isUrl(str) {
  if (!str)
    return false;
  return str.startsWith("http://") || str.startsWith("https://");
}
function isLikelyWorkdirPath(str) {
  if (!str)
    return false;
  return str.startsWith("uploads/") || str.startsWith("./") || str.startsWith("../") || str.startsWith("file://");
}
function buildSDKContent(message) {
  if (typeof message.content === "string") {
    return message.content;
  }
  if (!Array.isArray(message.content)) {
    logger52.warn("buildSDKContent: content is not an array", {
      contentType: typeof message.content,
      content: message.content
    });
    return "";
  }
  const parts = message.content;
  logger52.debug("buildSDKContent: processing parts", {
    partsCount: parts.length,
    partTypes: parts.map((p) => p.type)
  });
  const hasNonTextParts = parts.some((p) => !isTextPart(p));
  if (!hasNonTextParts) {
    return parts.filter(isTextPart).map((p) => p.text).join(`
`);
  }
  return parts.map((part, index) => {
    if (isTextPart(part)) {
      return {
        type: "text",
        text: part.text
      };
    }
    if (isImagePart(part)) {
      logger52.debug("buildSDKContent: processing image part", {
        index,
        hasData: !!part.data,
        dataType: typeof part.data,
        dataLength: part.data?.length,
        dataPreview: part.data?.substring(0, 100),
        mediaType: part.mediaType,
        name: part.name
      });
      if (!part.data) {
        logger52.warn("buildSDKContent: image part has no data", {
          index,
          part: JSON.stringify(part).substring(0, 200)
        });
        return { type: "text", text: "[Image data missing]" };
      }
      if (isUrl(part.data)) {
        logger52.debug("buildSDKContent: image is URL", { url: part.data });
        return {
          type: "image",
          source: {
            type: "url",
            url: part.data
          }
        };
      }
      const rawBase64 = part.data.includes(",") ? part.data.split(",")[1] : part.data;
      logger52.debug("buildSDKContent: image is base64", {
        dataLength: rawBase64.length
      });
      return {
        type: "image",
        source: {
          type: "base64",
          media_type: part.mediaType || "image/png",
          data: rawBase64
        }
      };
    }
    if (isFilePart(part)) {
      logger52.debug("buildSDKContent: processing file part", {
        index,
        hasData: !!part.data,
        dataType: typeof part.data,
        filename: part.filename,
        mediaType: part.mediaType
      });
      if (!part.data) {
        logger52.warn("buildSDKContent: file part has no data", {
          index,
          part: JSON.stringify(part).substring(0, 200)
        });
        return { type: "text", text: "[File data missing]" };
      }
      if (isLikelyWorkdirPath(part.data)) {
        const fileHint = [
          "File available on disk.",
          part.filename ? `filename: ${part.filename}` : null,
          `path: ${part.data}`,
          part.mediaType ? `media_type: ${part.mediaType}` : null,
          "Use tools to read the file from the current working directory if path is relative."
        ].filter(Boolean).join(`
`);
        return { type: "text", text: fileHint };
      }
      const rawDocBase64 = part.data.includes(",") ? part.data.split(",")[1] : part.data;
      return {
        type: "document",
        source: {
          type: "base64",
          media_type: part.mediaType || "application/octet-stream",
          data: rawDocBase64
        }
      };
    }
    logger52.warn("buildSDKContent: unknown part type", {
      index,
      partType: part.type
    });
    return { type: "text", text: "" };
  });
}
function buildSDKUserMessage(message, sessionId) {
  return {
    type: "user",
    message: { role: "user", content: buildSDKContent(message) },
    parent_tool_use_id: null,
    session_id: sessionId
  };
}
function detectGitBashPath() {
  if (process.platform !== "win32") {
    return;
  }
  const candidates = [
    "C:\\Program Files\\Git\\bin\\bash.exe",
    "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
    (0, import_node_path.join)((0, import_node_os.homedir)(), "AppData", "Local", "Programs", "Git", "bin", "bash.exe"),
    (0, import_node_path.join)((0, import_node_os.homedir)(), "scoop", "apps", "git", "current", "bin", "bash.exe"),
    "C:\\tools\\git\\bin\\bash.exe",
    process.env.GIT_BASH_PATH
  ].filter(Boolean);
  for (const path2 of candidates) {
    if ((0, import_node_fs.existsSync)(path2)) {
      logger62.info("Auto-detected git-bash path", { path: path2 });
      return path2;
    }
  }
  logger62.warn("Could not auto-detect git-bash path on Windows", { checkedPaths: candidates });
  return;
}
function detectClaudeCodePath() {
  const platform2 = process.platform;
  const candidates = [];
  if (platform2 === "win32") {
    const appData = process.env.APPDATA || (0, import_node_path.join)((0, import_node_os.homedir)(), "AppData", "Roaming");
    candidates.push((0, import_node_path.join)(appData, "npm", "node_modules", "@anthropic-ai", "claude-code", "cli.js"), (0, import_node_path.join)(appData, "npm", "node_modules", "claude-code", "cli.js"));
    const programFiles = process.env.ProgramFiles || "C:\\Program Files";
    candidates.push((0, import_node_path.join)(programFiles, "Claude", "cli.js"));
  } else {
    const npmPrefix = process.env.npm_config_prefix || "/usr/local";
    candidates.push((0, import_node_path.join)(npmPrefix, "lib", "node_modules", "@anthropic-ai", "claude-code", "cli.js"), (0, import_node_path.join)((0, import_node_os.homedir)(), ".npm-global", "lib", "node_modules", "@anthropic-ai", "claude-code", "cli.js"), "/usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js");
  }
  for (const path2 of candidates) {
    if ((0, import_node_fs.existsSync)(path2)) {
      logger62.info("Auto-detected Claude Code path", { path: path2 });
      return path2;
    }
  }
  logger62.warn("Could not auto-detect Claude Code path", { checkedPaths: candidates });
  return;
}
function buildOptions(context, abortController) {
  const options = {
    abortController,
    includePartialMessages: true
  };
  if (context.cwd) {
    options.cwd = context.cwd;
  }
  const env = {};
  for (const [key, value] of Object.entries(process.env)) {
    if (value !== void 0) {
      env[key] = value;
    }
  }
  if (!env.PATH && process.env.PATH) {
    env.PATH = process.env.PATH;
  }
  env.AGENTX_ENVIRONMENT = "true";
  if (process.platform === "win32" && !env.CLAUDE_CODE_GIT_BASH_PATH) {
    let gitBashPath = RuntimeEnvironment.getGitBashPath();
    if (!gitBashPath) {
      gitBashPath = detectGitBashPath();
    }
    if (gitBashPath) {
      env.CLAUDE_CODE_GIT_BASH_PATH = gitBashPath;
      logger62.info("Setting CLAUDE_CODE_GIT_BASH_PATH", { gitBashPath });
      const gitBashDir = (0, import_node_path.join)(gitBashPath, "..", "..");
      const gitBashBin = (0, import_node_path.join)(gitBashDir, "bin");
      const gitBashUsrBin = (0, import_node_path.join)(gitBashDir, "usr", "bin");
      const pathSeparator = ";";
      const currentPath = env.PATH || "";
      const newPaths = [gitBashUsrBin, gitBashBin].filter((p) => (0, import_node_fs.existsSync)(p));
      if (newPaths.length > 0) {
        env.PATH = newPaths.join(pathSeparator) + pathSeparator + currentPath;
        logger62.info("Added git-bash directories to PATH", { paths: newPaths });
      }
    } else {
      logger62.error("Git Bash not found on Windows. Claude Code SDK requires git-bash. Please install Git for Windows from https://git-scm.com/downloads/win or set CLAUDE_CODE_GIT_BASH_PATH environment variable.");
    }
  }
  if (!env.CLAUDE_CONFIG_DIR) {
    const configDir = context.cwd || (0, import_node_os.homedir)();
    env.CLAUDE_CONFIG_DIR = configDir;
    logger62.info("Setting CLAUDE_CONFIG_DIR", { configDir });
  }
  if (context.baseUrl) {
    env.ANTHROPIC_BASE_URL = context.baseUrl;
  }
  if (context.apiKey) {
    env.ANTHROPIC_API_KEY = context.apiKey;
  }
  options.env = env;
  logger62.info("buildOptions called", {
    hasPath: !!env.PATH,
    pathLength: env.PATH?.length,
    hasApiKey: !!env.ANTHROPIC_API_KEY,
    hasBaseUrl: !!env.ANTHROPIC_BASE_URL,
    baseUrl: env.ANTHROPIC_BASE_URL,
    model: context.model,
    permissionMode: context.permissionMode || "bypassPermissions",
    cwd: context.cwd,
    systemPrompt: context.systemPrompt,
    mcpServers: context.mcpServers ? Object.keys(context.mcpServers) : []
  });
  options.stderr = (data) => {
    logger62.info("SDK stderr", { data: data.trim() });
  };
  let claudeCodePath = RuntimeEnvironment.getClaudeCodePath();
  if (!claudeCodePath) {
    claudeCodePath = detectClaudeCodePath();
  }
  if (claudeCodePath) {
    options.pathToClaudeCodeExecutable = claudeCodePath;
    logger62.info("Claude Code path configured", { path: claudeCodePath });
  } else {
    logger62.error("Claude Code executable not found. Please install Claude Code CLI globally: npm install -g @anthropic-ai/claude-code");
  }
  const nodePath = RuntimeEnvironment.getNodePath();
  if (nodePath) {
    options.executable = nodePath;
    logger62.info("Using bundled Node.js", { path: nodePath });
  }
  if (context.model)
    options.model = context.model;
  if (context.systemPrompt)
    options.systemPrompt = context.systemPrompt;
  if (context.maxTurns)
    options.maxTurns = context.maxTurns;
  if (context.maxThinkingTokens)
    options.maxThinkingTokens = context.maxThinkingTokens;
  const isNonClaudeModel = !!context.model && !context.model.startsWith("claude");
  const webToolsToDisallow = isNonClaudeModel ? ["WebSearch", "WebFetch"] : [];
  if (webToolsToDisallow.length > 0) {
    logger62.info("Non-Claude model detected, disabling Anthropic-only web tools", {
      model: context.model,
      disabling: webToolsToDisallow
    });
  }
  const mergedDisallowedTools = [
    ...context.disallowedTools ?? [],
    ...webToolsToDisallow
  ];
  if (mergedDisallowedTools.length > 0)
    options.disallowedTools = mergedDisallowedTools;
  if (context.tools)
    options.tools = context.tools;
  if (context.resume)
    options.resume = context.resume;
  if (context.mcpServers) {
    options.mcpServers = context.mcpServers;
    logger62.info("MCP servers configured", {
      serverNames: Object.keys(context.mcpServers)
    });
  }
  if (context.permissionMode) {
    options.permissionMode = context.permissionMode;
    if (context.permissionMode === "bypassPermissions") {
      options.allowDangerouslySkipPermissions = true;
    }
  } else {
    options.permissionMode = "bypassPermissions";
    options.allowDangerouslySkipPermissions = true;
  }
  options.settingSources = ["project"];
  logger62.info("SDK Options built", {
    model: options.model,
    systemPrompt: options.systemPrompt,
    permissionMode: options.permissionMode,
    cwd: options.cwd,
    resume: options.resume,
    maxTurns: options.maxTurns,
    mcpServers: options.mcpServers ? Object.keys(options.mcpServers) : [],
    settingSources: options.settingSources,
    disallowedTools: options.disallowedTools,
    tools: options.tools
  });
  return options;
}
async function* observableToAsyncIterable(observable) {
  const queue = [];
  let resolve4 = null;
  let reject = null;
  let done = false;
  let error = null;
  const subscription = observable.subscribe({
    next: (value) => {
      if (resolve4) {
        resolve4({ value, done: false });
        resolve4 = null;
        reject = null;
      } else {
        queue.push(value);
      }
    },
    error: (err) => {
      error = err instanceof Error ? err : new Error(String(err));
      done = true;
      if (reject) {
        reject(error);
        resolve4 = null;
        reject = null;
      }
    },
    complete: () => {
      done = true;
      if (resolve4) {
        resolve4({ value: void 0, done: true });
        resolve4 = null;
        reject = null;
      }
    }
  });
  try {
    while (!done || queue.length > 0) {
      if (error) {
        throw error;
      }
      if (queue.length > 0) {
        yield queue.shift();
      } else if (!done) {
        const result = await new Promise((res, rej) => {
          resolve4 = (iterResult) => {
            if (iterResult.done) {
              done = true;
              res({ done: true });
            } else {
              res({ value: iterResult.value, done: false });
            }
          };
          reject = rej;
        });
        if (!result.done) {
          yield result.value;
        }
      }
    }
  } finally {
    subscription.unsubscribe();
  }
}
function createResponse(type, data) {
  return {
    type,
    timestamp: Date.now(),
    data,
    source: "command",
    category: "response",
    intent: "result"
  };
}
function createSystemError(message, requestId, context, stack) {
  return {
    type: "system_error",
    timestamp: Date.now(),
    source: "command",
    category: "error",
    intent: "notification",
    data: {
      message,
      requestId,
      severity: "error",
      details: stack
    },
    context
  };
}
function createRuntime(config) {
  return new RuntimeImpl(config);
}
var import_rxjs, import_rxjs2, import_node_fs, import_node_path, import_node_os, import_promises2, import_node_path2, fs, path, logger7, SystemBusImpl, logger24, BusDriver, logger34, AgentInteractor, logger43, ClaudeReceptor, logger52, RuntimeEnvironment, logger62, logger72, SDKQueryLifecycle, logger8, DEFAULT_TIMEOUT, TOOL_EXECUTION_TIMEOUT, ClaudeEffector, ClaudeEnvironment, logger9, BusPresenter, RuntimeAgent, RuntimeSession, logger10, RuntimeWorkdir, RuntimeSandbox, logger11, RuntimeImage, logger12, RuntimeContainer, logger13, BaseEventHandler, logger14, CommandHandler, logger15, RuntimeImpl;
var init_dist4 = __esm({
  "../../../packages/runtime/dist/index.js"() {
    import_rxjs = __toESM(require_cjs(), 1);
    init_dist();
    init_dist();
    init_dist();
    init_dist2();
    init_dist();
    init_dist();
    init_dist();
    init_dist();
    init_sdk();
    import_rxjs2 = __toESM(require_cjs(), 1);
    init_dist();
    init_dist();
    import_node_fs = require("node:fs");
    import_node_path = require("node:path");
    import_node_os = require("node:os");
    import_promises2 = require("node:fs/promises");
    import_node_path2 = require("node:path");
    init_dist();
    init_dist();
    init_dist();
    init_dist();
    init_dist();
    init_dist();
    fs = __toESM(require("node:fs/promises"), 1);
    path = __toESM(require("node:path"), 1);
    init_dist3();
    logger7 = createLogger("runtime/SystemBusImpl");
    SystemBusImpl = class {
      subject = new import_rxjs.Subject();
      subscriptions = [];
      nextId = 0;
      isDestroyed = false;
      producerView = null;
      consumerView = null;
      constructor() {
        this.subject.subscribe((event) => {
          this.dispatch(event);
        });
      }
      emit(event) {
        if (this.isDestroyed)
          return;
        this.subject.next(event);
      }
      emitBatch(events) {
        for (const event of events) {
          this.emit(event);
        }
      }
      on(typeOrTypes, handler, options) {
        if (this.isDestroyed)
          return () => {
          };
        const subscription = {
          id: this.nextId++,
          type: typeOrTypes,
          handler,
          filter: options?.filter,
          priority: options?.priority ?? 0,
          once: options?.once ?? false
        };
        this.subscriptions.push(subscription);
        this.sortByPriority();
        return () => this.removeSubscription(subscription.id);
      }
      onAny(handler, options) {
        if (this.isDestroyed)
          return () => {
          };
        const subscription = {
          id: this.nextId++,
          type: "*",
          handler,
          filter: options?.filter,
          priority: options?.priority ?? 0,
          once: options?.once ?? false
        };
        this.subscriptions.push(subscription);
        this.sortByPriority();
        return () => this.removeSubscription(subscription.id);
      }
      once(type, handler) {
        return this.on(type, handler, { once: true });
      }
      onCommand(type, handler) {
        return this.on(type, handler);
      }
      emitCommand(type, data) {
        this.emit({
          type,
          timestamp: Date.now(),
          data,
          source: "command",
          category: type.endsWith("_response") ? "response" : "request",
          intent: type.endsWith("_response") ? "result" : "request"
        });
      }
      request(type, data, timeout = 3e4) {
        return new Promise((resolve4, reject) => {
          const requestId = `req_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
          const responseType = type.replace("_request", "_response");
          const timer = setTimeout(() => {
            unsubscribe();
            reject(new Error(`Request timeout: ${type}`));
          }, timeout);
          const unsubscribe = this.onCommand(responseType, (event) => {
            if (event.data.requestId === requestId) {
              clearTimeout(timer);
              unsubscribe();
              resolve4(event);
            }
          });
          this.emitCommand(type, { ...data, requestId });
        });
      }
      destroy() {
        if (this.isDestroyed)
          return;
        this.isDestroyed = true;
        this.subscriptions = [];
        this.subject.complete();
      }
      dispatch(event) {
        const toRemove = [];
        for (const sub of this.subscriptions) {
          if (!this.matchesType(sub.type, event.type))
            continue;
          if (sub.filter && !sub.filter(event))
            continue;
          try {
            sub.handler(event);
          } catch (err) {
            logger7.error("Event handler error", {
              eventType: event.type,
              subscriptionType: sub.type,
              error: err instanceof Error ? err.message : String(err),
              stack: err instanceof Error ? err.stack : void 0
            });
          }
          if (sub.once) {
            toRemove.push(sub.id);
          }
        }
        for (const id of toRemove) {
          this.removeSubscription(id);
        }
      }
      matchesType(subscriptionType, eventType) {
        if (subscriptionType === "*")
          return true;
        if (Array.isArray(subscriptionType))
          return subscriptionType.includes(eventType);
        return subscriptionType === eventType;
      }
      sortByPriority() {
        this.subscriptions.sort((a, b3) => b3.priority - a.priority);
      }
      removeSubscription(id) {
        this.subscriptions = this.subscriptions.filter((s) => s.id !== id);
      }
      asConsumer() {
        if (!this.consumerView) {
          this.consumerView = {
            on: this.on.bind(this),
            onAny: this.onAny.bind(this),
            once: this.once.bind(this),
            onCommand: this.onCommand.bind(this),
            request: this.request.bind(this)
          };
        }
        return this.consumerView;
      }
      asProducer() {
        if (!this.producerView) {
          this.producerView = {
            emit: this.emit.bind(this),
            emitBatch: this.emitBatch.bind(this),
            emitCommand: this.emitCommand.bind(this)
          };
        }
        return this.producerView;
      }
    };
    logger24 = createLogger("runtime/BusDriver");
    BusDriver = class {
      name = "BusDriver";
      description = "Driver that listens to SystemBus for DriveableEvents";
      config;
      unsubscribe;
      constructor(consumer, config) {
        this.config = config;
        logger24.debug("BusDriver created, subscribing to bus", {
          agentId: config.agentId
        });
        this.unsubscribe = consumer.onAny((event) => {
          this.handleEvent(event);
        });
      }
      handleEvent(event) {
        if (!this.isDriveableEventForThisAgent(event)) {
          return;
        }
        const driveableEvent = event;
        logger24.debug("BusDriver received DriveableEvent", {
          type: driveableEvent.type,
          agentId: this.config.agentId,
          requestId: driveableEvent.requestId
        });
        const streamEvent = this.toStreamEvent(driveableEvent);
        this.config.onStreamEvent(streamEvent);
        if (driveableEvent.type === "message_stop") {
          this.config.onStreamComplete?.("message_stop");
        } else if (driveableEvent.type === "interrupted") {
          this.config.onStreamComplete?.("interrupted");
        }
      }
      isDriveableEventForThisAgent(event) {
        const driveableTypes = [
          "message_start",
          "message_delta",
          "message_stop",
          "text_content_block_start",
          "text_delta",
          "text_content_block_stop",
          "tool_use_content_block_start",
          "input_json_delta",
          "tool_use_content_block_stop",
          "tool_call",
          "tool_result",
          "interrupted",
          "error_received"
        ];
        if (event === null || typeof event !== "object" || !("type" in event) || typeof event.type !== "string") {
          return false;
        }
        const e3 = event;
        if (e3.source !== "environment") {
          return false;
        }
        if (!driveableTypes.includes(e3.type)) {
          return false;
        }
        if (e3.context?.agentId !== this.config.agentId) {
          return false;
        }
        return true;
      }
      toStreamEvent(event) {
        const { type, timestamp, data } = event;
        switch (type) {
          case "message_start": {
            const d3 = data;
            return {
              type: "message_start",
              timestamp,
              data: {
                messageId: d3.message?.id ?? "",
                model: d3.message?.model ?? ""
              }
            };
          }
          case "message_stop": {
            const d3 = data;
            return {
              type: "message_stop",
              timestamp,
              data: {
                stopReason: d3.stopReason
              }
            };
          }
          case "text_delta": {
            const d3 = data;
            return {
              type: "text_delta",
              timestamp,
              data: { text: d3.text }
            };
          }
          case "tool_use_content_block_start": {
            const d3 = data;
            return {
              type: "tool_use_start",
              timestamp,
              data: {
                toolCallId: d3.toolCallId ?? d3.id ?? "",
                toolName: d3.toolName ?? d3.name ?? ""
              }
            };
          }
          case "input_json_delta": {
            const d3 = data;
            return {
              type: "input_json_delta",
              timestamp,
              data: { partialJson: d3.partialJson }
            };
          }
          case "tool_use_content_block_stop": {
            const d3 = data;
            return {
              type: "tool_use_stop",
              timestamp,
              data: {
                toolCallId: d3.toolCallId ?? d3.id ?? "",
                toolName: d3.toolName ?? d3.name ?? "",
                input: d3.input ?? {}
              }
            };
          }
          case "tool_result": {
            const d3 = data;
            return {
              type: "tool_result",
              timestamp,
              data: {
                toolCallId: d3.toolCallId ?? d3.toolUseId ?? "",
                result: d3.result,
                isError: d3.isError
              }
            };
          }
          case "interrupted": {
            return {
              type: "message_stop",
              timestamp,
              data: { stopReason: "end_turn" }
            };
          }
          case "error_received": {
            const d3 = data;
            return {
              type: "error_received",
              timestamp,
              data: {
                message: d3.message,
                errorCode: d3.errorCode
              }
            };
          }
          default:
            return { type, timestamp, data };
        }
      }
      dispose() {
        logger24.debug("BusDriver disposing", { agentId: this.config.agentId });
        this.unsubscribe();
      }
    };
    logger34 = createLogger("runtime/AgentInteractor");
    AgentInteractor = class {
      producer;
      session;
      context;
      constructor(producer, session, context) {
        this.producer = producer;
        this.session = session;
        this.context = context;
        logger34.debug("AgentInteractor created", { agentId: context.agentId });
      }
      async receive(content, requestId, userContext) {
        const contentPreview = typeof content === "string" ? content.substring(0, 50) : `[${content.length} parts]`;
        if (Array.isArray(content)) {
          logger34.info("AgentInteractor.receive - multimodal content", {
            requestId,
            agentId: this.context.agentId,
            partsCount: content.length,
            partTypes: content.map((p) => p.type),
            partDetails: content.map((p, i3) => ({
              index: i3,
              type: p.type,
              hasData: "data" in p ? !!p.data : void 0,
              dataType: "data" in p ? typeof p.data : void 0,
              dataLength: "data" in p && typeof p.data === "string" ? p.data.length : void 0
            }))
          });
        } else {
          logger34.debug("AgentInteractor.receive", {
            requestId,
            agentId: this.context.agentId,
            contentPreview,
            hasUserContext: !!userContext
          });
        }
        const userMessage = {
          id: `msg_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
          role: "user",
          subtype: "user",
          content,
          timestamp: Date.now()
        };
        await this.session.addMessage(userMessage);
        logger34.debug("UserMessage persisted", {
          messageId: userMessage.id,
          requestId
        });
        const eventContext = {
          agentId: this.context.agentId,
          imageId: this.context.imageId,
          containerId: this.context.containerId,
          sessionId: this.context.sessionId,
          userContext
        };
        this.producer.emit({
          type: "user_message",
          timestamp: Date.now(),
          data: userMessage,
          source: "agent",
          category: "message",
          intent: "request",
          requestId,
          context: eventContext,
          broadcastable: false
        });
        logger34.info("user_message event emitted to bus", {
          messageId: userMessage.id,
          requestId,
          agentId: this.context.agentId,
          eventType: "user_message",
          hasUserContext: !!userContext
        });
        return userMessage;
      }
      interrupt(requestId) {
        logger34.debug("AgentInteractor.interrupt", {
          requestId,
          agentId: this.context.agentId
        });
        const eventContext = {
          agentId: this.context.agentId,
          imageId: this.context.imageId,
          containerId: this.context.containerId,
          sessionId: this.context.sessionId
        };
        this.producer.emit({
          type: "interrupt",
          timestamp: Date.now(),
          data: { agentId: this.context.agentId },
          source: "agent",
          category: "action",
          intent: "request",
          requestId,
          context: eventContext,
          broadcastable: false
        });
      }
    };
    logger43 = createLogger("ecosystem/ClaudeReceptor");
    ClaudeReceptor = class {
      producer = null;
      currentMeta = null;
      blockContext = {
        currentBlockType: null,
        currentBlockIndex: 0,
        currentToolId: null,
        currentToolName: null,
        lastStopReason: null,
        lastStopSequence: null
      };
      connect(producer) {
        this.producer = producer;
        logger43.debug("ClaudeReceptor connected to SystemBusProducer");
      }
      feed(sdkMsg, meta) {
        this.currentMeta = meta;
        logger43.info("ClaudeReceptor.feed called", {
          eventType: sdkMsg?.event?.type,
          requestId: meta.requestId
        });
        this.processStreamEvent(sdkMsg);
      }
      emitInterrupted(reason, meta) {
        const eventMeta = meta || this.currentMeta;
        this.emitToBus({
          type: "interrupted",
          timestamp: Date.now(),
          source: "environment",
          category: "stream",
          intent: "notification",
          broadcastable: false,
          requestId: eventMeta?.requestId,
          context: eventMeta?.context,
          data: { reason }
        });
      }
      emitError(message, errorCode, meta) {
        const eventMeta = meta || this.currentMeta;
        this.emitToBus({
          type: "error_received",
          timestamp: Date.now(),
          source: "environment",
          category: "stream",
          intent: "notification",
          broadcastable: false,
          requestId: eventMeta?.requestId,
          context: eventMeta?.context,
          data: { message, errorCode }
        });
      }
      emitMessageStop(stopReason = "end_turn", meta) {
        const eventMeta = meta || this.currentMeta;
        logger43.info("emitMessageStop called", {
          stopReason,
          hasContext: !!eventMeta?.context,
          imageId: eventMeta?.context?.imageId,
          requestId: eventMeta?.requestId
        });
        if (!eventMeta?.context?.imageId) {
          logger43.warn("emitMessageStop: missing imageId in context - event may be filtered!", {
            hasEventMeta: !!eventMeta,
            hasContext: !!eventMeta?.context
          });
        }
        this.emitToBus({
          type: "message_stop",
          timestamp: Date.now(),
          source: "environment",
          category: "stream",
          intent: "notification",
          broadcastable: false,
          requestId: eventMeta?.requestId,
          context: eventMeta?.context,
          data: {
            stopReason,
            stopSequence: void 0
          }
        });
      }
      feedAssistantMessage(sdkMsg, meta) {
        this.currentMeta = meta;
        const { requestId, context } = meta;
        if (!sdkMsg.message) {
          logger43.warn("feedAssistantMessage: no message in sdkMsg");
          return;
        }
        const message = sdkMsg.message;
        const hasTextContent = Array.isArray(message.content) && message.content.some((block) => block && typeof block === "object" && "type" in block && block.type === "text" && "text" in block && block.text);
        const hasToolUseContent = Array.isArray(message.content) && message.content.some((block) => block && typeof block === "object" && "type" in block && block.type === "tool_use");
        logger43.info("feedAssistantMessage: processing non-streaming message", {
          messageId: message.id,
          contentLength: message.content?.length,
          contentTypes: message.content?.map((b3) => b3?.type),
          hasTextContent,
          hasToolUseContent,
          firstBlockText: message.content?.[0] && typeof message.content[0] === "object" && "text" in message.content[0] ? (message.content[0].text || "").substring(0, 100) : void 0,
          requestId,
          contextImageId: context?.imageId,
          contextAgentId: context?.agentId
        });
        if (!hasTextContent && !hasToolUseContent) {
          logger43.info("feedAssistantMessage: skipping empty message (no text or tool_use content)");
          return;
        }
        this.emitToBus({
          type: "message_start",
          timestamp: Date.now(),
          source: "environment",
          category: "stream",
          intent: "notification",
          broadcastable: false,
          requestId,
          context,
          data: {
            message: {
              id: message.id || `msg_${Date.now()}`,
              model: message.model || "unknown"
            }
          }
        });
        if (Array.isArray(message.content)) {
          message.content.forEach((block, index) => {
            if (block && typeof block === "object" && "type" in block) {
              const typedBlock = block;
              if (typedBlock.type === "text" && typedBlock.text) {
                this.emitToBus({
                  type: "text_content_block_start",
                  timestamp: Date.now(),
                  source: "environment",
                  category: "stream",
                  intent: "notification",
                  broadcastable: false,
                  index,
                  requestId,
                  context,
                  data: {}
                });
                const text = typedBlock.text;
                const chunkSize = 40;
                for (let i3 = 0; i3 < text.length; i3 += chunkSize) {
                  const chunk = text.slice(i3, i3 + chunkSize);
                  this.emitToBus({
                    type: "text_delta",
                    timestamp: Date.now(),
                    source: "environment",
                    category: "stream",
                    intent: "notification",
                    broadcastable: false,
                    requestId,
                    context,
                    data: { text: chunk }
                  });
                }
                this.emitToBus({
                  type: "text_content_block_stop",
                  timestamp: Date.now(),
                  source: "environment",
                  category: "stream",
                  intent: "notification",
                  broadcastable: false,
                  index,
                  requestId,
                  context,
                  data: {}
                });
              } else if (typedBlock.type === "tool_use") {
                this.emitToBus({
                  type: "tool_use_content_block_start",
                  timestamp: Date.now(),
                  source: "environment",
                  category: "stream",
                  intent: "notification",
                  broadcastable: false,
                  index,
                  requestId,
                  context,
                  data: {
                    id: typedBlock.id || "",
                    name: typedBlock.name || ""
                  }
                });
                if (typedBlock.input) {
                  this.emitToBus({
                    type: "input_json_delta",
                    timestamp: Date.now(),
                    source: "environment",
                    category: "stream",
                    intent: "notification",
                    broadcastable: false,
                    index,
                    requestId,
                    context,
                    data: { partialJson: JSON.stringify(typedBlock.input) }
                  });
                }
                this.emitToBus({
                  type: "tool_use_content_block_stop",
                  timestamp: Date.now(),
                  source: "environment",
                  category: "stream",
                  intent: "notification",
                  broadcastable: false,
                  index,
                  requestId,
                  context,
                  data: {}
                });
              }
            }
          });
        }
        this.emitToBus({
          type: "message_stop",
          timestamp: Date.now(),
          source: "environment",
          category: "stream",
          intent: "notification",
          broadcastable: false,
          requestId,
          context,
          data: {
            stopReason: hasToolUseContent ? "tool_use" : "end_turn",
            stopSequence: void 0
          }
        });
      }
      feedUserMessage(sdkMsg, meta) {
        this.currentMeta = meta;
        const { requestId, context } = meta;
        if (!sdkMsg.message || !Array.isArray(sdkMsg.message.content)) {
          return;
        }
        for (const block of sdkMsg.message.content) {
          if (block && typeof block === "object" && "type" in block && block.type === "tool_result") {
            const toolResultBlock = block;
            this.emitToBus({
              type: "tool_result",
              timestamp: Date.now(),
              source: "environment",
              category: "stream",
              intent: "notification",
              broadcastable: false,
              requestId,
              context,
              data: {
                toolUseId: toolResultBlock.tool_use_id,
                result: toolResultBlock.content,
                isError: toolResultBlock.is_error || false
              }
            });
          }
        }
      }
      processStreamEvent(sdkMsg) {
        const event = sdkMsg.event;
        const { requestId, context } = this.currentMeta || {};
        switch (event.type) {
          case "message_start":
            this.blockContext = {
              currentBlockType: null,
              currentBlockIndex: 0,
              currentToolId: null,
              currentToolName: null,
              lastStopReason: null,
              lastStopSequence: null
            };
            this.emitToBus({
              type: "message_start",
              timestamp: Date.now(),
              source: "environment",
              category: "stream",
              intent: "notification",
              broadcastable: false,
              requestId,
              context,
              data: {
                message: {
                  id: event.message.id,
                  model: event.message.model
                }
              }
            });
            break;
          case "content_block_start": {
            const contentBlock = event.content_block;
            this.blockContext.currentBlockIndex = event.index;
            logger43.debug("content_block_start received", { contentBlock, index: event.index });
            if (contentBlock.type === "text") {
              this.blockContext.currentBlockType = "text";
              this.emitToBus({
                type: "text_content_block_start",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                index: event.index,
                requestId,
                context,
                data: {}
              });
            } else if (contentBlock.type === "tool_use") {
              this.blockContext.currentBlockType = "tool_use";
              this.blockContext.currentToolId = contentBlock.id || null;
              this.blockContext.currentToolName = contentBlock.name || null;
              this.emitToBus({
                type: "tool_use_content_block_start",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                index: event.index,
                requestId,
                context,
                data: {
                  id: contentBlock.id || "",
                  name: contentBlock.name || ""
                }
              });
            }
            break;
          }
          case "content_block_delta": {
            const delta = event.delta;
            if (delta.type === "text_delta") {
              this.emitToBus({
                type: "text_delta",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                requestId,
                context,
                data: { text: delta.text || "" }
              });
            } else if (delta.type === "input_json_delta") {
              this.emitToBus({
                type: "input_json_delta",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                index: this.blockContext.currentBlockIndex,
                requestId,
                context,
                data: { partialJson: delta.partial_json || "" }
              });
            }
            break;
          }
          case "content_block_stop":
            if (this.blockContext.currentBlockType === "tool_use" && this.blockContext.currentToolId) {
              this.emitToBus({
                type: "tool_use_content_block_stop",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                index: this.blockContext.currentBlockIndex,
                requestId,
                context,
                data: {}
              });
            } else {
              this.emitToBus({
                type: "text_content_block_stop",
                timestamp: Date.now(),
                source: "environment",
                category: "stream",
                intent: "notification",
                broadcastable: false,
                index: this.blockContext.currentBlockIndex,
                requestId,
                context,
                data: {}
              });
            }
            this.blockContext.currentBlockType = null;
            this.blockContext.currentToolId = null;
            this.blockContext.currentToolName = null;
            break;
          case "message_delta": {
            const msgDelta = event.delta;
            if (msgDelta.stop_reason) {
              this.blockContext.lastStopReason = msgDelta.stop_reason;
              this.blockContext.lastStopSequence = msgDelta.stop_sequence || null;
            }
            break;
          }
          case "message_stop": {
            const stopReason = this.blockContext.lastStopReason || "end_turn";
            logger43.info("stream_event message_stop received", {
              stopReason,
              imageId: context?.imageId,
              requestId
            });
            this.emitToBus({
              type: "message_stop",
              timestamp: Date.now(),
              source: "environment",
              category: "stream",
              intent: "notification",
              broadcastable: false,
              requestId,
              context,
              data: {
                stopReason,
                stopSequence: this.blockContext.lastStopSequence || void 0
              }
            });
            this.blockContext.lastStopReason = null;
            this.blockContext.lastStopSequence = null;
            break;
          }
        }
      }
      emitToBus(event) {
        logger43.info("ClaudeReceptor.emitToBus", {
          eventType: event.type,
          hasProducer: !!this.producer
        });
        if (this.producer) {
          this.producer.emit(event);
        }
      }
    };
    logger52 = createLogger("environment/helpers");
    RuntimeEnvironment = class {
      static config = {};
      constructor() {
      }
      static setClaudeCodePath(path2) {
        this.config.claudeCodePath = path2;
      }
      static getClaudeCodePath() {
        return this.config.claudeCodePath;
      }
      static setNodePath(path2) {
        this.config.nodePath = path2;
      }
      static getNodePath() {
        return this.config.nodePath;
      }
      static setGitBashPath(path2) {
        this.config.gitBashPath = path2;
      }
      static getGitBashPath() {
        return this.config.gitBashPath;
      }
      static reset() {
        this.config = {};
      }
    };
    logger62 = createLogger("environment/buildOptions");
    logger72 = createLogger("environment/SDKQueryLifecycle");
    SDKQueryLifecycle = class {
      config;
      callbacks;
      promptSubject = new import_rxjs2.Subject();
      claudeQuery = null;
      isInitialized = false;
      abortController = null;
      hasReceivedStreamEvent = false;
      hasSessionIdCaptured = false;
      skipResumeOnNextInit = false;
      constructor(config, callbacks = {}) {
        this.config = config;
        this.callbacks = callbacks;
      }
      get initialized() {
        return this.isInitialized;
      }
      async warmup() {
        logger72.info("Warming up SDKQueryLifecycle");
        await this.initialize();
        logger72.info("SDKQueryLifecycle warmup complete");
      }
      async initialize() {
        if (this.isInitialized)
          return;
        logger72.info("Initializing SDKQueryLifecycle");
        this.abortController = new AbortController();
        const context = {
          apiKey: this.config.apiKey,
          baseUrl: this.config.baseUrl,
          model: this.config.model,
          systemPrompt: this.config.systemPrompt,
          cwd: this.config.cwd,
          resume: this.skipResumeOnNextInit ? void 0 : this.config.resumeSessionId,
          mcpServers: this.config.mcpServers,
          disallowedTools: this.config.disallowedTools,
          tools: this.config.tools
        };
        const sdkOptions = buildOptions(context, this.abortController);
        const promptStream = observableToAsyncIterable(this.promptSubject);
        this.claudeQuery = a_({
          prompt: promptStream,
          options: sdkOptions
        });
        this.isInitialized = true;
        this.startBackgroundListener();
        logger72.info("SDKQueryLifecycle initialized");
      }
      send(message) {
        if (!this.isInitialized) {
          throw new Error("SDKQueryLifecycle not initialized. Call initialize() first.");
        }
        this.hasReceivedStreamEvent = false;
        this.promptSubject.next(message);
      }
      interrupt() {
        if (this.claudeQuery) {
          logger72.debug("Interrupting SDK query");
          this.claudeQuery.interrupt().catch((err) => {
            logger72.debug("SDK interrupt() error (may be expected)", { error: err });
          });
        }
      }
      reset() {
        logger72.info("Resetting SDKQueryLifecycle", {
          isInitialized: this.isInitialized,
          hasClaudeQuery: !!this.claudeQuery,
          hasAbortController: !!this.abortController
        });
        if (this.abortController) {
          logger72.info("Aborting via AbortController");
          this.abortController.abort();
        }
        this.promptSubject.complete();
        if (this.claudeQuery) {
          logger72.info("Calling interrupt() on claudeQuery");
          this.claudeQuery.interrupt().catch((err) => {
            logger72.debug("SDK interrupt() during reset (may be expected)", { error: err });
          });
        }
        this.isInitialized = false;
        this.claudeQuery = null;
        this.abortController = null;
        this.promptSubject = new import_rxjs2.Subject();
        this.hasReceivedStreamEvent = false;
        this.hasSessionIdCaptured = false;
        logger72.info("SDKQueryLifecycle reset complete");
      }
      resetAndClearResume() {
        logger72.info("Resetting SDKQueryLifecycle and clearing resume session");
        this.skipResumeOnNextInit = true;
        this.reset();
      }
      async dispose() {
        logger72.debug("Disposing SDKQueryLifecycle");
        if (this.claudeQuery) {
          try {
            await this.claudeQuery.interrupt();
            logger72.debug("SDK interrupt() completed during dispose");
          } catch (err) {
            logger72.debug("SDK interrupt() during dispose (may be expected)", { error: err });
          }
        }
        if (this.abortController) {
          this.abortController.abort();
        }
        this.reset();
        logger72.debug("SDKQueryLifecycle disposed");
      }
      startBackgroundListener() {
        logger72.info("Starting background listener for SDK responses");
        (async () => {
          try {
            logger72.info("Entering for-await loop for claudeQuery");
            for await (const sdkMsg of this.claudeQuery) {
              logger72.info("SDK message received", {
                type: sdkMsg.type,
                subtype: sdkMsg.subtype,
                sessionId: sdkMsg.session_id
              });
              if (sdkMsg.session_id && this.callbacks.onSessionIdCaptured && !this.hasSessionIdCaptured) {
                this.hasSessionIdCaptured = true;
                this.callbacks.onSessionIdCaptured(sdkMsg.session_id);
              }
              if (sdkMsg.type === "stream_event") {
                this.hasReceivedStreamEvent = true;
                this.callbacks.onStreamEvent?.(sdkMsg);
              }
              if (sdkMsg.type === "assistant") {
                const assistantMsg = sdkMsg;
                const contentBlocks = assistantMsg.message?.content;
                const hasToolUse = Array.isArray(contentBlocks) && contentBlocks.some((block) => block && typeof block === "object" && "type" in block && block.type === "tool_use");
                const hasTextContent = Array.isArray(contentBlocks) && contentBlocks.some((block) => block && typeof block === "object" && "type" in block && block.type === "text");
                logger72.info("Assistant message received", {
                  hasReceivedStreamEvent: this.hasReceivedStreamEvent,
                  hasToolUse,
                  hasTextContent,
                  contentLength: contentBlocks?.length,
                  contentTypes: contentBlocks?.map((b3) => b3?.type)
                });
                if (this.hasReceivedStreamEvent) {
                  logger72.info("Skipping assistant message - already processed via stream_event", {
                    hasToolUse,
                    hasTextContent
                  });
                } else {
                  logger72.info("Processing assistant message - no stream_events received, will simulate streaming", {
                    contentLength: contentBlocks?.length,
                    hasToolUse,
                    hasTextContent
                  });
                  this.callbacks.onAssistantMessage?.(sdkMsg);
                }
              }
              if (sdkMsg.type === "user") {
                logger72.info("User message received (tool_result) - resetting hasReceivedStreamEvent for next turn");
                this.hasReceivedStreamEvent = false;
                this.callbacks.onUserMessage?.(sdkMsg);
              }
              if (sdkMsg.type === "result") {
                logger72.info("SDK result received", {
                  subtype: sdkMsg.subtype,
                  is_error: sdkMsg.is_error,
                  hadStreamEvents: this.hasReceivedStreamEvent
                });
                const hadStreamEvents = this.hasReceivedStreamEvent;
                this.hasReceivedStreamEvent = false;
                this.callbacks.onResult?.(sdkMsg, hadStreamEvents);
              }
            }
            this.callbacks.onListenerExit?.("normal");
          } catch (error) {
            if (this.isAbortError(error)) {
              logger72.debug("Background listener aborted (expected during interrupt)");
              this.callbacks.onListenerExit?.("abort");
            } else {
              logger72.error("Background listener error", { error });
              this.callbacks.onError?.(error instanceof Error ? error : new Error(String(error)));
              this.callbacks.onListenerExit?.("error");
            }
            this.reset();
          }
        })();
      }
      isAbortError(error) {
        if (error instanceof Error) {
          if (error.name === "AbortError")
            return true;
          if (error.message.includes("aborted"))
            return true;
          if (error.message.includes("abort"))
            return true;
        }
        return false;
      }
    };
    logger8 = createLogger("environment/ClaudeEffector");
    DEFAULT_TIMEOUT = 6e5;
    TOOL_EXECUTION_TIMEOUT = 6e5;
    ClaudeEffector = class {
      config;
      receptor;
      queryLifecycle;
      currentMeta = null;
      wasInterrupted = false;
      activityTimeoutHandle = null;
      constructor(config, receptor) {
        this.config = config;
        this.receptor = receptor;
        this.queryLifecycle = new SDKQueryLifecycle({
          apiKey: config.apiKey,
          baseUrl: config.baseUrl,
          model: config.model,
          systemPrompt: config.systemPrompt,
          cwd: config.cwd,
          resumeSessionId: config.resumeSessionId,
          mcpServers: config.mcpServers,
          disallowedTools: config.disallowedTools,
          tools: config.tools
        }, {
          onStreamEvent: (msg) => this.handleStreamEvent(msg),
          onAssistantMessage: (msg) => this.handleAssistantMessage(msg),
          onUserMessage: (msg) => this.handleUserMessage(msg),
          onResult: (msg, hadStreamEvents) => this.handleResult(msg, hadStreamEvents),
          onSessionIdCaptured: config.onSessionIdCaptured,
          onError: (error) => this.handleError(error),
          onListenerExit: (reason) => this.handleListenerExit(reason)
        });
      }
      connect(consumer) {
        logger8.debug("ClaudeEffector connected to SystemBusConsumer", {
          agentId: this.config.agentId
        });
        consumer.on("user_message", async (event) => {
          const typedEvent = event;
          if (typedEvent.context?.agentId !== this.config.agentId) {
            return;
          }
          const message = typedEvent.data;
          const meta = {
            requestId: typedEvent.requestId || "",
            context: typedEvent.context || {}
          };
          await this.send(message, meta);
        });
        consumer.on("interrupt", (event) => {
          const typedEvent = event;
          if (typedEvent.context?.agentId !== this.config.agentId) {
            return;
          }
          const meta = {
            requestId: typedEvent.requestId || "",
            context: typedEvent.context || {}
          };
          this.interrupt(meta);
        });
      }
      async send(message, meta) {
        this.wasInterrupted = false;
        this.currentMeta = meta;
        this.clearActivityTimeout();
        const timeoutMs = this.config.timeout ?? DEFAULT_TIMEOUT;
        try {
          await this.queryLifecycle.initialize();
          const sessionId = this.config.sessionId || "default";
          const sdkUserMessage = buildSDKUserMessage(message, sessionId);
          logger8.debug("Sending message to Claude", {
            content: typeof message.content === "string" ? message.content.substring(0, 80) : "[structured]",
            timeout: timeoutMs,
            requestId: meta.requestId
          });
          this.resetActivityTimeout(meta);
          logger8.info("Sending message to SDK via queryLifecycle.send()");
          this.queryLifecycle.send(sdkUserMessage);
          logger8.info("Message sent to SDK, waiting for response...");
        } catch (error) {
          this.clearActivityTimeout();
          throw error;
        }
      }
      interrupt(meta) {
        logger8.debug("Interrupting Claude query", { requestId: meta?.requestId });
        this.wasInterrupted = true;
        if (meta) {
          this.currentMeta = meta;
        }
        this.queryLifecycle.interrupt();
      }
      handleStreamEvent(msg) {
        if (this.currentMeta) {
          const streamEvent = msg;
          const isToolCallStart = streamEvent.event?.type === "content_block_start" && streamEvent.event?.content_block?.type === "tool_use";
          if (isToolCallStart) {
            this.resetActivityTimeout(this.currentMeta, TOOL_EXECUTION_TIMEOUT);
          } else {
            this.resetActivityTimeout(this.currentMeta);
          }
          this.receptor.feed(msg, this.currentMeta);
        }
      }
      handleUserMessage(msg) {
        if (this.currentMeta) {
          this.resetActivityTimeout(this.currentMeta);
          this.receptor.feedUserMessage(msg, this.currentMeta);
        }
      }
      handleAssistantMessage(msg) {
        if (this.currentMeta) {
          this.resetActivityTimeout(this.currentMeta);
          this.receptor.feedAssistantMessage(msg, this.currentMeta);
        }
      }
      handleResult(msg, hadStreamEvents) {
        this.clearActivityTimeout();
        const resultMsg = msg;
        logger8.info("SDK result received", {
          subtype: resultMsg.subtype,
          isError: resultMsg.is_error,
          wasInterrupted: this.wasInterrupted,
          hadStreamEvents,
          error: resultMsg.error,
          errors: resultMsg.errors,
          result: typeof resultMsg.result === "string" ? resultMsg.result.substring(0, 500) : void 0
        });
        if (resultMsg.subtype === "error_during_execution" && this.wasInterrupted) {
          this.receptor.emitInterrupted("user_interrupt", this.currentMeta || void 0);
          return;
        }
        if (resultMsg.is_error && this.currentMeta) {
          const errorMessage = resultMsg.error?.message || resultMsg.errors?.join(", ") || (typeof resultMsg.result === "string" ? resultMsg.result : null) || "An error occurred";
          const errorCode = resultMsg.error?.type || resultMsg.subtype || "api_error";
          this.queryLifecycle.reset();
          this.receptor.emitError(errorMessage, errorCode, this.currentMeta);
          return;
        }
        if (resultMsg.subtype === "error_during_execution" && resultMsg.is_error && this.currentMeta) {
          const errorMessage = resultMsg.error?.message || resultMsg.errors?.join(", ") || (typeof resultMsg.result === "string" ? resultMsg.result : null) || "An error occurred during execution";
          const errorCode = resultMsg.error?.type || "error_during_execution";
          logger8.warn("Handling error_during_execution with is_error flag", {
            subtype: resultMsg.subtype,
            errorMessage
          });
          this.queryLifecycle.reset();
          this.receptor.emitError(errorMessage, errorCode, this.currentMeta);
          return;
        }
        if (resultMsg.subtype === "success" || resultMsg.subtype === "error_during_execution") {
          if (resultMsg.subtype === "error_during_execution" && resultMsg.errors?.length) {
            const hasSessionError = resultMsg.errors.some((e3) => e3.includes("No active SSE connection") || e3.includes("HTTP 503"));
            if (hasSessionError) {
              logger8.warn("Session error detected in error_during_execution, resetting SDK session", {
                errors: resultMsg.errors.map((e3) => e3.substring(0, 200))
              });
              this.queryLifecycle.resetAndClearResume();
              this.config.onSessionReset?.();
            }
          }
          if (!hadStreamEvents && this.currentMeta) {
            logger8.info("SDK completed (non-streaming) - emitting message_stop to trigger conversation_end", {
              subtype: resultMsg.subtype,
              isError: resultMsg.is_error,
              hadStreamEvents,
              imageId: this.currentMeta.context?.imageId,
              requestId: this.currentMeta.requestId
            });
            this.receptor.emitMessageStop("end_turn", this.currentMeta);
          } else if (hadStreamEvents) {
            logger8.info("SDK completed (streaming) - message_stop already emitted via stream_event, skipping", {
              subtype: resultMsg.subtype,
              hadStreamEvents
            });
          } else {
            logger8.warn("SDK completed but currentMeta is null - cannot emit message_stop!", {
              subtype: resultMsg.subtype,
              isError: resultMsg.is_error,
              hadStreamEvents
            });
          }
        }
      }
      handleError(error) {
        this.clearActivityTimeout();
        this.queryLifecycle.reset();
        if (this.currentMeta) {
          this.receptor.emitError(error.message, "runtime_error", this.currentMeta);
        }
      }
      handleListenerExit(reason) {
        logger8.debug("SDK listener exited", { reason });
        this.clearActivityTimeout();
      }
      handleTimeout(meta) {
        this.wasInterrupted = true;
        this.queryLifecycle.reset();
        this.receptor.emitError(`Activity timeout - no response for ${this.config.timeout ?? DEFAULT_TIMEOUT}ms`, "timeout", meta);
      }
      clearActivityTimeout() {
        if (this.activityTimeoutHandle) {
          clearTimeout(this.activityTimeoutHandle);
          this.activityTimeoutHandle = null;
        }
      }
      resetActivityTimeout(meta, timeoutMs) {
        this.clearActivityTimeout();
        const ms = timeoutMs ?? this.config.timeout ?? DEFAULT_TIMEOUT;
        this.activityTimeoutHandle = setTimeout(() => {
          logger8.warn("Activity timeout - no events received", { timeout: ms, requestId: meta.requestId });
          this.handleTimeout(meta);
        }, ms);
      }
      async warmup() {
        await this.queryLifecycle.warmup();
      }
      async dispose() {
        logger8.debug("Disposing ClaudeEffector", { agentId: this.config.agentId });
        this.clearActivityTimeout();
        await this.queryLifecycle.dispose();
        logger8.debug("ClaudeEffector disposed", { agentId: this.config.agentId });
      }
    };
    ClaudeEnvironment = class {
      name = "claude";
      receptor;
      effector;
      claudeEffector;
      constructor(config) {
        const claudeReceptor = new ClaudeReceptor();
        const claudeEffector = new ClaudeEffector(config, claudeReceptor);
        this.receptor = claudeReceptor;
        this.effector = claudeEffector;
        this.claudeEffector = claudeEffector;
      }
      async warmup() {
        await this.claudeEffector.warmup();
      }
      async dispose() {
        await this.claudeEffector.dispose();
      }
    };
    logger9 = createLogger("runtime/RuntimeAgent");
    BusPresenter = class {
      producer;
      session;
      agentId;
      imageId;
      containerId;
      name = "BusPresenter";
      description = "Forwards AgentOutput to SystemBus and collects messages";
      constructor(producer, session, agentId, imageId, containerId) {
        this.producer = producer;
        this.session = session;
        this.agentId = agentId;
        this.imageId = imageId;
        this.containerId = containerId;
      }
      present(_agentId, output) {
        const category = this.getCategoryForOutput(output);
        if (output.type === "user_message") {
          return;
        }
        let data = output.data;
        if (category === "message") {
          data = this.convertToMessage(output);
        }
        const systemEvent = {
          type: output.type,
          timestamp: output.timestamp,
          data,
          source: "agent",
          category,
          intent: "notification",
          context: {
            containerId: this.containerId,
            imageId: this.imageId,
            agentId: this.agentId,
            sessionId: this.session.sessionId
          }
        };
        this.producer.emit(systemEvent);
        if (category === "message") {
          this.session.addMessage(data).catch((err) => {
            logger9.error("Failed to persist message", { error: err, messageType: output.type });
          });
        }
      }
      convertToMessage(output) {
        return output.data;
      }
      getCategoryForOutput(output) {
        const type = output.type;
        if (type === "message_start" || type === "message_delta" || type === "message_stop" || type === "text_delta" || type === "tool_use_start" || type === "input_json_delta" || type === "tool_use_stop" || type === "tool_result") {
          return "stream";
        }
        if (type === "user_message" || type === "assistant_message" || type === "tool_call_message" || type === "tool_result_message" || type === "error_message") {
          return "message";
        }
        if (type === "turn_request" || type === "turn_response") {
          return "turn";
        }
        return "state";
      }
    };
    RuntimeAgent = class {
      agentId;
      imageId;
      name;
      containerId;
      createdAt;
      _lifecycle = "running";
      interactor;
      driver;
      engine;
      producer;
      environment;
      imageRepository;
      hasSessionIdSaved = false;
      session;
      config;
      constructor(config) {
        this.agentId = config.agentId;
        this.imageId = config.imageId;
        this.name = config.image.name ?? `agent-${config.agentId}`;
        this.containerId = config.containerId;
        this.createdAt = Date.now();
        this.producer = config.bus.asProducer();
        this.session = config.session;
        this.config = config.config;
        this.imageRepository = config.imageRepository;
        const resumeSessionId = config.image.metadata?.claudeSdkSessionId;
        let baseUrl = config.llmConfig.baseUrl;
        const userContextJson = config.image.metadata?.userContext;
        const isOwnLlmProxy = baseUrl && baseUrl.includes("llm-proxy");
        if (userContextJson && baseUrl && isOwnLlmProxy) {
          const encoded = Buffer.from(userContextJson).toString("base64url");
          baseUrl = baseUrl.replace(/\/$/, "") + `/ctx/${encoded}`;
          logger9.debug("Built baseUrl with userContext", { baseUrl, userContext: userContextJson });
        } else if (userContextJson && baseUrl && !isOwnLlmProxy) {
          logger9.debug("Skipping /ctx/ injection for third-party baseUrl", { baseUrl });
        }
        const mcpServers = config.image.mcpServers;
        this.environment = new ClaudeEnvironment({
          agentId: this.agentId,
          apiKey: config.llmConfig.apiKey,
          baseUrl,
          model: config.llmConfig.model,
          systemPrompt: config.image.systemPrompt,
          cwd: config.sandbox.workdir.path,
          resumeSessionId,
          mcpServers,
          disallowedTools: config.image.disallowedTools,
          tools: config.image.tools,
          onSessionIdCaptured: (sdkSessionId) => {
            this.saveSessionId(sdkSessionId);
          },
          onSessionReset: () => {
            this.hasSessionIdSaved = false;
            logger9.info("Session reset - clearing stored claudeSdkSessionId", {
              agentId: this.agentId,
              imageId: this.imageId
            });
            this.imageRepository.updateMetadata(this.imageId, { claudeSdkSessionId: void 0 }).catch((err) => {
              const errMsg = err?.message || String(err);
              if (errMsg.includes("Image not found")) {
                logger9.debug("Image already deleted, skipping session ID clear", {
                  imageId: this.imageId
                });
                return;
              }
              logger9.error("Failed to clear SDK session ID", { error: err, imageId: this.imageId });
            });
          }
        });
        this.environment.receptor.connect(config.bus.asProducer());
        this.environment.effector.connect(config.bus.asConsumer());
        if (this.environment.warmup) {
          this.environment.warmup().catch((err) => {
            logger9.warn("Environment warmup failed (non-fatal)", { error: err, agentId: this.agentId });
          });
        }
        logger9.info("ClaudeEnvironment created for agent", {
          agentId: this.agentId,
          imageId: this.imageId,
          cwd: config.sandbox.workdir.path,
          resumeSessionId: resumeSessionId ?? "none",
          isResume: !!resumeSessionId,
          imageMetadata: config.image.metadata
        });
        const presenter = new BusPresenter(this.producer, config.session, this.agentId, this.imageId, this.containerId);
        this.engine = createAgent({
          driver: {
            name: "DummyDriver",
            description: "Placeholder driver for push-based event handling",
            receive: async function* () {
            },
            interrupt: () => {
            }
          },
          presenter
        });
        this.interactor = new AgentInteractor(this.producer, config.session, {
          agentId: this.agentId,
          imageId: this.imageId,
          containerId: this.containerId,
          sessionId: config.session.sessionId
        });
        this.driver = new BusDriver(config.bus.asConsumer(), {
          agentId: this.agentId,
          onStreamEvent: (event) => {
            logger9.debug("BusDriver \u2192 Engine.handleStreamEvent", { type: event.type });
            this.engine.handleStreamEvent(event);
          },
          onStreamComplete: (reason) => {
            logger9.debug("Stream completed", { reason, agentId: this.agentId });
          }
        });
        logger9.debug("RuntimeAgent created", {
          agentId: this.agentId,
          imageId: this.imageId
        });
      }
      saveSessionId(sdkSessionId) {
        if (this.hasSessionIdSaved) {
          logger9.debug("Skipping saveSessionId - already saved (idempotent)", {
            agentId: this.agentId,
            imageId: this.imageId
          });
          return;
        }
        if (this._lifecycle === "destroyed") {
          logger9.debug("Skipping saveSessionId - agent already destroyed", {
            agentId: this.agentId,
            imageId: this.imageId
          });
          return;
        }
        this.hasSessionIdSaved = true;
        logger9.info("Saving SDK session ID to image metadata", {
          agentId: this.agentId,
          imageId: this.imageId,
          sdkSessionId
        });
        this.imageRepository.updateMetadata(this.imageId, { claudeSdkSessionId: sdkSessionId }).catch((err) => {
          const errMsg = err?.message || String(err);
          if (errMsg.includes("Image not found")) {
            logger9.debug("Image already deleted, skipping session ID save", {
              imageId: this.imageId
            });
            return;
          }
          logger9.error("Failed to save SDK session ID", { error: err, imageId: this.imageId });
        });
      }
      get lifecycle() {
        return this._lifecycle;
      }
      async receive(content, requestId, userContext) {
        const contentPreview = typeof content === "string" ? content.substring(0, 50) : `[${content.length} parts]`;
        logger9.debug("RuntimeAgent.receive called", {
          agentId: this.agentId,
          contentPreview,
          requestId,
          hasUserContext: !!userContext
        });
        if (this._lifecycle !== "running") {
          throw new Error(`Cannot send message to ${this._lifecycle} agent`);
        }
        await this.interactor.receive(content, requestId || `req_${Date.now()}`, userContext);
        logger9.debug("RuntimeAgent.receive completed", { agentId: this.agentId });
      }
      interrupt(requestId, userContext) {
        logger9.debug("RuntimeAgent.interrupt called", {
          agentId: this.agentId,
          requestId,
          hasUserContext: !!userContext
        });
        this.interactor.interrupt(requestId);
        this.producer.emit({
          type: "interrupted",
          timestamp: Date.now(),
          source: "agent",
          category: "lifecycle",
          intent: "notification",
          data: {
            agentId: this.agentId,
            containerId: this.containerId
          },
          context: {
            containerId: this.containerId,
            imageId: this.imageId,
            agentId: this.agentId,
            sessionId: this.session.sessionId,
            userContext
          }
        });
      }
      async stop() {
        if (this._lifecycle === "destroyed") {
          throw new Error("Cannot stop destroyed agent");
        }
        this._lifecycle = "stopped";
      }
      async resume() {
        if (this._lifecycle === "destroyed") {
          throw new Error("Cannot resume destroyed agent");
        }
        this._lifecycle = "running";
        this.producer.emit({
          type: "session_resumed",
          timestamp: Date.now(),
          source: "session",
          category: "lifecycle",
          intent: "notification",
          data: {
            sessionId: this.session.sessionId,
            agentId: this.agentId,
            containerId: this.containerId
          },
          context: {
            containerId: this.containerId,
            imageId: this.imageId,
            agentId: this.agentId,
            sessionId: this.session.sessionId
          }
        });
      }
      async destroy() {
        if (this._lifecycle !== "destroyed") {
          this.driver.dispose();
          await this.environment.dispose();
          await this.engine.destroy();
          this._lifecycle = "destroyed";
          this.producer.emit({
            type: "session_destroyed",
            timestamp: Date.now(),
            source: "session",
            category: "lifecycle",
            intent: "notification",
            data: {
              sessionId: this.session.sessionId,
              agentId: this.agentId,
              containerId: this.containerId
            },
            context: {
              containerId: this.containerId,
              imageId: this.imageId,
              agentId: this.agentId,
              sessionId: this.session.sessionId
            }
          });
        }
      }
    };
    RuntimeSession = class {
      sessionId;
      imageId;
      containerId;
      createdAt;
      repository;
      producer;
      constructor(config) {
        this.sessionId = config.sessionId;
        this.imageId = config.imageId;
        this.containerId = config.containerId;
        this.createdAt = Date.now();
        this.repository = config.repository;
        this.producer = config.producer;
      }
      async initialize() {
        const record = {
          sessionId: this.sessionId,
          imageId: this.imageId,
          containerId: this.containerId,
          createdAt: this.createdAt,
          updatedAt: this.createdAt
        };
        await this.repository.saveSession(record);
        this.producer.emit({
          type: "session_created",
          timestamp: this.createdAt,
          source: "session",
          category: "lifecycle",
          intent: "notification",
          data: {
            sessionId: this.sessionId,
            imageId: this.imageId,
            containerId: this.containerId,
            createdAt: this.createdAt
          },
          context: {
            containerId: this.containerId,
            sessionId: this.sessionId
          }
        });
      }
      async addMessage(message) {
        await this.repository.addMessage(this.sessionId, message);
        this.producer.emit({
          type: "message_persisted",
          timestamp: Date.now(),
          source: "session",
          category: "persist",
          intent: "result",
          data: {
            sessionId: this.sessionId,
            messageId: message.id,
            savedAt: Date.now()
          },
          context: {
            containerId: this.containerId,
            sessionId: this.sessionId
          }
        });
      }
      async getMessages() {
        return this.repository.getMessages(this.sessionId);
      }
      async clear() {
        await this.repository.clearMessages(this.sessionId);
      }
    };
    logger10 = createLogger("runtime/RuntimeSandbox");
    RuntimeWorkdir = class {
      id;
      name;
      path;
      constructor(agentId, path2) {
        this.id = agentId;
        this.name = `workdir_${agentId}`;
        this.path = path2;
      }
    };
    RuntimeSandbox = class {
      name;
      workdir;
      initialized = false;
      basePath;
      constructor(config) {
        this.name = `sandbox_${config.agentId}`;
        this.basePath = config.basePath;
        const workdirPath = (0, import_node_path2.join)(config.basePath, "containers", config.containerId, "workdirs", config.imageId);
        this.workdir = new RuntimeWorkdir(config.agentId, workdirPath);
      }
      async initialize() {
        if (this.initialized)
          return;
        await (0, import_promises2.mkdir)(this.workdir.path, { recursive: true });
        const claudeDir = (0, import_node_path2.join)(this.workdir.path, ".claude");
        await (0, import_promises2.mkdir)(claudeDir, { recursive: true });
        const settingsPath = (0, import_node_path2.join)(claudeDir, "settings.json");
        await (0, import_promises2.writeFile)(settingsPath, JSON.stringify({
          skipWebFetchPreflight: true,
          settingSources: ["project"]
        }, null, 2));
        await this.linkSkillsToWorkdir(claudeDir);
        this.initialized = true;
      }
      async linkSkillsToWorkdir(claudeDir) {
        const skillsSource = process.env.AGENTX_SKILLS_DIR || (0, import_node_path2.join)(this.basePath, "skills");
        const skillsLink = (0, import_node_path2.join)(claudeDir, "skills");
        await (0, import_promises2.mkdir)(skillsSource, { recursive: true });
        try {
          await (0, import_promises2.lstat)(skillsLink);
          await (0, import_promises2.rm)(skillsLink, { recursive: true, force: true });
        } catch {
        }
        try {
          const type = process.platform === "win32" ? "junction" : void 0;
          await (0, import_promises2.symlink)(skillsSource, skillsLink, type);
          logger10.info("Skills linked into workdir", { link: skillsLink, target: skillsSource });
        } catch (err) {
          logger10.warn("Failed to link skills into workdir (non-fatal)", { error: String(err) });
        }
      }
      async cleanup() {
      }
    };
    logger11 = createLogger("runtime/RuntimeImage");
    RuntimeImage = class _RuntimeImage {
      record;
      context;
      constructor(record, context) {
        this.record = record;
        this.context = context;
      }
      get imageId() {
        return this.record.imageId;
      }
      get containerId() {
        return this.record.containerId;
      }
      get sessionId() {
        return this.record.sessionId;
      }
      get name() {
        return this.record.name;
      }
      get description() {
        return this.record.description;
      }
      get systemPrompt() {
        return this.record.systemPrompt;
      }
      get mcpServers() {
        return this.record.mcpServers;
      }
      get createdAt() {
        return this.record.createdAt;
      }
      get updatedAt() {
        return this.record.updatedAt;
      }
      static async create(config, context) {
        const now = Date.now();
        const imageId = _RuntimeImage.generateImageId();
        const sessionId = _RuntimeImage.generateSessionId();
        const record = {
          imageId,
          containerId: config.containerId,
          sessionId,
          name: config.name ?? "New Conversation",
          description: config.description,
          systemPrompt: config.systemPrompt,
          mcpServers: config.mcpServers,
          disallowedTools: config.disallowedTools,
          tools: config.tools,
          skills: config.skills,
          llmConfig: config.llmConfig,
          metadata: config.userContext ? { userContext: JSON.stringify(config.userContext) } : void 0,
          createdAt: now,
          updatedAt: now
        };
        await context.imageRepository.saveImage(record);
        await context.sessionRepository.saveSession({
          sessionId,
          imageId,
          containerId: config.containerId,
          createdAt: now,
          updatedAt: now
        });
        logger11.info("Image created", {
          imageId,
          sessionId,
          containerId: config.containerId,
          name: record.name
        });
        return new _RuntimeImage(record, context);
      }
      static async load(imageId, context) {
        const record = await context.imageRepository.findImageById(imageId);
        if (!record) {
          logger11.debug("Image not found", { imageId });
          return null;
        }
        logger11.debug("Image loaded", { imageId, name: record.name });
        return new _RuntimeImage(record, context);
      }
      static async listByContainer(containerId, context) {
        return context.imageRepository.findImagesByContainerId(containerId);
      }
      static async listAll(context) {
        return context.imageRepository.findAllImages();
      }
      async getMessages() {
        return this.context.sessionRepository.getMessages(this.sessionId);
      }
      async update(updates) {
        const now = Date.now();
        const updatedRecord = {
          ...this.record,
          name: updates.name ?? this.record.name,
          description: updates.description ?? this.record.description,
          updatedAt: now
        };
        await this.context.imageRepository.saveImage(updatedRecord);
        logger11.info("Image updated", { imageId: this.imageId, updates });
        return new _RuntimeImage(updatedRecord, this.context);
      }
      async delete() {
        await this.context.sessionRepository.deleteSession(this.sessionId);
        await this.context.imageRepository.deleteImage(this.imageId);
        logger11.info("Image deleted", { imageId: this.imageId, sessionId: this.sessionId });
      }
      toRecord() {
        return { ...this.record };
      }
      static generateImageId() {
        const timestamp = Date.now().toString(36);
        const random = Math.random().toString(36).substring(2, 8);
        return `img_${timestamp}_${random}`;
      }
      static generateSessionId() {
        const timestamp = Date.now().toString(36);
        const random = Math.random().toString(36).substring(2, 8);
        return `sess_${timestamp}_${random}`;
      }
    };
    logger12 = createLogger("runtime/RuntimeContainer");
    RuntimeContainer = class _RuntimeContainer {
      containerId;
      createdAt;
      agents = /* @__PURE__ */ new Map();
      imageToAgent = /* @__PURE__ */ new Map();
      context;
      constructor(containerId, createdAt, context) {
        this.containerId = containerId;
        this.createdAt = createdAt;
        this.context = context;
      }
      static async create(containerId, context) {
        const now = Date.now();
        const record = {
          containerId,
          createdAt: now,
          updatedAt: now
        };
        await context.persistence.containers.saveContainer(record);
        const container = new _RuntimeContainer(containerId, now, context);
        context.bus.emit({
          type: "container_created",
          timestamp: now,
          source: "container",
          category: "lifecycle",
          intent: "notification",
          data: {
            containerId,
            createdAt: now
          },
          context: {
            containerId
          }
        });
        logger12.info("Container created", { containerId });
        return container;
      }
      static async load(containerId, context) {
        const record = await context.persistence.containers.findContainerById(containerId);
        if (!record)
          return null;
        logger12.info("Container loaded", { containerId });
        return new _RuntimeContainer(containerId, record.createdAt, context);
      }
      async runImage(image) {
        const existingAgentId = this.imageToAgent.get(image.imageId);
        if (existingAgentId) {
          const existingAgent = this.agents.get(existingAgentId);
          if (existingAgent) {
            logger12.info("Reusing existing agent for image", {
              containerId: this.containerId,
              imageId: image.imageId,
              agentId: existingAgentId
            });
            return { agent: existingAgent, reused: true };
          }
          this.imageToAgent.delete(image.imageId);
        }
        const agentId = this.generateAgentId();
        const sandbox = new RuntimeSandbox({
          agentId,
          imageId: image.imageId,
          containerId: this.containerId,
          basePath: this.context.basePath
        });
        await sandbox.initialize(image.skills);
        const session = new RuntimeSession({
          sessionId: image.sessionId,
          imageId: image.imageId,
          containerId: this.containerId,
          repository: this.context.persistence.sessions,
          producer: this.context.bus.asProducer()
        });
        const resolvedLlmConfig = image.llmConfig ? {
          apiKey: image.llmConfig.apiKey || this.context.llmConfig.apiKey,
          baseUrl: image.llmConfig.baseUrl ?? this.context.llmConfig.baseUrl,
          model: image.llmConfig.model ?? this.context.llmConfig.model
        } : this.context.llmConfig;
        const agent = new RuntimeAgent({
          agentId,
          imageId: image.imageId,
          containerId: this.containerId,
          config: {},
          bus: this.context.bus,
          sandbox,
          session,
          llmConfig: resolvedLlmConfig,
          image,
          imageRepository: this.context.persistence.images
        });
        this.agents.set(agentId, agent);
        this.imageToAgent.set(image.imageId, agentId);
        this.context.bus.emit({
          type: "agent_registered",
          timestamp: Date.now(),
          source: "container",
          category: "lifecycle",
          intent: "notification",
          data: {
            containerId: this.containerId,
            agentId,
            definitionName: image.name,
            registeredAt: Date.now()
          },
          context: {
            containerId: this.containerId,
            agentId
          }
        });
        logger12.info("Agent created for image", {
          containerId: this.containerId,
          imageId: image.imageId,
          agentId
        });
        return { agent, reused: false };
      }
      async stopImage(imageId) {
        const agentId = this.imageToAgent.get(imageId);
        if (!agentId) {
          logger12.debug("Image not running, nothing to stop", {
            imageId,
            containerId: this.containerId
          });
          return false;
        }
        logger12.info("Stopping image", { imageId, agentId, containerId: this.containerId });
        const success = await this.destroyAgent(agentId);
        if (success) {
          this.imageToAgent.delete(imageId);
          logger12.info("Image stopped", { imageId, agentId, containerId: this.containerId });
        }
        return success;
      }
      getAgentIdForImage(imageId) {
        return this.imageToAgent.get(imageId);
      }
      isImageOnline(imageId) {
        const agentId = this.imageToAgent.get(imageId);
        return agentId !== void 0 && this.agents.has(agentId);
      }
      getImageIdForAgent(agentId) {
        for (const [imageId, mappedAgentId] of this.imageToAgent.entries()) {
          if (mappedAgentId === agentId) {
            return imageId;
          }
        }
        return;
      }
      getAgent(agentId) {
        return this.agents.get(agentId);
      }
      listAgents() {
        return Array.from(this.agents.values());
      }
      get agentCount() {
        return this.agents.size;
      }
      async destroyAgent(agentId) {
        const agent = this.agents.get(agentId);
        if (!agent)
          return false;
        await agent.destroy();
        this.agents.delete(agentId);
        this.context.bus.emit({
          type: "agent_unregistered",
          timestamp: Date.now(),
          source: "container",
          category: "lifecycle",
          intent: "notification",
          data: {
            containerId: this.containerId,
            agentId
          },
          context: {
            containerId: this.containerId,
            agentId
          }
        });
        logger12.info("Agent destroyed", { containerId: this.containerId, agentId });
        return true;
      }
      async destroyAllAgents() {
        const agentIds = Array.from(this.agents.keys());
        for (const agentId of agentIds) {
          await this.destroyAgent(agentId);
        }
      }
      async dispose() {
        const agentCount = this.agents.size;
        await this.destroyAllAgents();
        this.context.bus.emit({
          type: "container_destroyed",
          timestamp: Date.now(),
          source: "container",
          category: "lifecycle",
          intent: "notification",
          data: {
            containerId: this.containerId,
            agentCount
          },
          context: {
            containerId: this.containerId
          }
        });
        this.context.onDisposed?.(this.containerId);
        logger12.info("Container disposed", { containerId: this.containerId, agentCount });
      }
      generateAgentId() {
        const timestamp = Date.now().toString(36);
        const random = Math.random().toString(36).substring(2, 8);
        return `agent_${timestamp}_${random}`;
      }
    };
    logger13 = createLogger("runtime/BaseEventHandler");
    BaseEventHandler = class {
      bus;
      unsubscribes = [];
      constructor(bus) {
        this.bus = bus;
      }
      safeHandle(handler, context) {
        try {
          return handler();
        } catch (err) {
          this.handleError(err, context);
          return;
        }
      }
      async safeHandleAsync(handler, context) {
        try {
          return await handler();
        } catch (err) {
          this.handleError(err, context);
          return;
        }
      }
      handleError(err, context) {
        const message = err instanceof Error ? err.message : String(err);
        const stack = err instanceof Error ? err.stack : void 0;
        logger13.error(`Error in ${context.operation || "handler"}`, {
          message,
          requestId: context.requestId,
          details: context.details
        });
        const errorEvent = {
          type: "system_error",
          timestamp: Date.now(),
          source: context.source || "command",
          category: "error",
          intent: "notification",
          data: {
            message,
            requestId: context.requestId,
            severity: context.severity || "error",
            details: {
              operation: context.operation,
              stack,
              ...context.details
            }
          }
        };
        this.bus.emit(errorEvent);
        if (context.onError) {
          try {
            context.onError(err);
          } catch (callbackErr) {
            logger13.error("Error in onError callback", { error: callbackErr });
          }
        }
      }
      subscribe(unsubscribe) {
        this.unsubscribes.push(unsubscribe);
      }
      dispose() {
        for (const unsubscribe of this.unsubscribes) {
          unsubscribe();
        }
        this.unsubscribes = [];
        logger13.debug(`${this.constructor.name} disposed`);
      }
    };
    logger14 = createLogger("runtime/CommandHandler");
    CommandHandler = class extends BaseEventHandler {
      ops;
      constructor(bus, operations) {
        super(bus);
        this.ops = operations;
        this.bindHandlers();
        logger14.debug("CommandHandler created");
      }
      emitError(operation, err, requestId, context) {
        const errorMessage = err instanceof Error ? err.message : String(err);
        const stack = err instanceof Error ? err.stack : void 0;
        logger14.error(operation, {
          requestId,
          ...context,
          error: errorMessage,
          stack
        });
        this.bus.emit(createSystemError(errorMessage, requestId, context, stack));
      }
      bindHandlers() {
        this.subscribe(this.bus.onCommand("container_create_request", (event) => this.handleContainerCreate(event)));
        this.subscribe(this.bus.onCommand("container_get_request", (event) => this.handleContainerGet(event)));
        this.subscribe(this.bus.onCommand("container_list_request", (event) => this.handleContainerList(event)));
        this.subscribe(this.bus.onCommand("agent_get_request", (event) => this.handleAgentGet(event)));
        this.subscribe(this.bus.onCommand("agent_list_request", (event) => this.handleAgentList(event)));
        this.subscribe(this.bus.onCommand("agent_destroy_request", (event) => this.handleAgentDestroy(event)));
        this.subscribe(this.bus.onCommand("agent_destroy_all_request", (event) => this.handleAgentDestroyAll(event)));
        this.subscribe(this.bus.onCommand("message_send_request", (event) => this.handleMessageSend(event)));
        this.subscribe(this.bus.onCommand("agent_interrupt_request", (event) => this.handleAgentInterrupt(event)));
        this.subscribe(this.bus.onCommand("image_create_request", (event) => this.handleImageCreate(event)));
        this.subscribe(this.bus.onCommand("image_run_request", (event) => this.handleImageRun(event)));
        this.subscribe(this.bus.onCommand("image_stop_request", (event) => this.handleImageStop(event)));
        this.subscribe(this.bus.onCommand("image_update_request", (event) => this.handleImageUpdate(event)));
        this.subscribe(this.bus.onCommand("image_list_request", (event) => this.handleImageList(event)));
        this.subscribe(this.bus.onCommand("image_get_request", (event) => this.handleImageGet(event)));
        this.subscribe(this.bus.onCommand("image_delete_request", (event) => this.handleImageDelete(event)));
        this.subscribe(this.bus.onCommand("image_messages_request", (event) => this.handleImageMessages(event)));
        logger14.debug("Command handlers bound");
      }
      async handleContainerCreate(event) {
        const { requestId, containerId } = event.data;
        logger14.debug("Handling container_create_request", { requestId, containerId });
        try {
          await this.ops.createContainer(containerId);
          this.bus.emit(createResponse("container_create_response", {
            requestId,
            containerId
          }));
        } catch (err) {
          this.emitError("Failed to create container", err, requestId, { containerId });
          this.bus.emit(createResponse("container_create_response", {
            requestId,
            containerId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      handleContainerGet(event) {
        const { requestId, containerId } = event.data;
        logger14.debug("Handling container_get_request", { requestId, containerId });
        const container = this.ops.getContainer(containerId);
        this.bus.emit(createResponse("container_get_response", {
          requestId,
          containerId: container?.containerId,
          exists: !!container
        }));
      }
      handleContainerList(event) {
        const { requestId } = event.data;
        logger14.debug("Handling container_list_request", { requestId });
        const containers = this.ops.listContainers();
        this.bus.emit(createResponse("container_list_response", {
          requestId,
          containerIds: containers.map((c3) => c3.containerId)
        }));
      }
      handleAgentGet(event) {
        const { requestId, agentId } = event.data;
        logger14.debug("Handling agent_get_request", { requestId, agentId });
        const agent = this.ops.getAgent(agentId);
        this.bus.emit(createResponse("agent_get_response", {
          requestId,
          agentId: agent?.agentId,
          containerId: agent?.containerId,
          exists: !!agent
        }));
      }
      handleAgentList(event) {
        const { requestId, containerId } = event.data;
        logger14.debug("Handling agent_list_request", { requestId, containerId });
        const agents = this.ops.listAgents(containerId);
        this.bus.emit(createResponse("agent_list_response", {
          requestId,
          agents: agents.map((a) => ({
            agentId: a.agentId,
            containerId: a.containerId,
            imageId: a.imageId
          }))
        }));
      }
      async handleAgentDestroy(event) {
        const { requestId, agentId } = event.data;
        logger14.debug("Handling agent_destroy_request", { requestId, agentId });
        try {
          const success = await this.ops.destroyAgent(agentId);
          this.bus.emit(createResponse("agent_destroy_response", {
            requestId,
            agentId,
            success
          }));
        } catch (err) {
          this.emitError("Failed to destroy agent", err, requestId, { agentId });
          this.bus.emit(createResponse("agent_destroy_response", {
            requestId,
            agentId,
            success: false,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleAgentDestroyAll(event) {
        const { requestId, containerId } = event.data;
        logger14.debug("Handling agent_destroy_all_request", { requestId, containerId });
        try {
          await this.ops.destroyAllAgents(containerId);
          this.bus.emit(createResponse("agent_destroy_all_response", {
            requestId,
            containerId
          }));
        } catch (err) {
          this.emitError("Failed to destroy all agents", err, requestId, { containerId });
          this.bus.emit(createResponse("agent_destroy_all_response", {
            requestId,
            containerId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleMessageSend(event) {
        const { requestId, imageId, agentId, content, userContext } = event.data;
        logger14.debug("Handling message_send_request", {
          requestId,
          imageId,
          agentId,
          hasUserContext: !!userContext
        });
        try {
          const result = await this.ops.receiveMessage(imageId, agentId, content, requestId, userContext);
          this.bus.emit(createResponse("message_send_response", {
            requestId,
            imageId: result.imageId,
            agentId: result.agentId
          }));
        } catch (err) {
          this.emitError("Failed to send message", err, requestId, { imageId, agentId });
          this.bus.emit(createResponse("message_send_response", {
            requestId,
            imageId,
            agentId: agentId ?? "",
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      handleAgentInterrupt(event) {
        const { requestId, imageId, agentId, userContext } = event.data;
        logger14.debug("Handling agent_interrupt_request", {
          requestId,
          imageId,
          agentId,
          hasUserContext: !!userContext
        });
        try {
          const result = this.ops.interruptAgent(imageId, agentId, requestId, userContext);
          this.bus.emit(createResponse("agent_interrupt_response", {
            requestId,
            imageId: result.imageId,
            agentId: result.agentId
          }));
        } catch (err) {
          this.emitError("Failed to interrupt agent", err, requestId, { imageId, agentId });
          this.bus.emit(createResponse("agent_interrupt_response", {
            requestId,
            imageId,
            agentId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageCreate(event) {
        const { requestId, containerId, config, userContext } = event.data;
        logger14.debug("Handling image_create_request", { requestId, containerId, hasUserContext: !!userContext });
        try {
          const record = await this.ops.createImage(containerId, config, userContext);
          this.bus.emit(createResponse("image_create_response", {
            requestId,
            record,
            __subscriptions: [record.sessionId]
          }));
        } catch (err) {
          this.emitError("Failed to create image", err, requestId, { containerId });
          this.bus.emit(createResponse("image_create_response", {
            requestId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageRun(event) {
        const { requestId, imageId } = event.data;
        logger14.debug("Handling image_run_request", { requestId, imageId });
        try {
          const result = await this.ops.runImage(imageId);
          this.bus.emit(createResponse("image_run_response", {
            requestId,
            imageId: result.imageId,
            agentId: result.agentId,
            reused: result.reused
          }));
        } catch (err) {
          this.emitError("Failed to run image", err, requestId, { imageId });
          this.bus.emit(createResponse("image_run_response", {
            requestId,
            imageId,
            agentId: "",
            reused: false,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageStop(event) {
        const { requestId, imageId } = event.data;
        logger14.debug("Handling image_stop_request", { requestId, imageId });
        try {
          await this.ops.stopImage(imageId);
          this.bus.emit(createResponse("image_stop_response", {
            requestId,
            imageId
          }));
        } catch (err) {
          this.emitError("Failed to stop image", err, requestId, { imageId });
          this.bus.emit(createResponse("image_stop_response", {
            requestId,
            imageId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageUpdate(event) {
        const { requestId, imageId, updates } = event.data;
        logger14.debug("Handling image_update_request", { requestId, imageId });
        try {
          const record = await this.ops.updateImage(imageId, updates);
          this.bus.emit(createResponse("image_update_response", {
            requestId,
            record
          }));
        } catch (err) {
          this.emitError("Failed to update image", err, requestId, { imageId });
          this.bus.emit(createResponse("image_update_response", {
            requestId,
            record: null,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageList(event) {
        const { requestId, containerId } = event.data;
        logger14.debug("Handling image_list_request", { requestId, containerId });
        try {
          const images = await this.ops.listImages(containerId);
          this.bus.emit(createResponse("image_list_response", {
            requestId,
            records: images,
            __subscriptions: images.map((img) => img.sessionId)
          }));
        } catch (err) {
          this.emitError("Failed to list images", err, requestId, { containerId });
          this.bus.emit(createResponse("image_list_response", {
            requestId,
            records: [],
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageGet(event) {
        const { requestId, imageId } = event.data;
        logger14.debug("Handling image_get_request", { requestId, imageId });
        try {
          const image = await this.ops.getImage(imageId);
          this.bus.emit(createResponse("image_get_response", {
            requestId,
            record: image,
            __subscriptions: image?.sessionId ? [image.sessionId] : void 0
          }));
        } catch (err) {
          this.emitError("Failed to get image", err, requestId, { imageId });
          this.bus.emit(createResponse("image_get_response", {
            requestId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageDelete(event) {
        const { requestId, imageId } = event.data;
        logger14.debug("Handling image_delete_request", { requestId, imageId });
        try {
          await this.ops.deleteImage(imageId);
          this.bus.emit(createResponse("image_delete_response", {
            requestId,
            imageId
          }));
        } catch (err) {
          this.emitError("Failed to delete image", err, requestId, { imageId });
          this.bus.emit(createResponse("image_delete_response", {
            requestId,
            imageId,
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
      async handleImageMessages(event) {
        const { requestId, imageId } = event.data;
        logger14.info("Handling image_messages_request", { requestId, imageId });
        try {
          const messages = await this.ops.getImageMessages(imageId);
          logger14.info("Got messages for image", { imageId, count: messages.length });
          this.bus.emit(createResponse("image_messages_response", {
            requestId,
            imageId,
            messages
          }));
          logger14.info("Emitted image_messages_response", { requestId, imageId });
        } catch (err) {
          this.emitError("Failed to get image messages", err, requestId, { imageId });
          this.bus.emit(createResponse("image_messages_response", {
            requestId,
            imageId,
            messages: [],
            error: err instanceof Error ? err.message : String(err)
          }));
        }
      }
    };
    logger15 = createLogger("runtime/RuntimeImpl");
    RuntimeImpl = class {
      persistence;
      llmProvider;
      bus;
      llmConfig;
      basePath;
      commandHandler;
      defaultAgent;
      containerRegistry = /* @__PURE__ */ new Map();
      constructor(config) {
        logger15.info("RuntimeImpl constructor start");
        this.persistence = config.persistence;
        this.llmProvider = config.llmProvider;
        this.basePath = config.basePath;
        this.defaultAgent = config.defaultAgent;
        logger15.info("Creating SystemBus");
        this.bus = new SystemBusImpl();
        this.llmConfig = this.llmProvider.provide();
        logger15.info("LLM config loaded", {
          hasApiKey: !!this.llmConfig.apiKey,
          model: this.llmConfig.model
        });
        logger15.info("Creating CommandHandler");
        this.commandHandler = new CommandHandler(this.bus, this.createRuntimeOperations());
        logger15.info("RuntimeImpl constructor done");
      }
      emit(event) {
        this.bus.emit(event);
      }
      emitBatch(events) {
        this.bus.emitBatch(events);
      }
      on(typeOrTypes, handler, options) {
        return this.bus.on(typeOrTypes, handler, options);
      }
      onAny(handler, options) {
        return this.bus.onAny(handler, options);
      }
      once(type, handler) {
        return this.bus.once(type, handler);
      }
      onCommand(type, handler) {
        return this.bus.onCommand(type, handler);
      }
      emitCommand(type, data) {
        this.bus.emitCommand(type, data);
      }
      request(type, data, timeout) {
        return this.bus.request(type, data, timeout);
      }
      asConsumer() {
        return this.bus.asConsumer();
      }
      asProducer() {
        return this.bus.asProducer();
      }
      destroy() {
        this.bus.destroy();
      }
      createRuntimeOperations() {
        return {
          createContainer: async (containerId) => {
            const container = await this.getOrCreateContainer(containerId);
            return { containerId: container.containerId };
          },
          getContainer: (containerId) => {
            const container = this.containerRegistry.get(containerId);
            return container ? { containerId: container.containerId } : void 0;
          },
          listContainers: () => {
            return Array.from(this.containerRegistry.values()).map((c3) => ({
              containerId: c3.containerId
            }));
          },
          getAgent: (agentId) => {
            const agent = this.findAgent(agentId);
            if (!agent)
              return;
            const imageId = this.findImageIdForAgent(agentId);
            return { agentId: agent.agentId, containerId: agent.containerId, imageId: imageId ?? "" };
          },
          listAgents: (containerId) => {
            const container = this.containerRegistry.get(containerId);
            if (!container)
              return [];
            return container.listAgents().map((a) => {
              const imageId = this.findImageIdForAgent(a.agentId);
              return { agentId: a.agentId, containerId: a.containerId, imageId: imageId ?? "" };
            });
          },
          destroyAgent: async (agentId) => {
            for (const container of this.containerRegistry.values()) {
              if (container.getAgent(agentId)) {
                return container.destroyAgent(agentId);
              }
            }
            return false;
          },
          destroyAllAgents: async (containerId) => {
            const container = this.containerRegistry.get(containerId);
            await container?.destroyAllAgents();
          },
          receiveMessage: async (imageId, agentId, content, requestId, userContext) => {
            if (imageId) {
              logger15.debug("Receiving message by imageId", {
                imageId,
                contentLength: content.length,
                requestId,
                hasUserContext: !!userContext
              });
              const record = await this.persistence.images.findImageById(imageId);
              if (!record)
                throw new Error(`Image not found: ${imageId}`);
              const container = await this.getOrCreateContainer(record.containerId);
              const { agent, reused } = await container.runImage(record);
              logger15.info("Message routed to agent", {
                imageId,
                agentId: agent.agentId,
                reused,
                requestId,
                hasUserContext: !!userContext
              });
              await agent.receive(content, requestId, userContext);
              return { agentId: agent.agentId, imageId };
            }
            if (agentId) {
              logger15.debug("Receiving message by agentId (legacy)", {
                agentId,
                contentLength: content.length,
                requestId,
                hasUserContext: !!userContext
              });
              const agent = this.findAgent(agentId);
              if (!agent)
                throw new Error(`Agent not found: ${agentId}`);
              await agent.receive(content, requestId, userContext);
              const foundImageId = this.findImageIdForAgent(agentId);
              return { agentId, imageId: foundImageId };
            }
            throw new Error("Either imageId or agentId must be provided");
          },
          interruptAgent: (imageId, agentId, requestId, userContext) => {
            if (imageId) {
              const foundAgentId = this.findAgentIdForImage(imageId);
              if (!foundAgentId) {
                logger15.debug("Image is offline, nothing to interrupt", { imageId });
                return { imageId, agentId: void 0 };
              }
              const agent = this.findAgent(foundAgentId);
              if (agent) {
                logger15.info("Interrupting agent by imageId", {
                  imageId,
                  agentId: foundAgentId,
                  requestId,
                  hasUserContext: !!userContext
                });
                agent.interrupt(requestId, userContext);
              }
              return { imageId, agentId: foundAgentId };
            }
            if (agentId) {
              const agent = this.findAgent(agentId);
              if (!agent)
                throw new Error(`Agent not found: ${agentId}`);
              logger15.info("Interrupting agent by agentId (legacy)", {
                agentId,
                requestId,
                hasUserContext: !!userContext
              });
              agent.interrupt(requestId, userContext);
              const foundImageId = this.findImageIdForAgent(agentId);
              return { agentId, imageId: foundImageId };
            }
            throw new Error("Either imageId or agentId must be provided");
          },
          createImage: async (containerId, config, userContext) => {
            logger15.debug("Creating image", { containerId, name: config.name, hasUserContext: !!userContext });
            await this.getOrCreateContainer(containerId);
            const binarySkills = await this.loadSkillsFromBinaries();
            const mergedConfig = {
              containerId,
              name: config.name ?? this.defaultAgent?.name,
              description: config.description ?? this.defaultAgent?.description,
              systemPrompt: config.systemPrompt ?? this.defaultAgent?.systemPrompt,
              mcpServers: config.mcpServers ?? this.defaultAgent?.mcpServers,
              disallowedTools: config.disallowedTools ?? this.defaultAgent?.disallowedTools,
              tools: config.tools ?? this.defaultAgent?.tools,
              skills: [...binarySkills, ...config.skills ?? [], ...this.defaultAgent?.skills ?? []],
              llmConfig: config.llmConfig,
              userContext
            };
            logger15.debug("Merged config for image creation", {
              containerId,
              name: mergedConfig.name,
              hasSystemPrompt: !!mergedConfig.systemPrompt,
              mcpServers: mergedConfig.mcpServers ? Object.keys(mergedConfig.mcpServers) : [],
              disallowedTools: mergedConfig.disallowedTools,
              tools: mergedConfig.tools,
              hasUserContext: !!userContext,
              binarySkillsCount: binarySkills.length,
              totalSkillsCount: mergedConfig.skills?.length ?? 0
            });
            const image = await RuntimeImage.create(mergedConfig, this.createImageContext());
            logger15.info("Image created via RuntimeOps", { imageId: image.imageId, containerId });
            return this.toImageListItemResult(image.toRecord(), false);
          },
          runImage: async (imageId) => {
            logger15.debug("Running image", { imageId });
            const record = await this.persistence.images.findImageById(imageId);
            if (!record)
              throw new Error(`Image not found: ${imageId}`);
            const container = await this.getOrCreateContainer(record.containerId);
            const { agent, reused } = await container.runImage(record);
            logger15.info("Image running", { imageId, agentId: agent.agentId, reused });
            return { imageId, agentId: agent.agentId, reused };
          },
          stopImage: async (imageId) => {
            logger15.debug("Stopping image", { imageId });
            const record = await this.persistence.images.findImageById(imageId);
            if (!record)
              throw new Error(`Image not found: ${imageId}`);
            const container = this.containerRegistry.get(record.containerId);
            if (container) {
              await container.stopImage(imageId);
              logger15.info("Image stopped via RuntimeOps", { imageId });
            }
          },
          updateImage: async (imageId, updates) => {
            const image = await RuntimeImage.load(imageId, this.createImageContext());
            if (!image)
              throw new Error(`Image not found: ${imageId}`);
            const updatedImage = await image.update(updates);
            const online = this.isImageOnline(imageId);
            return this.toImageListItemResult(updatedImage.toRecord(), online);
          },
          listImages: async (containerId) => {
            const records = containerId ? await RuntimeImage.listByContainer(containerId, this.createImageContext()) : await RuntimeImage.listAll(this.createImageContext());
            return records.map((r3) => {
              const online = this.isImageOnline(r3.imageId);
              return this.toImageListItemResult(r3, online);
            });
          },
          getImage: async (imageId) => {
            const record = await this.persistence.images.findImageById(imageId);
            if (!record)
              return null;
            const online = this.isImageOnline(imageId);
            return this.toImageListItemResult(record, online);
          },
          deleteImage: async (imageId) => {
            logger15.debug("Deleting image", { imageId });
            const agentId = this.findAgentIdForImage(imageId);
            if (agentId) {
              logger15.debug("Stopping running agent before delete", { imageId, agentId });
              for (const container of this.containerRegistry.values()) {
                if (container.getAgent(agentId)) {
                  await container.destroyAgent(agentId);
                  break;
                }
              }
            }
            const image = await RuntimeImage.load(imageId, this.createImageContext());
            if (image) {
              await image.delete();
              logger15.info("Image deleted via RuntimeOps", { imageId });
            }
          },
          getImageMessages: async (imageId) => {
            logger15.debug("Getting messages for image", { imageId });
            const image = await RuntimeImage.load(imageId, this.createImageContext());
            if (!image) {
              throw new Error(`Image not found: ${imageId}`);
            }
            const messages = await image.getMessages();
            logger15.debug("Got messages from storage", { imageId, count: messages.length });
            return messages;
          }
        };
      }
      async getOrCreateContainer(containerId) {
        const existing = this.containerRegistry.get(containerId);
        if (existing)
          return existing;
        const loaded = await RuntimeContainer.load(containerId, this.createContainerContext());
        if (loaded) {
          this.containerRegistry.set(containerId, loaded);
          return loaded;
        }
        const container = await RuntimeContainer.create(containerId, this.createContainerContext());
        this.containerRegistry.set(containerId, container);
        return container;
      }
      findAgent(agentId) {
        for (const container of this.containerRegistry.values()) {
          const agent = container.getAgent(agentId);
          if (agent)
            return agent;
        }
        return;
      }
      findImageIdForAgent(agentId) {
        for (const container of this.containerRegistry.values()) {
          const imageId = container.getImageIdForAgent(agentId);
          if (imageId)
            return imageId;
        }
        return;
      }
      findAgentIdForImage(imageId) {
        for (const container of this.containerRegistry.values()) {
          const agentId = container.getAgentIdForImage(imageId);
          if (agentId)
            return agentId;
        }
        return;
      }
      isImageOnline(imageId) {
        for (const container of this.containerRegistry.values()) {
          if (container.isImageOnline(imageId)) {
            return true;
          }
        }
        return false;
      }
      parseFrontmatter(content) {
        const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
        if (!match) {
          return { name: "", description: "", body: content };
        }
        const [, frontmatter, body] = match;
        const nameMatch = frontmatter.match(/^name:\s*(.+)$/m);
        const descMatch = frontmatter.match(/^description:\s*(.+)$/m);
        return {
          name: nameMatch?.[1]?.trim() || "",
          description: descMatch?.[1]?.trim() || "",
          body: body.trim()
        };
      }
      async loadSkillsFromBinaries() {
        const skillsDir = process.env.AGENTX_SKILLS_DIR || path.join(this.basePath, "skills");
        const skills = [];
        try {
          await fs.access(skillsDir);
          const entries = await fs.readdir(skillsDir, { withFileTypes: true });
          for (const entry of entries) {
            if (!entry.isDirectory())
              continue;
            const skillPath = path.join(skillsDir, entry.name, "SKILL.md");
            try {
              const content = await fs.readFile(skillPath, "utf-8");
              const { name, description, body } = this.parseFrontmatter(content);
              if (name && description) {
                skills.push({ name, description, content: body });
              }
            } catch {
            }
          }
        } catch {
        }
        return skills;
      }
      toImageListItemResult(record, online) {
        const agentId = online ? this.findAgentIdForImage(record.imageId) : void 0;
        return {
          imageId: record.imageId,
          containerId: record.containerId,
          sessionId: record.sessionId,
          name: record.name,
          description: record.description,
          systemPrompt: record.systemPrompt,
          createdAt: record.createdAt,
          updatedAt: record.updatedAt,
          online,
          agentId
        };
      }
      createContainerContext() {
        return {
          persistence: this.persistence,
          bus: this.bus,
          llmConfig: this.llmConfig,
          basePath: this.basePath,
          onDisposed: (containerId) => {
            this.containerRegistry.delete(containerId);
          }
        };
      }
      createImageContext() {
        return {
          imageRepository: this.persistence.images,
          sessionRepository: this.persistence.sessions
        };
      }
      async dispose() {
        logger15.info("Disposing RuntimeImpl");
        this.commandHandler.dispose();
        for (const container of this.containerRegistry.values()) {
          await container.dispose();
        }
        this.bus.destroy();
        this.containerRegistry.clear();
        logger15.info("RuntimeImpl disposed");
      }
    };
  }
});

// ../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
function jsonParseTransform2(key, value) {
  if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
    warnKeyDropped2(key);
    return;
  }
  return value;
}
function warnKeyDropped2(key) {
  console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
}
function destr2(value, options = {}) {
  if (typeof value !== "string") {
    return value;
  }
  if (value[0] === '"' && value[value.length - 1] === '"' && value.indexOf("\\") === -1) {
    return value.slice(1, -1);
  }
  const _value = value.trim();
  if (_value.length <= 9) {
    switch (_value.toLowerCase()) {
      case "true": {
        return true;
      }
      case "false": {
        return false;
      }
      case "undefined": {
        return void 0;
      }
      case "null": {
        return null;
      }
      case "nan": {
        return Number.NaN;
      }
      case "infinity": {
        return Number.POSITIVE_INFINITY;
      }
      case "-infinity": {
        return Number.NEGATIVE_INFINITY;
      }
    }
  }
  if (!JsonSigRx2.test(value)) {
    if (options.strict) {
      throw new SyntaxError("[destr] Invalid JSON");
    }
    return value;
  }
  try {
    if (suspectProtoRx2.test(value) || suspectConstructorRx2.test(value)) {
      if (options.strict) {
        throw new Error("[destr] Possible prototype pollution");
      }
      return JSON.parse(value, jsonParseTransform2);
    }
    return JSON.parse(value);
  } catch (error) {
    if (options.strict) {
      throw error;
    }
    return value;
  }
}
var suspectProtoRx2, suspectConstructorRx2, JsonSigRx2;
var init_dist5 = __esm({
  "../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs"() {
    suspectProtoRx2 = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
    suspectConstructorRx2 = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
    JsonSigRx2 = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
  }
});

// ../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs
function wrapToPromise2(value) {
  if (!value || typeof value.then !== "function") {
    return Promise.resolve(value);
  }
  return value;
}
function asyncCall2(function_, ...arguments_) {
  try {
    return wrapToPromise2(function_(...arguments_));
  } catch (error) {
    return Promise.reject(error);
  }
}
function isPrimitive2(value) {
  const type = typeof value;
  return value === null || type !== "object" && type !== "function";
}
function isPureObject2(value) {
  const proto = Object.getPrototypeOf(value);
  return !proto || proto.isPrototypeOf(Object);
}
function stringify2(value) {
  if (isPrimitive2(value)) {
    return String(value);
  }
  if (isPureObject2(value) || Array.isArray(value)) {
    return JSON.stringify(value);
  }
  if (typeof value.toJSON === "function") {
    return stringify2(value.toJSON());
  }
  throw new Error("[unstorage] Cannot stringify value!");
}
function serializeRaw2(value) {
  if (typeof value === "string") {
    return value;
  }
  return BASE64_PREFIX2 + base64Encode2(value);
}
function deserializeRaw2(value) {
  if (typeof value !== "string") {
    return value;
  }
  if (!value.startsWith(BASE64_PREFIX2)) {
    return value;
  }
  return base64Decode2(value.slice(BASE64_PREFIX2.length));
}
function base64Decode2(input) {
  if (globalThis.Buffer) {
    return Buffer.from(input, "base64");
  }
  return Uint8Array.from(
    globalThis.atob(input),
    (c3) => c3.codePointAt(0)
  );
}
function base64Encode2(input) {
  if (globalThis.Buffer) {
    return Buffer.from(input).toString("base64");
  }
  return globalThis.btoa(String.fromCodePoint(...input));
}
function normalizeKey2(key) {
  if (!key) {
    return "";
  }
  return key.split("?")[0]?.replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") || "";
}
function joinKeys2(...keys) {
  return normalizeKey2(keys.join(":"));
}
function normalizeBaseKey2(base) {
  base = normalizeKey2(base);
  return base ? base + ":" : "";
}
function filterKeyByDepth2(key, depth) {
  if (depth === void 0) {
    return true;
  }
  let substrCount = 0;
  let index = key.indexOf(":");
  while (index > -1) {
    substrCount++;
    index = key.indexOf(":", index + 1);
  }
  return substrCount <= depth;
}
function filterKeyByBase2(key, base) {
  if (base) {
    return key.startsWith(base) && key[key.length - 1] !== "$";
  }
  return key[key.length - 1] !== "$";
}
var BASE64_PREFIX2;
var init_unstorage_zVDD2mZo = __esm({
  "../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs"() {
    BASE64_PREFIX2 = "base64:";
  }
});

// ../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/dist/index.mjs
function defineDriver2(factory) {
  return factory;
}
function createStorage2(options = {}) {
  const context = {
    mounts: { "": options.driver || memory2() },
    mountpoints: [""],
    watching: false,
    watchListeners: [],
    unwatch: {}
  };
  const getMount = (key) => {
    for (const base of context.mountpoints) {
      if (key.startsWith(base)) {
        return {
          base,
          relativeKey: key.slice(base.length),
          driver: context.mounts[base]
        };
      }
    }
    return {
      base: "",
      relativeKey: key,
      driver: context.mounts[""]
    };
  };
  const getMounts = (base, includeParent) => {
    return context.mountpoints.filter(
      (mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint)
    ).map((mountpoint) => ({
      relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0,
      mountpoint,
      driver: context.mounts[mountpoint]
    }));
  };
  const onChange = (event, key) => {
    if (!context.watching) {
      return;
    }
    key = normalizeKey2(key);
    for (const listener of context.watchListeners) {
      listener(event, key);
    }
  };
  const startWatch = async () => {
    if (context.watching) {
      return;
    }
    context.watching = true;
    for (const mountpoint in context.mounts) {
      context.unwatch[mountpoint] = await watch2(
        context.mounts[mountpoint],
        onChange,
        mountpoint
      );
    }
  };
  const stopWatch = async () => {
    if (!context.watching) {
      return;
    }
    for (const mountpoint in context.unwatch) {
      await context.unwatch[mountpoint]();
    }
    context.unwatch = {};
    context.watching = false;
  };
  const runBatch = (items, commonOptions, cb) => {
    const batches = /* @__PURE__ */ new Map();
    const getBatch = (mount) => {
      let batch = batches.get(mount.base);
      if (!batch) {
        batch = {
          driver: mount.driver,
          base: mount.base,
          items: []
        };
        batches.set(mount.base, batch);
      }
      return batch;
    };
    for (const item of items) {
      const isStringItem = typeof item === "string";
      const key = normalizeKey2(isStringItem ? item : item.key);
      const value = isStringItem ? void 0 : item.value;
      const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options };
      const mount = getMount(key);
      getBatch(mount).items.push({
        key,
        value,
        relativeKey: mount.relativeKey,
        options: options2
      });
    }
    return Promise.all([...batches.values()].map((batch) => cb(batch))).then(
      (r3) => r3.flat()
    );
  };
  const storage = {
    // Item
    hasItem(key, opts = {}) {
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      return asyncCall2(driver.hasItem, relativeKey, opts);
    },
    getItem(key, opts = {}) {
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      return asyncCall2(driver.getItem, relativeKey, opts).then(
        (value) => destr2(value)
      );
    },
    getItems(items, commonOptions = {}) {
      return runBatch(items, commonOptions, (batch) => {
        if (batch.driver.getItems) {
          return asyncCall2(
            batch.driver.getItems,
            batch.items.map((item) => ({
              key: item.relativeKey,
              options: item.options
            })),
            commonOptions
          ).then(
            (r3) => r3.map((item) => ({
              key: joinKeys2(batch.base, item.key),
              value: destr2(item.value)
            }))
          );
        }
        return Promise.all(
          batch.items.map((item) => {
            return asyncCall2(
              batch.driver.getItem,
              item.relativeKey,
              item.options
            ).then((value) => ({
              key: item.key,
              value: destr2(value)
            }));
          })
        );
      });
    },
    getItemRaw(key, opts = {}) {
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      if (driver.getItemRaw) {
        return asyncCall2(driver.getItemRaw, relativeKey, opts);
      }
      return asyncCall2(driver.getItem, relativeKey, opts).then(
        (value) => deserializeRaw2(value)
      );
    },
    async setItem(key, value, opts = {}) {
      if (value === void 0) {
        return storage.removeItem(key);
      }
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      if (!driver.setItem) {
        return;
      }
      await asyncCall2(driver.setItem, relativeKey, stringify2(value), opts);
      if (!driver.watch) {
        onChange("update", key);
      }
    },
    async setItems(items, commonOptions) {
      await runBatch(items, commonOptions, async (batch) => {
        if (batch.driver.setItems) {
          return asyncCall2(
            batch.driver.setItems,
            batch.items.map((item) => ({
              key: item.relativeKey,
              value: stringify2(item.value),
              options: item.options
            })),
            commonOptions
          );
        }
        if (!batch.driver.setItem) {
          return;
        }
        await Promise.all(
          batch.items.map((item) => {
            return asyncCall2(
              batch.driver.setItem,
              item.relativeKey,
              stringify2(item.value),
              item.options
            );
          })
        );
      });
    },
    async setItemRaw(key, value, opts = {}) {
      if (value === void 0) {
        return storage.removeItem(key, opts);
      }
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      if (driver.setItemRaw) {
        await asyncCall2(driver.setItemRaw, relativeKey, value, opts);
      } else if (driver.setItem) {
        await asyncCall2(driver.setItem, relativeKey, serializeRaw2(value), opts);
      } else {
        return;
      }
      if (!driver.watch) {
        onChange("update", key);
      }
    },
    async removeItem(key, opts = {}) {
      if (typeof opts === "boolean") {
        opts = { removeMeta: opts };
      }
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      if (!driver.removeItem) {
        return;
      }
      await asyncCall2(driver.removeItem, relativeKey, opts);
      if (opts.removeMeta || opts.removeMata) {
        await asyncCall2(driver.removeItem, relativeKey + "$", opts);
      }
      if (!driver.watch) {
        onChange("remove", key);
      }
    },
    // Meta
    async getMeta(key, opts = {}) {
      if (typeof opts === "boolean") {
        opts = { nativeOnly: opts };
      }
      key = normalizeKey2(key);
      const { relativeKey, driver } = getMount(key);
      const meta = /* @__PURE__ */ Object.create(null);
      if (driver.getMeta) {
        Object.assign(meta, await asyncCall2(driver.getMeta, relativeKey, opts));
      }
      if (!opts.nativeOnly) {
        const value = await asyncCall2(
          driver.getItem,
          relativeKey + "$",
          opts
        ).then((value_) => destr2(value_));
        if (value && typeof value === "object") {
          if (typeof value.atime === "string") {
            value.atime = new Date(value.atime);
          }
          if (typeof value.mtime === "string") {
            value.mtime = new Date(value.mtime);
          }
          Object.assign(meta, value);
        }
      }
      return meta;
    },
    setMeta(key, value, opts = {}) {
      return this.setItem(key + "$", value, opts);
    },
    removeMeta(key, opts = {}) {
      return this.removeItem(key + "$", opts);
    },
    // Keys
    async getKeys(base, opts = {}) {
      base = normalizeBaseKey2(base);
      const mounts = getMounts(base, true);
      let maskedMounts = [];
      const allKeys = [];
      let allMountsSupportMaxDepth = true;
      for (const mount of mounts) {
        if (!mount.driver.flags?.maxDepth) {
          allMountsSupportMaxDepth = false;
        }
        const rawKeys = await asyncCall2(
          mount.driver.getKeys,
          mount.relativeBase,
          opts
        );
        for (const key of rawKeys) {
          const fullKey = mount.mountpoint + normalizeKey2(key);
          if (!maskedMounts.some((p) => fullKey.startsWith(p))) {
            allKeys.push(fullKey);
          }
        }
        maskedMounts = [
          mount.mountpoint,
          ...maskedMounts.filter((p) => !p.startsWith(mount.mountpoint))
        ];
      }
      const shouldFilterByDepth = opts.maxDepth !== void 0 && !allMountsSupportMaxDepth;
      return allKeys.filter(
        (key) => (!shouldFilterByDepth || filterKeyByDepth2(key, opts.maxDepth)) && filterKeyByBase2(key, base)
      );
    },
    // Utils
    async clear(base, opts = {}) {
      base = normalizeBaseKey2(base);
      await Promise.all(
        getMounts(base, false).map(async (m) => {
          if (m.driver.clear) {
            return asyncCall2(m.driver.clear, m.relativeBase, opts);
          }
          if (m.driver.removeItem) {
            const keys = await m.driver.getKeys(m.relativeBase || "", opts);
            return Promise.all(
              keys.map((key) => m.driver.removeItem(key, opts))
            );
          }
        })
      );
    },
    async dispose() {
      await Promise.all(
        Object.values(context.mounts).map((driver) => dispose2(driver))
      );
    },
    async watch(callback) {
      await startWatch();
      context.watchListeners.push(callback);
      return async () => {
        context.watchListeners = context.watchListeners.filter(
          (listener) => listener !== callback
        );
        if (context.watchListeners.length === 0) {
          await stopWatch();
        }
      };
    },
    async unwatch() {
      context.watchListeners = [];
      await stopWatch();
    },
    // Mount
    mount(base, driver) {
      base = normalizeBaseKey2(base);
      if (base && context.mounts[base]) {
        throw new Error(`already mounted at ${base}`);
      }
      if (base) {
        context.mountpoints.push(base);
        context.mountpoints.sort((a, b3) => b3.length - a.length);
      }
      context.mounts[base] = driver;
      if (context.watching) {
        Promise.resolve(watch2(driver, onChange, base)).then((unwatcher) => {
          context.unwatch[base] = unwatcher;
        }).catch(console.error);
      }
      return storage;
    },
    async unmount(base, _dispose = true) {
      base = normalizeBaseKey2(base);
      if (!base || !context.mounts[base]) {
        return;
      }
      if (context.watching && base in context.unwatch) {
        context.unwatch[base]?.();
        delete context.unwatch[base];
      }
      if (_dispose) {
        await dispose2(context.mounts[base]);
      }
      context.mountpoints = context.mountpoints.filter((key) => key !== base);
      delete context.mounts[base];
    },
    getMount(key = "") {
      key = normalizeKey2(key) + ":";
      const m = getMount(key);
      return {
        driver: m.driver,
        base: m.base
      };
    },
    getMounts(base = "", opts = {}) {
      base = normalizeKey2(base);
      const mounts = getMounts(base, opts.parents);
      return mounts.map((m) => ({
        driver: m.driver,
        base: m.mountpoint
      }));
    },
    // Aliases
    keys: (base, opts = {}) => storage.getKeys(base, opts),
    get: (key, opts = {}) => storage.getItem(key, opts),
    set: (key, value, opts = {}) => storage.setItem(key, value, opts),
    has: (key, opts = {}) => storage.hasItem(key, opts),
    del: (key, opts = {}) => storage.removeItem(key, opts),
    remove: (key, opts = {}) => storage.removeItem(key, opts)
  };
  return storage;
}
function watch2(driver, onChange, base) {
  return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => {
  };
}
async function dispose2(driver) {
  if (typeof driver.dispose === "function") {
    await asyncCall2(driver.dispose);
  }
}
var DRIVER_NAME2, memory2;
var init_dist6 = __esm({
  "../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/dist/index.mjs"() {
    init_dist5();
    init_unstorage_zVDD2mZo();
    DRIVER_NAME2 = "memory";
    memory2 = defineDriver2(() => {
      const data = /* @__PURE__ */ new Map();
      return {
        name: DRIVER_NAME2,
        getInstance: () => data,
        hasItem(key) {
          return data.has(key);
        },
        getItem(key) {
          return data.get(key) ?? null;
        },
        getItemRaw(key) {
          return data.get(key) ?? null;
        },
        setItem(key, value) {
          data.set(key, value);
        },
        setItemRaw(key, value) {
          data.set(key, value);
        },
        removeItem(key) {
          data.delete(key);
        },
        getKeys() {
          return [...data.keys()];
        },
        clear() {
          data.clear();
        },
        dispose() {
          data.clear();
        }
      };
    });
  }
});

// ../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/drivers/utils/index.mjs
function defineDriver3(factory) {
  return factory;
}
function createError(driver, message, opts) {
  const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
  if (Error.captureStackTrace) {
    Error.captureStackTrace(err, createError);
  }
  return err;
}
var init_utils = __esm({
  "../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/drivers/utils/index.mjs"() {
  }
});

// ../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/drivers/db0.mjs
async function setupTable(opts) {
  switch (opts.database.dialect) {
    case "sqlite":
    case "libsql": {
      await opts.database.sql`
      CREATE TABLE IF NOT EXISTS {${opts.tableName}} (
        key TEXT PRIMARY KEY,
        value TEXT,
        blob BLOB,
        created_at TEXT DEFAULT CURRENT_TIMESTAMP,
        updated_at TEXT DEFAULT CURRENT_TIMESTAMP
      );
    `;
      return;
    }
    case "postgresql": {
      await opts.database.sql`
      CREATE TABLE IF NOT EXISTS {${opts.tableName}} (
        key VARCHAR(255) NOT NULL PRIMARY KEY,
        value TEXT,
        blob BYTEA,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
      );
    `;
      return;
    }
    case "mysql": {
      await opts.database.sql`
      CREATE TABLE IF NOT EXISTS {${opts.tableName}} (
        \`key\` VARCHAR(255) NOT NULL PRIMARY KEY,
        \`value\` LONGTEXT,
        \`blob\` BLOB,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
      );
    `;
      return;
    }
    default: {
      throw createError(
        DRIVER_NAME3,
        `unsuppoted SQL dialect: ${opts.database.dialect}`
      );
    }
  }
}
function toDate(timestamp) {
  return timestamp ? new Date(timestamp) : void 0;
}
var DRIVER_NAME3, DEFAULT_TABLE_NAME, kExperimentalWarning, db0_default;
var init_db0 = __esm({
  "../../../node_modules/.pnpm/unstorage@1.17.3_db0@0.2.4_better-sqlite3@11.10.0__ioredis@5.4.2/node_modules/unstorage/drivers/db0.mjs"() {
    init_utils();
    DRIVER_NAME3 = "db0";
    DEFAULT_TABLE_NAME = "unstorage";
    kExperimentalWarning = "__unstorage_db0_experimental_warning__";
    db0_default = defineDriver3((opts) => {
      opts.tableName = opts.tableName || DEFAULT_TABLE_NAME;
      let setupPromise;
      let setupDone = false;
      const ensureTable = () => {
        if (setupDone) {
          return;
        }
        if (!setupPromise) {
          if (!globalThis[kExperimentalWarning]) {
            console.warn(
              "[unstorage]: Database driver is experimental and behavior may change in the future."
            );
            globalThis[kExperimentalWarning] = true;
          }
          setupPromise = setupTable(opts).then(() => {
            setupDone = true;
            setupPromise = void 0;
          });
        }
        return setupPromise;
      };
      const isMysql = opts.database.dialect === "mysql";
      return {
        name: DRIVER_NAME3,
        options: opts,
        getInstance: () => opts.database,
        async hasItem(key) {
          await ensureTable();
          const { rows } = isMysql ? await opts.database.sql`SELECT EXISTS (SELECT 1 FROM {${opts.tableName}} WHERE \`key\` = ${key}) AS \`value\`` : await opts.database.sql`SELECT EXISTS (SELECT 1 FROM {${opts.tableName}} WHERE key = ${key}) AS value`;
          return rows?.[0]?.value == "1";
        },
        getItem: async (key) => {
          await ensureTable();
          const { rows } = isMysql ? await opts.database.sql`SELECT value FROM {${opts.tableName}} WHERE \`key\` = ${key}` : await opts.database.sql`SELECT value FROM {${opts.tableName}} WHERE key = ${key}`;
          return rows?.[0]?.value ?? null;
        },
        getItemRaw: async (key) => {
          await ensureTable();
          const { rows } = isMysql ? await opts.database.sql`SELECT \`blob\` as value FROM {${opts.tableName}} WHERE \`key\` = ${key}` : await opts.database.sql`SELECT blob as value FROM {${opts.tableName}} WHERE key = ${key}`;
          return rows?.[0]?.value ?? null;
        },
        setItem: async (key, value) => {
          await ensureTable();
          if (isMysql) {
            await opts.database.sql`INSERT INTO {${opts.tableName}} (\`key\`, \`value\`, created_at, updated_at) VALUES (${key}, ${value}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON DUPLICATE KEY UPDATE value = ${value}, updated_at = CURRENT_TIMESTAMP`;
          } else {
            await opts.database.sql`INSERT INTO {${opts.tableName}} (key, value, created_at, updated_at) VALUES (${key}, ${value}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON CONFLICT(key) DO UPDATE SET value = ${value}, updated_at = CURRENT_TIMESTAMP`;
          }
        },
        async setItemRaw(key, value) {
          await ensureTable();
          if (isMysql) {
            const blob = Buffer.from(value);
            await opts.database.sql`INSERT INTO {${opts.tableName}} (\`key\`, \`blob\`, created_at, updated_at) VALUES (${key}, ${blob}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON DUPLICATE KEY UPDATE \`blob\` = ${blob}, updated_at = CURRENT_TIMESTAMP`;
          } else {
            await opts.database.sql`INSERT INTO {${opts.tableName}} (key, blob, created_at, updated_at) VALUES (${key}, ${value}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON CONFLICT(key) DO UPDATE SET blob = ${value}, updated_at = CURRENT_TIMESTAMP`;
          }
        },
        removeItem: async (key) => {
          await ensureTable();
          if (isMysql) {
            await opts.database.sql`DELETE FROM {${opts.tableName}} WHERE \`key\`=${key}`;
          } else {
            await opts.database.sql`DELETE FROM {${opts.tableName}} WHERE key=${key}`;
          }
        },
        getMeta: async (key) => {
          await ensureTable();
          const { rows } = isMysql ? await opts.database.sql`SELECT created_at, updated_at FROM {${opts.tableName}} WHERE \`key\` = ${key}` : await opts.database.sql`SELECT created_at, updated_at FROM {${opts.tableName}} WHERE key = ${key}`;
          return {
            birthtime: toDate(rows?.[0]?.created_at),
            mtime: toDate(rows?.[0]?.updated_at)
          };
        },
        getKeys: async (base = "") => {
          await ensureTable();
          const { rows } = isMysql ? await opts.database.sql`SELECT \`key\` FROM {${opts.tableName}} WHERE \`key\` LIKE ${base + "%"}` : await opts.database.sql`SELECT key FROM {${opts.tableName}} WHERE key LIKE ${base + "%"}`;
          return rows?.map((r3) => r3.key);
        },
        clear: async () => {
          await ensureTable();
          await opts.database.sql`DELETE FROM {${opts.tableName}}`;
        }
      };
    });
  }
});

// ../../../node_modules/.pnpm/db0@0.2.4_better-sqlite3@11.10.0/node_modules/db0/dist/index.mjs
function sqlTemplate(strings, ...values) {
  if (!isTemplateStringsArray(strings) || !Array.isArray(values)) {
    throw new Error("[db0] invalid template invocation");
  }
  const staticIndexes = [];
  let result = strings[0] || "";
  for (let i3 = 1; i3 < strings.length; i3++) {
    if (result.endsWith("{") && strings[i3].startsWith("}")) {
      result = result.slice(0, -1) + values[i3 - 1] + strings[i3].slice(1);
      staticIndexes.push(i3 - 1);
      continue;
    }
    result += `?${strings[i3] ?? ""}`;
  }
  const dynamicValues = values.filter((_, i3) => !staticIndexes.includes(i3));
  return [result.trim(), dynamicValues];
}
function isTemplateStringsArray(strings) {
  return Array.isArray(strings) && "raw" in strings && Array.isArray(strings.raw);
}
function createDatabase(connector) {
  return {
    get dialect() {
      return connector.dialect;
    },
    getInstance() {
      return connector.getInstance();
    },
    exec: (sql) => {
      return Promise.resolve(connector.exec(sql));
    },
    prepare: (sql) => {
      return connector.prepare(sql);
    },
    sql: async (strings, ...values) => {
      const [sql, params] = sqlTemplate(strings, ...values);
      if (SQL_SELECT_RE.test(sql) || // prettier-ignore
      DIALECTS_WITH_RET.has(connector.dialect) && SQL_RETURNING_RE.test(sql)) {
        const rows = await connector.prepare(sql).all(...params);
        return {
          rows,
          success: true
        };
      } else {
        const res = await connector.prepare(sql).run(...params);
        return res;
      }
    }
  };
}
var SQL_SELECT_RE, SQL_RETURNING_RE, DIALECTS_WITH_RET, connectors;
var init_dist7 = __esm({
  "../../../node_modules/.pnpm/db0@0.2.4_better-sqlite3@11.10.0/node_modules/db0/dist/index.mjs"() {
    SQL_SELECT_RE = /^select/i;
    SQL_RETURNING_RE = /[\s]returning[\s]/i;
    DIALECTS_WITH_RET = /* @__PURE__ */ new Set(["postgresql", "sqlite"]);
    connectors = Object.freeze({
      "better-sqlite3": "db0/connectors/better-sqlite3",
      /** @deprecated Alias of better-sqlite3 */
      "sqlite": "db0/connectors/better-sqlite3",
      "bun-sqlite": "db0/connectors/bun-sqlite",
      /** @deprecated Alias of bun-sqlite */
      "bun": "db0/connectors/bun-sqlite",
      "cloudflare-d1": "db0/connectors/cloudflare-d1",
      "libsql-core": "db0/connectors/libsql/core",
      "libsql-http": "db0/connectors/libsql/http",
      "libsql-node": "db0/connectors/libsql/node",
      /** @deprecated Alias of libsql-node */
      "libsql": "db0/connectors/libsql/node",
      "libsql-web": "db0/connectors/libsql/web",
      "mysql2": "db0/connectors/mysql2",
      "node-sqlite3": "db0/connectors/node-sqlite3",
      "pglite": "db0/connectors/pglite",
      "planetscale": "db0/connectors/planetscale",
      "postgresql": "db0/connectors/postgresql"
    });
  }
});

// ../../../node_modules/.pnpm/db0@0.2.4_better-sqlite3@11.10.0/node_modules/db0/connectors/better-sqlite3.mjs
function sqliteConnector(opts) {
  let _db;
  const getDB = () => {
    if (_db) {
      return _db;
    }
    if (opts.name === ":memory:") {
      _db = new import_better_sqlite3.default(":memory:");
      return _db;
    }
    const filePath = (0, import_node_path3.resolve)(
      opts.cwd || ".",
      opts.path || `.data/${opts.name || "db"}.sqlite3`
    );
    (0, import_node_fs2.mkdirSync)((0, import_node_path3.dirname)(filePath), { recursive: true });
    _db = new import_better_sqlite3.default(filePath);
    return _db;
  };
  return {
    name: "sqlite",
    dialect: "sqlite",
    getInstance: () => getDB(),
    exec(sql) {
      return getDB().exec(sql);
    },
    prepare(sql) {
      const _stmt = getDB().prepare(sql);
      const stmt = {
        bind(...params) {
          if (params.length > 0) {
            _stmt.bind(...params);
          }
          return stmt;
        },
        all(...params) {
          return Promise.resolve(_stmt.all(...params));
        },
        run(...params) {
          const res = _stmt.run(...params);
          return Promise.resolve({ success: res.changes > 0 });
        },
        get(...params) {
          return Promise.resolve(_stmt.get(...params));
        }
      };
      return stmt;
    }
  };
}
var import_node_path3, import_node_fs2, import_better_sqlite3;
var init_better_sqlite3 = __esm({
  "../../../node_modules/.pnpm/db0@0.2.4_better-sqlite3@11.10.0/node_modules/db0/connectors/better-sqlite3.mjs"() {
    import_node_path3 = require("node:path");
    import_node_fs2 = require("node:fs");
    import_better_sqlite3 = __toESM(require("better-sqlite3"), 1);
  }
});

// ../../../packages/persistence/dist/drivers/sqlite.js
var sqlite_exports = {};
__export(sqlite_exports, {
  sqliteDriver: () => sqliteDriver
});
function sqliteDriver(options) {
  return {
    async createStorage() {
      const connector = sqliteConnector({ path: options.path });
      const database = createDatabase(connector);
      return createStorage2({
        driver: db0_default({ database })
      });
    }
  };
}
var init_sqlite = __esm({
  "../../../packages/persistence/dist/drivers/sqlite.js"() {
    init_dist6();
    init_db0();
    init_dist7();
    init_better_sqlite3();
  }
});

// ../../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js
var require_delayed_stream = __commonJS({
  "../../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) {
    var Stream = require("stream").Stream;
    var util = require("util");
    module2.exports = DelayedStream;
    function DelayedStream() {
      this.source = null;
      this.dataSize = 0;
      this.maxDataSize = 1024 * 1024;
      this.pauseStream = true;
      this._maxDataSizeExceeded = false;
      this._released = false;
      this._bufferedEvents = [];
    }
    util.inherits(DelayedStream, Stream);
    DelayedStream.create = function(source, options) {
      var delayedStream = new this();
      options = options || {};
      for (var option in options) {
        delayedStream[option] = options[option];
      }
      delayedStream.source = source;
      var realEmit = source.emit;
      source.emit = function() {
        delayedStream._handleEmit(arguments);
        return realEmit.apply(source, arguments);
      };
      source.on("error", function() {
      });
      if (delayedStream.pauseStream) {
        source.pause();
      }
      return delayedStream;
    };
    Object.defineProperty(DelayedStream.prototype, "readable", {
      configurable: true,
      enumerable: true,
      get: function() {
        return this.source.readable;
      }
    });
    DelayedStream.prototype.setEncoding = function() {
      return this.source.setEncoding.apply(this.source, arguments);
    };
    DelayedStream.prototype.resume = function() {
      if (!this._released) {
        this.release();
      }
      this.source.resume();
    };
    DelayedStream.prototype.pause = function() {
      this.source.pause();
    };
    DelayedStream.prototype.release = function() {
      this._released = true;
      this._bufferedEvents.forEach(function(args) {
        this.emit.apply(this, args);
      }.bind(this));
      this._bufferedEvents = [];
    };
    DelayedStream.prototype.pipe = function() {
      var r3 = Stream.prototype.pipe.apply(this, arguments);
      this.resume();
      return r3;
    };
    DelayedStream.prototype._handleEmit = function(args) {
      if (this._released) {
        this.emit.apply(this, args);
        return;
      }
      if (args[0] === "data") {
        this.dataSize += args[1].length;
        this._checkIfMaxDataSizeExceeded();
      }
      this._bufferedEvents.push(args);
    };
    DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
      if (this._maxDataSizeExceeded) {
        return;
      }
      if (this.dataSize <= this.maxDataSize) {
        return;
      }
      this._maxDataSizeExceeded = true;
      var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
      this.emit("error", new Error(message));
    };
  }
});

// ../../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js
var require_combined_stream = __commonJS({
  "../../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) {
    var util = require("util");
    var Stream = require("stream").Stream;
    var DelayedStream = require_delayed_stream();
    module2.exports = CombinedStream;
    function CombinedStream() {
      this.writable = false;
      this.readable = true;
      this.dataSize = 0;
      this.maxDataSize = 2 * 1024 * 1024;
      this.pauseStreams = true;
      this._released = false;
      this._streams = [];
      this._currentStream = null;
      this._insideLoop = false;
      this._pendingNext = false;
    }
    util.inherits(CombinedStream, Stream);
    CombinedStream.create = function(options) {
      var combinedStream = new this();
      options = options || {};
      for (var option in options) {
        combinedStream[option] = options[option];
      }
      return combinedStream;
    };
    CombinedStream.isStreamLike = function(stream) {
      return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream);
    };
    CombinedStream.prototype.append = function(stream) {
      var isStreamLike = CombinedStream.isStreamLike(stream);
      if (isStreamLike) {
        if (!(stream instanceof DelayedStream)) {
          var newStream = DelayedStream.create(stream, {
            maxDataSize: Infinity,
            pauseStream: this.pauseStreams
          });
          stream.on("data", this._checkDataSize.bind(this));
          stream = newStream;
        }
        this._handleErrors(stream);
        if (this.pauseStreams) {
          stream.pause();
        }
      }
      this._streams.push(stream);
      return this;
    };
    CombinedStream.prototype.pipe = function(dest, options) {
      Stream.prototype.pipe.call(this, dest, options);
      this.resume();
      return dest;
    };
    CombinedStream.prototype._getNext = function() {
      this._currentStream = null;
      if (this._insideLoop) {
        this._pendingNext = true;
        return;
      }
      this._insideLoop = true;
      try {
        do {
          this._pendingNext = false;
          this._realGetNext();
        } while (this._pendingNext);
      } finally {
        this._insideLoop = false;
      }
    };
    CombinedStream.prototype._realGetNext = function() {
      var stream = this._streams.shift();
      if (typeof stream == "undefined") {
        this.end();
        return;
      }
      if (typeof stream !== "function") {
        this._pipeNext(stream);
        return;
      }
      var getStream = stream;
      getStream(function(stream2) {
        var isStreamLike = CombinedStream.isStreamLike(stream2);
        if (isStreamLike) {
          stream2.on("data", this._checkDataSize.bind(this));
          this._handleErrors(stream2);
        }
        this._pipeNext(stream2);
      }.bind(this));
    };
    CombinedStream.prototype._pipeNext = function(stream) {
      this._currentStream = stream;
      var isStreamLike = CombinedStream.isStreamLike(stream);
      if (isStreamLike) {
        stream.on("end", this._getNext.bind(this));
        stream.pipe(this, { end: false });
        return;
      }
      var value = stream;
      this.write(value);
      this._getNext();
    };
    CombinedStream.prototype._handleErrors = function(stream) {
      var self2 = this;
      stream.on("error", function(err) {
        self2._emitError(err);
      });
    };
    CombinedStream.prototype.write = function(data) {
      this.emit("data", data);
    };
    CombinedStream.prototype.pause = function() {
      if (!this.pauseStreams) {
        return;
      }
      if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause();
      this.emit("pause");
    };
    CombinedStream.prototype.resume = function() {
      if (!this._released) {
        this._released = true;
        this.writable = true;
        this._getNext();
      }
      if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume();
      this.emit("resume");
    };
    CombinedStream.prototype.end = function() {
      this._reset();
      this.emit("end");
    };
    CombinedStream.prototype.destroy = function() {
      this._reset();
      this.emit("close");
    };
    CombinedStream.prototype._reset = function() {
      this.writable = false;
      this._streams = [];
      this._currentStream = null;
    };
    CombinedStream.prototype._checkDataSize = function() {
      this._updateDataSize();
      if (this.dataSize <= this.maxDataSize) {
        return;
      }
      var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
      this._emitError(new Error(message));
    };
    CombinedStream.prototype._updateDataSize = function() {
      this.dataSize = 0;
      var self2 = this;
      this._streams.forEach(function(stream) {
        if (!stream.dataSize) {
          return;
        }
        self2.dataSize += stream.dataSize;
      });
      if (this._currentStream && this._currentStream.dataSize) {
        this.dataSize += this._currentStream.dataSize;
      }
    };
    CombinedStream.prototype._emitError = function(err) {
      this._reset();
      this.emit("error", err);
    };
  }
});

// ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json
var require_db = __commonJS({
  "../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) {
    module2.exports = {
      "application/1d-interleaved-parityfec": {
        source: "iana"
      },
      "application/3gpdash-qoe-report+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/3gpp-ims+xml": {
        source: "iana",
        compressible: true
      },
      "application/3gpphal+json": {
        source: "iana",
        compressible: true
      },
      "application/3gpphalforms+json": {
        source: "iana",
        compressible: true
      },
      "application/a2l": {
        source: "iana"
      },
      "application/ace+cbor": {
        source: "iana"
      },
      "application/activemessage": {
        source: "iana"
      },
      "application/activity+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-costmap+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-costmapfilter+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-directory+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointcost+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointcostparams+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointprop+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-endpointpropparams+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-error+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-networkmap+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-networkmapfilter+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-updatestreamcontrol+json": {
        source: "iana",
        compressible: true
      },
      "application/alto-updatestreamparams+json": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["atom"]
      },
      "application/atomcat+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomcat"]
      },
      "application/atomdeleted+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomdeleted"]
      },
      "application/atomicmail": {
        source: "iana"
      },
      "application/atomsvc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["atomsvc"]
      },
      "application/atsc-dwd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["dwd"]
      },
      "application/atsc-dynamic-event-message": {
        source: "iana"
      },
      "application/atsc-held+xml": {
        source: "iana",
        compressible: true,
        extensions: ["held"]
      },
      "application/atsc-rdt+json": {
        source: "iana",
        compressible: true
      },
      "application/atsc-rsat+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rsat"]
      },
      "application/atxml": {
        source: "iana"
      },
      "application/auth-policy+xml": {
        source: "iana",
        compressible: true
      },
      "application/bacnet-xdd+zip": {
        source: "iana",
        compressible: false
      },
      "application/batch-smtp": {
        source: "iana"
      },
      "application/bdoc": {
        compressible: false,
        extensions: ["bdoc"]
      },
      "application/beep+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/calendar+json": {
        source: "iana",
        compressible: true
      },
      "application/calendar+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xcs"]
      },
      "application/call-completion": {
        source: "iana"
      },
      "application/cals-1840": {
        source: "iana"
      },
      "application/captive+json": {
        source: "iana",
        compressible: true
      },
      "application/cbor": {
        source: "iana"
      },
      "application/cbor-seq": {
        source: "iana"
      },
      "application/cccex": {
        source: "iana"
      },
      "application/ccmp+xml": {
        source: "iana",
        compressible: true
      },
      "application/ccxml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ccxml"]
      },
      "application/cdfx+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "application/cellml+xml": {
        source: "iana",
        compressible: true
      },
      "application/cfw": {
        source: "iana"
      },
      "application/city+json": {
        source: "iana",
        compressible: true
      },
      "application/clr": {
        source: "iana"
      },
      "application/clue+xml": {
        source: "iana",
        compressible: true
      },
      "application/clue_info+xml": {
        source: "iana",
        compressible: true
      },
      "application/cms": {
        source: "iana"
      },
      "application/cnrp+xml": {
        source: "iana",
        compressible: true
      },
      "application/coap-group+json": {
        source: "iana",
        compressible: true
      },
      "application/coap-payload": {
        source: "iana"
      },
      "application/commonground": {
        source: "iana"
      },
      "application/conference-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/cose": {
        source: "iana"
      },
      "application/cose-key": {
        source: "iana"
      },
      "application/cose-key-set": {
        source: "iana"
      },
      "application/cpl+xml": {
        source: "iana",
        compressible: true,
        extensions: ["cpl"]
      },
      "application/csrattrs": {
        source: "iana"
      },
      "application/csta+xml": {
        source: "iana",
        compressible: true
      },
      "application/cstadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/csvm+json": {
        source: "iana",
        compressible: true
      },
      "application/cu-seeme": {
        source: "apache",
        extensions: ["cu"]
      },
      "application/cwt": {
        source: "iana"
      },
      "application/cybercash": {
        source: "iana"
      },
      "application/dart": {
        compressible: true
      },
      "application/dash+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpd"]
      },
      "application/dash-patch+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpp"]
      },
      "application/dashdelta": {
        source: "iana"
      },
      "application/davmount+xml": {
        source: "iana",
        compressible: true,
        extensions: ["davmount"]
      },
      "application/dca-rft": {
        source: "iana"
      },
      "application/dcd": {
        source: "iana"
      },
      "application/dec-dx": {
        source: "iana"
      },
      "application/dialog-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/dicom": {
        source: "iana"
      },
      "application/dicom+json": {
        source: "iana",
        compressible: true
      },
      "application/dicom+xml": {
        source: "iana",
        compressible: true
      },
      "application/dii": {
        source: "iana"
      },
      "application/dit": {
        source: "iana"
      },
      "application/dns": {
        source: "iana"
      },
      "application/dns+json": {
        source: "iana",
        compressible: true
      },
      "application/dns-message": {
        source: "iana"
      },
      "application/docbook+xml": {
        source: "apache",
        compressible: true,
        extensions: ["dbk"]
      },
      "application/dots+cbor": {
        source: "iana"
      },
      "application/dskpp+xml": {
        source: "iana",
        compressible: true
      },
      "application/dssc+der": {
        source: "iana",
        extensions: ["dssc"]
      },
      "application/dssc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xdssc"]
      },
      "application/dvcs": {
        source: "iana"
      },
      "application/ecmascript": {
        source: "iana",
        compressible: true,
        extensions: ["es", "ecma"]
      },
      "application/edi-consent": {
        source: "iana"
      },
      "application/edi-x12": {
        source: "iana",
        compressible: false
      },
      "application/edifact": {
        source: "iana",
        compressible: false
      },
      "application/efi": {
        source: "iana"
      },
      "application/elm+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/elm+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.cap+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/emergencycalldata.comment+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.control+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.deviceinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.ecall.msd": {
        source: "iana"
      },
      "application/emergencycalldata.providerinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.serviceinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.subscriberinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/emergencycalldata.veds+xml": {
        source: "iana",
        compressible: true
      },
      "application/emma+xml": {
        source: "iana",
        compressible: true,
        extensions: ["emma"]
      },
      "application/emotionml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["emotionml"]
      },
      "application/encaprtp": {
        source: "iana"
      },
      "application/epp+xml": {
        source: "iana",
        compressible: true
      },
      "application/epub+zip": {
        source: "iana",
        compressible: false,
        extensions: ["epub"]
      },
      "application/eshop": {
        source: "iana"
      },
      "application/exi": {
        source: "iana",
        extensions: ["exi"]
      },
      "application/expect-ct-report+json": {
        source: "iana",
        compressible: true
      },
      "application/express": {
        source: "iana",
        extensions: ["exp"]
      },
      "application/fastinfoset": {
        source: "iana"
      },
      "application/fastsoap": {
        source: "iana"
      },
      "application/fdt+xml": {
        source: "iana",
        compressible: true,
        extensions: ["fdt"]
      },
      "application/fhir+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/fhir+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/fido.trusted-apps+json": {
        compressible: true
      },
      "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: false
      },
      "application/framework-attributes+xml": {
        source: "iana",
        compressible: true
      },
      "application/geo+json": {
        source: "iana",
        compressible: true,
        extensions: ["geojson"]
      },
      "application/geo+json-seq": {
        source: "iana"
      },
      "application/geopackage+sqlite3": {
        source: "iana"
      },
      "application/geoxacml+xml": {
        source: "iana",
        compressible: true
      },
      "application/gltf-buffer": {
        source: "iana"
      },
      "application/gml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["gml"]
      },
      "application/gpx+xml": {
        source: "apache",
        compressible: true,
        extensions: ["gpx"]
      },
      "application/gxf": {
        source: "apache",
        extensions: ["gxf"]
      },
      "application/gzip": {
        source: "iana",
        compressible: false,
        extensions: ["gz"]
      },
      "application/h224": {
        source: "iana"
      },
      "application/held+xml": {
        source: "iana",
        compressible: true
      },
      "application/hjson": {
        extensions: ["hjson"]
      },
      "application/http": {
        source: "iana"
      },
      "application/hyperstudio": {
        source: "iana",
        extensions: ["stk"]
      },
      "application/ibe-key-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/ibe-pkg-reply+xml": {
        source: "iana",
        compressible: true
      },
      "application/ibe-pp-data": {
        source: "iana"
      },
      "application/iges": {
        source: "iana"
      },
      "application/im-iscomposing+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "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: true,
        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: true,
        extensions: ["its"]
      },
      "application/java-archive": {
        source: "apache",
        compressible: false,
        extensions: ["jar", "war", "ear"]
      },
      "application/java-serialized-object": {
        source: "apache",
        compressible: false,
        extensions: ["ser"]
      },
      "application/java-vm": {
        source: "apache",
        compressible: false,
        extensions: ["class"]
      },
      "application/javascript": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["js", "mjs"]
      },
      "application/jf2feed+json": {
        source: "iana",
        compressible: true
      },
      "application/jose": {
        source: "iana"
      },
      "application/jose+json": {
        source: "iana",
        compressible: true
      },
      "application/jrd+json": {
        source: "iana",
        compressible: true
      },
      "application/jscalendar+json": {
        source: "iana",
        compressible: true
      },
      "application/json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["json", "map"]
      },
      "application/json-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/json-seq": {
        source: "iana"
      },
      "application/json5": {
        extensions: ["json5"]
      },
      "application/jsonml+json": {
        source: "apache",
        compressible: true,
        extensions: ["jsonml"]
      },
      "application/jwk+json": {
        source: "iana",
        compressible: true
      },
      "application/jwk-set+json": {
        source: "iana",
        compressible: true
      },
      "application/jwt": {
        source: "iana"
      },
      "application/kpml-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/kpml-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/ld+json": {
        source: "iana",
        compressible: true,
        extensions: ["jsonld"]
      },
      "application/lgr+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lgr"]
      },
      "application/link-format": {
        source: "iana"
      },
      "application/load-control+xml": {
        source: "iana",
        compressible: true
      },
      "application/lost+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lostxml"]
      },
      "application/lostsync+xml": {
        source: "iana",
        compressible: true
      },
      "application/lpf+zip": {
        source: "iana",
        compressible: false
      },
      "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: true,
        extensions: ["mads"]
      },
      "application/manifest+json": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["webmanifest"]
      },
      "application/marc": {
        source: "iana",
        extensions: ["mrc"]
      },
      "application/marcxml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mrcx"]
      },
      "application/mathematica": {
        source: "iana",
        extensions: ["ma", "nb", "mb"]
      },
      "application/mathml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mathml"]
      },
      "application/mathml-content+xml": {
        source: "iana",
        compressible: true
      },
      "application/mathml-presentation+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-associated-procedure-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-deregister+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-envelope+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-msk+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-msk-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-protection-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-reception-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-register+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-register-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-schedule+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbms-user-service-description+xml": {
        source: "iana",
        compressible: true
      },
      "application/mbox": {
        source: "iana",
        extensions: ["mbox"]
      },
      "application/media-policy-dataset+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mpf"]
      },
      "application/media_control+xml": {
        source: "iana",
        compressible: true
      },
      "application/mediaservercontrol+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mscml"]
      },
      "application/merge-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/metalink+xml": {
        source: "apache",
        compressible: true,
        extensions: ["metalink"]
      },
      "application/metalink4+xml": {
        source: "iana",
        compressible: true,
        extensions: ["meta4"]
      },
      "application/mets+xml": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["maei"]
      },
      "application/mmt-usd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["musd"]
      },
      "application/mods+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "application/mrb-publish+xml": {
        source: "iana",
        compressible: true
      },
      "application/msc-ivr+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/msc-mixer+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/msword": {
        source: "iana",
        compressible: false,
        extensions: ["doc", "dot"]
      },
      "application/mud+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: false,
        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: true
      },
      "application/odx": {
        source: "iana"
      },
      "application/oebps-package+xml": {
        source: "iana",
        compressible: true,
        extensions: ["opf"]
      },
      "application/ogg": {
        source: "iana",
        compressible: false,
        extensions: ["ogx"]
      },
      "application/omdoc+xml": {
        source: "apache",
        compressible: true,
        extensions: ["omdoc"]
      },
      "application/onenote": {
        source: "apache",
        extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"]
      },
      "application/opc-nodeset+xml": {
        source: "iana",
        compressible: true
      },
      "application/oscore": {
        source: "iana"
      },
      "application/oxps": {
        source: "iana",
        extensions: ["oxps"]
      },
      "application/p21": {
        source: "iana"
      },
      "application/p21+zip": {
        source: "iana",
        compressible: false
      },
      "application/p2p-overlay+xml": {
        source: "iana",
        compressible: true,
        extensions: ["relo"]
      },
      "application/parityfec": {
        source: "iana"
      },
      "application/passport": {
        source: "iana"
      },
      "application/patch-ops-error+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xer"]
      },
      "application/pdf": {
        source: "iana",
        compressible: false,
        extensions: ["pdf"]
      },
      "application/pdx": {
        source: "iana"
      },
      "application/pem-certificate-chain": {
        source: "iana"
      },
      "application/pgp-encrypted": {
        source: "iana",
        compressible: false,
        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: true
      },
      "application/pidf-diff+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "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: true,
        extensions: ["pls"]
      },
      "application/poc-settings+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/postscript": {
        source: "iana",
        compressible: true,
        extensions: ["ai", "eps", "ps"]
      },
      "application/ppsp-tracker+json": {
        source: "iana",
        compressible: true
      },
      "application/problem+json": {
        source: "iana",
        compressible: true
      },
      "application/problem+xml": {
        source: "iana",
        compressible: true
      },
      "application/provenance+xml": {
        source: "iana",
        compressible: true,
        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: false
      },
      "application/prs.nprend": {
        source: "iana"
      },
      "application/prs.plucker": {
        source: "iana"
      },
      "application/prs.rdf-xml-crypt": {
        source: "iana"
      },
      "application/prs.xsf+xml": {
        source: "iana",
        compressible: true
      },
      "application/pskc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["pskcxml"]
      },
      "application/pvd+json": {
        source: "iana",
        compressible: true
      },
      "application/qsig": {
        source: "iana"
      },
      "application/raml+yaml": {
        compressible: true,
        extensions: ["raml"]
      },
      "application/raptorfec": {
        source: "iana"
      },
      "application/rdap+json": {
        source: "iana",
        compressible: true
      },
      "application/rdf+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rdf", "owl"]
      },
      "application/reginfo+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rif"]
      },
      "application/relax-ng-compact-syntax": {
        source: "iana",
        extensions: ["rnc"]
      },
      "application/remote-printing": {
        source: "iana"
      },
      "application/reputon+json": {
        source: "iana",
        compressible: true
      },
      "application/resource-lists+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rl"]
      },
      "application/resource-lists-diff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rld"]
      },
      "application/rfc+xml": {
        source: "iana",
        compressible: true
      },
      "application/riscos": {
        source: "iana"
      },
      "application/rlmi+xml": {
        source: "iana",
        compressible: true
      },
      "application/rls-services+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rs"]
      },
      "application/route-apd+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rapd"]
      },
      "application/route-s-tsid+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sls"]
      },
      "application/route-usd+xml": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["rsd"]
      },
      "application/rss+xml": {
        source: "apache",
        compressible: true,
        extensions: ["rss"]
      },
      "application/rtf": {
        source: "iana",
        compressible: true,
        extensions: ["rtf"]
      },
      "application/rtploopback": {
        source: "iana"
      },
      "application/rtx": {
        source: "iana"
      },
      "application/samlassertion+xml": {
        source: "iana",
        compressible: true
      },
      "application/samlmetadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/sarif+json": {
        source: "iana",
        compressible: true
      },
      "application/sarif-external-properties+json": {
        source: "iana",
        compressible: true
      },
      "application/sbe": {
        source: "iana"
      },
      "application/sbml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sbml"]
      },
      "application/scaip+xml": {
        source: "iana",
        compressible: true
      },
      "application/scim+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/senml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["senmlx"]
      },
      "application/senml-etch+cbor": {
        source: "iana"
      },
      "application/senml-etch+json": {
        source: "iana",
        compressible: true
      },
      "application/senml-exi": {
        source: "iana"
      },
      "application/sensml+cbor": {
        source: "iana"
      },
      "application/sensml+json": {
        source: "iana",
        compressible: true
      },
      "application/sensml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sensmlx"]
      },
      "application/sensml-exi": {
        source: "iana"
      },
      "application/sep+xml": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["shf"]
      },
      "application/sieve": {
        source: "iana",
        extensions: ["siv", "sieve"]
      },
      "application/simple-filter+xml": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["smi", "smil"]
      },
      "application/smpte336m": {
        source: "iana"
      },
      "application/soap+fastinfoset": {
        source: "iana"
      },
      "application/soap+xml": {
        source: "iana",
        compressible: true
      },
      "application/sparql-query": {
        source: "iana",
        extensions: ["rq"]
      },
      "application/sparql-results+xml": {
        source: "iana",
        compressible: true,
        extensions: ["srx"]
      },
      "application/spdx+json": {
        source: "iana",
        compressible: true
      },
      "application/spirits-event+xml": {
        source: "iana",
        compressible: true
      },
      "application/sql": {
        source: "iana"
      },
      "application/srgs": {
        source: "iana",
        extensions: ["gram"]
      },
      "application/srgs+xml": {
        source: "iana",
        compressible: true,
        extensions: ["grxml"]
      },
      "application/sru+xml": {
        source: "iana",
        compressible: true,
        extensions: ["sru"]
      },
      "application/ssdl+xml": {
        source: "apache",
        compressible: true,
        extensions: ["ssdl"]
      },
      "application/ssml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ssml"]
      },
      "application/stix+json": {
        source: "iana",
        compressible: true
      },
      "application/swid+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "application/taxii+json": {
        source: "iana",
        compressible: true
      },
      "application/td+json": {
        source: "iana",
        compressible: true
      },
      "application/tei+xml": {
        source: "iana",
        compressible: true,
        extensions: ["tei", "teicorpus"]
      },
      "application/tetra_isi": {
        source: "iana"
      },
      "application/thraud+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "application/tnauthlist": {
        source: "iana"
      },
      "application/token-introspection+jwt": {
        source: "iana"
      },
      "application/toml": {
        compressible: true,
        extensions: ["toml"]
      },
      "application/trickle-ice-sdpfrag": {
        source: "iana"
      },
      "application/trig": {
        source: "iana",
        extensions: ["trig"]
      },
      "application/ttml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["ttml"]
      },
      "application/tve-trigger": {
        source: "iana"
      },
      "application/tzif": {
        source: "iana"
      },
      "application/tzif-leap": {
        source: "iana"
      },
      "application/ubjson": {
        compressible: false,
        extensions: ["ubj"]
      },
      "application/ulpfec": {
        source: "iana"
      },
      "application/urc-grpsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/urc-ressheet+xml": {
        source: "iana",
        compressible: true,
        extensions: ["rsheet"]
      },
      "application/urc-targetdesc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["td"]
      },
      "application/urc-uisocketdesc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vcard+json": {
        source: "iana",
        compressible: true
      },
      "application/vcard+xml": {
        source: "iana",
        compressible: true
      },
      "application/vemmi": {
        source: "iana"
      },
      "application/vividence.scriptfile": {
        source: "apache"
      },
      "application/vnd.1000minds.decision-model+xml": {
        source: "iana",
        compressible: true,
        extensions: ["1km"]
      },
      "application/vnd.3gpp-prose+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp-prose-pc3ch+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.3gpp.bsf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.gmop+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.3gpp.mcdata-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-payload": {
        source: "iana"
      },
      "application/vnd.3gpp.mcdata-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-signalling": {
        source: "iana"
      },
      "application/vnd.3gpp.mcdata-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcdata-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-affiliation-command+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-floor-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-location-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-signed+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-ue-init-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcptt-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-affiliation-command+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-affiliation-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-location-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-service-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-transmission-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-ue-config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mcvideo-user-profile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.mid-call+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.3gpp.srvcc-ext+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.srvcc-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.state-and-event-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp.ussd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.3gpp2.bcmcsinfo+xml": {
        source: "iana",
        compressible: true
      },
      "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: false,
        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: true,
        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: true
      },
      "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: true
      },
      "application/vnd.android.ota": {
        source: "iana"
      },
      "application/vnd.android.package-archive": {
        source: "apache",
        compressible: false,
        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: true
      },
      "application/vnd.aplextor.warrp+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.apothekende.reservation+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.apple.installer+xml": {
        source: "iana",
        compressible: true,
        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: false,
        extensions: ["pkpass"]
      },
      "application/vnd.arastra.swi": {
        source: "iana"
      },
      "application/vnd.aristanetworks.swi": {
        source: "iana",
        extensions: ["swi"]
      },
      "application/vnd.artisan+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.avistar+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.balsamiq.bmml+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "application/vnd.bekitzur-stech+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.bint.med-content": {
        source: "iana"
      },
      "application/vnd.biopax.rdf+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.cendio.thinlinc.clientconf": {
        source: "iana"
      },
      "application/vnd.century-systems.tcp_stream": {
        source: "iana"
      },
      "application/vnd.chemdraw+xml": {
        source: "iana",
        compressible: true,
        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: true,
        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: true
      },
      "application/vnd.collection.doc+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.collection.next+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.comicbook+zip": {
        source: "iana",
        compressible: false
      },
      "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: true
      },
      "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: true,
        extensions: ["wbs"]
      },
      "application/vnd.cryptii.pipe+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.cybank": {
        source: "iana"
      },
      "application/vnd.cyclonedx+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.cyclonedx+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.d2l.coursepackage1p0+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.d3m-dataset": {
        source: "iana"
      },
      "application/vnd.d3m-problem": {
        source: "iana"
      },
      "application/vnd.dart": {
        source: "iana",
        compressible: true,
        extensions: ["dart"]
      },
      "application/vnd.data-vision.rdz": {
        source: "iana",
        extensions: ["rdz"]
      },
      "application/vnd.datapackage+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dataresource+json": {
        source: "iana",
        compressible: true
      },
      "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: true,
        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: true
      },
      "application/vnd.dna": {
        source: "iana",
        extensions: ["dna"]
      },
      "application/vnd.document+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.dvb.notif-container+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-generic+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-msglist+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-registration-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-ia-registration-response+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.dvb.notif-init+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.enliven": {
        source: "iana",
        extensions: ["nml"]
      },
      "application/vnd.enphase.envoy": {
        source: "iana"
      },
      "application/vnd.eprints.data+xml": {
        source: "iana",
        compressible: true
      },
      "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: false
      },
      "application/vnd.eszigno3+xml": {
        source: "iana",
        compressible: true,
        extensions: ["es3", "et3"]
      },
      "application/vnd.etsi.aoc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.asic-e+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.etsi.asic-s+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.etsi.cug+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvcommand+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvdiscovery+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-bc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-cod+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsad-npvr+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvservice+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvsync+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.iptvueprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.mcid+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.mheg5": {
        source: "iana"
      },
      "application/vnd.etsi.overload-control-policy-dataset+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.pstn+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.sci+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.simservs+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.timestamp-token": {
        source: "iana"
      },
      "application/vnd.etsi.tsl+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.etsi.tsl.der": {
        source: "iana"
      },
      "application/vnd.eu.kasparian.car+json": {
        source: "iana",
        compressible: true
      },
      "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: false
      },
      "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: false
      },
      "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: false
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.fuzzysheet": {
        source: "iana",
        extensions: ["fzs"]
      },
      "application/vnd.genomatix.tuxedo": {
        source: "iana",
        extensions: ["txd"]
      },
      "application/vnd.gentics.grd+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.geo+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.geocube+xml": {
        source: "iana",
        compressible: true
      },
      "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: false,
        extensions: ["gdoc"]
      },
      "application/vnd.google-apps.presentation": {
        compressible: false,
        extensions: ["gslides"]
      },
      "application/vnd.google-apps.spreadsheet": {
        compressible: false,
        extensions: ["gsheet"]
      },
      "application/vnd.google-earth.kml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["kml"]
      },
      "application/vnd.google-earth.kmz": {
        source: "iana",
        compressible: false,
        extensions: ["kmz"]
      },
      "application/vnd.gov.sk.e-form+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.gov.sk.e-form+zip": {
        source: "iana",
        compressible: false
      },
      "application/vnd.gov.sk.xmldatacontainer+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.hal+xml": {
        source: "iana",
        compressible: true,
        extensions: ["hal"]
      },
      "application/vnd.handheld-entertainment+xml": {
        source: "iana",
        compressible: true,
        extensions: ["zmm"]
      },
      "application/vnd.hbci": {
        source: "iana",
        extensions: ["hbci"]
      },
      "application/vnd.hc+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hcl-bireports": {
        source: "iana"
      },
      "application/vnd.hdt": {
        source: "iana"
      },
      "application/vnd.heroku+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hhe.lesson-player": {
        source: "iana",
        extensions: ["les"]
      },
      "application/vnd.hl7cda+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.hl7v2+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "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: true
      },
      "application/vnd.hyper-item+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.hyperdrive+json": {
        source: "iana",
        compressible: true
      },
      "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: false
      },
      "application/vnd.imagemeter.image+zip": {
        source: "iana",
        compressible: false
      },
      "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: true
      },
      "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolproxy+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolproxy.id+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolsettings+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ims.lti.v2.toolsettings.simple+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.informedcontrol.rms+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.informix-visionary": {
        source: "iana"
      },
      "application/vnd.infotech.project": {
        source: "iana"
      },
      "application/vnd.infotech.project+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.iptc.g2.conceptitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.knowledgeitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.newsitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.newsmessage+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.packageitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.iptc.g2.planningitem+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.ipunplugged.rcprofile": {
        source: "iana",
        extensions: ["rcprofile"]
      },
      "application/vnd.irepository.package+xml": {
        source: "iana",
        compressible: true,
        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: false
      },
      "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: true
      },
      "application/vnd.las.las+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lasxml"]
      },
      "application/vnd.laszip": {
        source: "iana"
      },
      "application/vnd.leap+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.liberty-request+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.llamagraphics.life-balance.desktop": {
        source: "iana",
        extensions: ["lbd"]
      },
      "application/vnd.llamagraphics.life-balance.exchange+xml": {
        source: "iana",
        compressible: true,
        extensions: ["lbe"]
      },
      "application/vnd.logipipe.circuit+zip": {
        source: "iana",
        compressible: false
      },
      "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: true
      },
      "application/vnd.marlin.drm.conftoken+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.marlin.drm.license+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.marlin.drm.mdcf": {
        source: "iana"
      },
      "application/vnd.mason+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.maxar.archive.3tz+zip": {
        source: "iana",
        compressible: false
      },
      "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: true
      },
      "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: true
      },
      "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: true,
        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: false,
        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: true,
        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: true
      },
      "application/vnd.ms-officetheme": {
        source: "iana",
        extensions: ["thmx"]
      },
      "application/vnd.ms-opentype": {
        source: "apache",
        compressible: true
      },
      "application/vnd.ms-outlook": {
        compressible: false,
        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: true
      },
      "application/vnd.ms-powerpoint": {
        source: "iana",
        compressible: false,
        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: true
      },
      "application/vnd.ms-printing.printticket+xml": {
        source: "apache",
        compressible: true
      },
      "application/vnd.ms-printschematicket+xml": {
        source: "iana",
        compressible: true
      },
      "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: false,
        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: true
      },
      "application/vnd.ncd.control": {
        source: "iana"
      },
      "application/vnd.ncd.reference": {
        source: "iana"
      },
      "application/vnd.nearst.inv+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.nokia.iptv.config+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.isds-radio-presets": {
        source: "iana"
      },
      "application/vnd.nokia.landmark+wbxml": {
        source: "iana"
      },
      "application/vnd.nokia.landmark+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.landmarkcollection+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.nokia.n-gage.ac+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "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: false,
        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: false,
        extensions: ["odp"]
      },
      "application/vnd.oasis.opendocument.presentation-template": {
        source: "iana",
        extensions: ["otp"]
      },
      "application/vnd.oasis.opendocument.spreadsheet": {
        source: "iana",
        compressible: false,
        extensions: ["ods"]
      },
      "application/vnd.oasis.opendocument.spreadsheet-template": {
        source: "iana",
        extensions: ["ots"]
      },
      "application/vnd.oasis.opendocument.text": {
        source: "iana",
        compressible: false,
        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: true
      },
      "application/vnd.oftn.l10n+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.contentaccessdownload+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.contentaccessstreaming+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.cspg-hexbinary": {
        source: "iana"
      },
      "application/vnd.oipf.dae.svg+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.dae.xhtml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.mippvcontrolmessage+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.pae.gem": {
        source: "iana"
      },
      "application/vnd.oipf.spdiscovery+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.spdlist+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.ueprofile+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oipf.userprofile+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.oma.bcast.drm-trigger+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.imd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.ltkm": {
        source: "iana"
      },
      "application/vnd.oma.bcast.notification+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.provisioningtrigger": {
        source: "iana"
      },
      "application/vnd.oma.bcast.sgboot": {
        source: "iana"
      },
      "application/vnd.oma.bcast.sgdd+xml": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.oma.bcast.sprov+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.bcast.stkm": {
        source: "iana"
      },
      "application/vnd.oma.cab-address-book+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-feature-handler+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-pcc+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-subs-invite+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.cab-user-prefs+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.dcd": {
        source: "iana"
      },
      "application/vnd.oma.dcdc": {
        source: "iana"
      },
      "application/vnd.oma.dd2+xml": {
        source: "iana",
        compressible: true,
        extensions: ["dd2"]
      },
      "application/vnd.oma.drm.risd+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.group-usage-list+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.lwm2m+cbor": {
        source: "iana"
      },
      "application/vnd.oma.lwm2m+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.lwm2m+tlv": {
        source: "iana"
      },
      "application/vnd.oma.pal+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.detailed-progress-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.final-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.groups+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.invocation-descriptor+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.poc.optimized-progress-report+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.push": {
        source: "iana"
      },
      "application/vnd.oma.scidm.messages+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oma.xcap-directory+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.omads-email+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.omads-file+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.omads-folder+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "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: true,
        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: true,
        extensions: ["osm"]
      },
      "application/vnd.opentimestamps.ots": {
        source: "iana"
      },
      "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawing+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
        source: "iana",
        compressible: false,
        extensions: ["pptx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slide": {
        source: "iana",
        extensions: ["sldx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
        source: "iana",
        extensions: ["ppsx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.template": {
        source: "iana",
        extensions: ["potx"]
      },
      "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
        source: "iana",
        compressible: false,
        extensions: ["xlsx"]
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
        source: "iana",
        extensions: ["xltx"]
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.theme+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.vmldrawing": {
        source: "iana"
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
        source: "iana",
        compressible: false,
        extensions: ["docx"]
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
        source: "iana",
        extensions: ["dotx"]
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.core-properties+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.openxmlformats-package.relationships+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.oracle.resource+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.oxli.countgraph": {
        source: "iana"
      },
      "application/vnd.pagerduty+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true
      },
      "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: true
      },
      "application/vnd.radisys.msml+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-conf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-conn+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-dialog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-audit-stream+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-conf+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-base+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-fax-detect+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-group+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-speech+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.radisys.msml-dialog-transform+xml": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["musicxml"]
      },
      "application/vnd.renlearn.rlprint": {
        source: "iana"
      },
      "application/vnd.resilient.logic": {
        source: "iana"
      },
      "application/vnd.restful+json": {
        source: "iana",
        compressible: true
      },
      "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: true,
        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: true
      },
      "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: true
      },
      "application/vnd.shopkick+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true,
        extensions: ["fo"]
      },
      "application/vnd.software602.filler.form-xml-zip": {
        source: "iana"
      },
      "application/vnd.solent.sdkm+xml": {
        source: "iana",
        compressible: true,
        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: true,
        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: true
      },
      "application/vnd.syft+json": {
        source: "iana",
        compressible: true
      },
      "application/vnd.symbian.install": {
        source: "apache",
        extensions: ["sis", "sisx"]
      },
      "application/vnd.syncml+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        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: true,
        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: true,
        extensions: ["ddf"]
      },
      "application/vnd.syncml.dmtnds+wbxml": {
        source: "iana"
      },
      "application/vnd.syncml.dmtnds+xml": {
        source: "iana",
        charset: "UTF-8",
        compressible: true
      },
      "application/vnd.syncml.ds.notification": {
        source: "iana"
      },
      "application/vnd.tableschema+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.tmd.mediaflex.api+xml": {
        source: "iana",
        compressible: true
      },
      "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: true,
        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: true
      },
      "application/vnd.verimatrix.vcas": {
        source: "iana"
      },
      "application/vnd.veritone.aion+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "application/vnd.wv.ssp+xml": {
        source: "iana",
        compressible: true
      },
      "application/vnd.xacml+json": {
        source: "iana",
        compressible: true
      },
      "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: true
      },
      "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: true,
        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: true,
        extensions: ["zaz"]
      },
      "application/voicexml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["vxml"]
      },
      "application/voucher-cms+json": {
        source: "iana",
        compressible: true
      },
      "application/vq-rtcpxr": {
        source: "iana"
      },
      "application/wasm": {
        source: "iana",
        compressible: true,
        extensions: ["wasm"]
      },
      "application/watcherinfo+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wif"]
      },
      "application/webpush-options+json": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["wsdl"]
      },
      "application/wspolicy+xml": {
        source: "iana",
        compressible: true,
        extensions: ["wspolicy"]
      },
      "application/x-7z-compressed": {
        source: "apache",
        compressible: false,
        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: false,
        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: false,
        extensions: ["bdoc"]
      },
      "application/x-bittorrent": {
        source: "apache",
        extensions: ["torrent"]
      },
      "application/x-blorb": {
        source: "apache",
        extensions: ["blb", "blorb"]
      },
      "application/x-bzip": {
        source: "apache",
        compressible: false,
        extensions: ["bz"]
      },
      "application/x-bzip2": {
        source: "apache",
        compressible: false,
        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: false
      },
      "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: true,
        extensions: ["ncx"]
      },
      "application/x-dtbook+xml": {
        source: "apache",
        compressible: true,
        extensions: ["dtb"]
      },
      "application/x-dtbresource+xml": {
        source: "apache",
        compressible: true,
        extensions: ["res"]
      },
      "application/x-dvi": {
        source: "apache",
        compressible: false,
        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: true,
        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: false,
        extensions: ["jnlp"]
      },
      "application/x-javascript": {
        compressible: true
      },
      "application/x-keepass2": {
        extensions: ["kdbx"]
      },
      "application/x-latex": {
        source: "apache",
        compressible: false,
        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: false
      },
      "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: true,
        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: false,
        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: false,
        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: true,
        extensions: ["sh"]
      },
      "application/x-shar": {
        source: "apache",
        extensions: ["shar"]
      },
      "application/x-shockwave-flash": {
        source: "apache",
        compressible: false,
        extensions: ["swf"]
      },
      "application/x-silverlight-app": {
        source: "apache",
        extensions: ["xap"]
      },
      "application/x-sql": {
        source: "apache",
        extensions: ["sql"]
      },
      "application/x-stuffit": {
        source: "apache",
        compressible: false,
        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: true,
        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: true,
        extensions: ["hdd"]
      },
      "application/x-virtualbox-ova": {
        compressible: true,
        extensions: ["ova"]
      },
      "application/x-virtualbox-ovf": {
        compressible: true,
        extensions: ["ovf"]
      },
      "application/x-virtualbox-vbox": {
        compressible: true,
        extensions: ["vbox"]
      },
      "application/x-virtualbox-vbox-extpack": {
        compressible: false,
        extensions: ["vbox-extpack"]
      },
      "application/x-virtualbox-vdi": {
        compressible: true,
        extensions: ["vdi"]
      },
      "application/x-virtualbox-vhd": {
        compressible: true,
        extensions: ["vhd"]
      },
      "application/x-virtualbox-vmdk": {
        compressible: true,
        extensions: ["vmdk"]
      },
      "application/x-wais-source": {
        source: "apache",
        extensions: ["src"]
      },
      "application/x-web-app-manifest+json": {
        compressible: true,
        extensions: ["webapp"]
      },
      "application/x-www-form-urlencoded": {
        source: "iana",
        compressible: true
      },
      "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: true,
        extensions: ["xlf"]
      },
      "application/x-xpinstall": {
        source: "apache",
        compressible: false,
        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: true
      },
      "application/xaml+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xaml"]
      },
      "application/xcap-att+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xav"]
      },
      "application/xcap-caps+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xca"]
      },
      "application/xcap-diff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xdf"]
      },
      "application/xcap-el+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xel"]
      },
      "application/xcap-error+xml": {
        source: "iana",
        compressible: true
      },
      "application/xcap-ns+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xns"]
      },
      "application/xcon-conference-info+xml": {
        source: "iana",
        compressible: true
      },
      "application/xcon-conference-info-diff+xml": {
        source: "iana",
        compressible: true
      },
      "application/xenc+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xenc"]
      },
      "application/xhtml+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xhtml", "xht"]
      },
      "application/xhtml-voice+xml": {
        source: "apache",
        compressible: true
      },
      "application/xliff+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xlf"]
      },
      "application/xml": {
        source: "iana",
        compressible: true,
        extensions: ["xml", "xsl", "xsd", "rng"]
      },
      "application/xml-dtd": {
        source: "iana",
        compressible: true,
        extensions: ["dtd"]
      },
      "application/xml-external-parsed-entity": {
        source: "iana"
      },
      "application/xml-patch+xml": {
        source: "iana",
        compressible: true
      },
      "application/xmpp+xml": {
        source: "iana",
        compressible: true
      },
      "application/xop+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xop"]
      },
      "application/xproc+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xpl"]
      },
      "application/xslt+xml": {
        source: "iana",
        compressible: true,
        extensions: ["xsl", "xslt"]
      },
      "application/xspf+xml": {
        source: "apache",
        compressible: true,
        extensions: ["xspf"]
      },
      "application/xv+xml": {
        source: "iana",
        compressible: true,
        extensions: ["mxml", "xhvml", "xvml", "xvm"]
      },
      "application/yang": {
        source: "iana",
        extensions: ["yang"]
      },
      "application/yang-data+json": {
        source: "iana",
        compressible: true
      },
      "application/yang-data+xml": {
        source: "iana",
        compressible: true
      },
      "application/yang-patch+json": {
        source: "iana",
        compressible: true
      },
      "application/yang-patch+xml": {
        source: "iana",
        compressible: true
      },
      "application/yin+xml": {
        source: "iana",
        compressible: true,
        extensions: ["yin"]
      },
      "application/zip": {
        source: "iana",
        compressible: false,
        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: false,
        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: false,
        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: false
      },
      "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: false,
        extensions: ["mp3"]
      },
      "audio/mp4": {
        source: "iana",
        compressible: false,
        extensions: ["m4a", "mp4a"]
      },
      "audio/mp4a-latm": {
        source: "iana"
      },
      "audio/mpa": {
        source: "iana"
      },
      "audio/mpa-robust": {
        source: "iana"
      },
      "audio/mpeg": {
        source: "iana",
        compressible: false,
        extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"]
      },
      "audio/mpeg4-generic": {
        source: "iana"
      },
      "audio/musepack": {
        source: "apache"
      },
      "audio/ogg": {
        source: "iana",
        compressible: false,
        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: false
      },
      "audio/vnd.sealedmedia.softseal.mpeg": {
        source: "iana"
      },
      "audio/vnd.vmx.cvsd": {
        source: "iana"
      },
      "audio/vnd.wave": {
        compressible: false
      },
      "audio/vorbis": {
        source: "iana",
        compressible: false
      },
      "audio/vorbis-config": {
        source: "iana"
      },
      "audio/wav": {
        compressible: false,
        extensions: ["wav"]
      },
      "audio/wave": {
        compressible: false,
        extensions: ["wav"]
      },
      "audio/webm": {
        source: "apache",
        compressible: false,
        extensions: ["weba"]
      },
      "audio/x-aac": {
        source: "apache",
        compressible: false,
        extensions: ["aac"]
      },
      "audio/x-aiff": {
        source: "apache",
        extensions: ["aif", "aiff", "aifc"]
      },
      "audio/x-caf": {
        source: "apache",
        compressible: false,
        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: true,
        extensions: ["otf"]
      },
      "font/sfnt": {
        source: "iana"
      },
      "font/ttf": {
        source: "iana",
        compressible: true,
        extensions: ["ttf"]
      },
      "font/woff": {
        source: "iana",
        extensions: ["woff"]
      },
      "font/woff2": {
        source: "iana",
        extensions: ["woff2"]
      },
      "image/aces": {
        source: "iana",
        extensions: ["exr"]
      },
      "image/apng": {
        compressible: false,
        extensions: ["apng"]
      },
      "image/avci": {
        source: "iana",
        extensions: ["avci"]
      },
      "image/avcs": {
        source: "iana",
        extensions: ["avcs"]
      },
      "image/avif": {
        source: "iana",
        compressible: false,
        extensions: ["avif"]
      },
      "image/bmp": {
        source: "iana",
        compressible: true,
        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: false,
        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: false,
        extensions: ["jp2", "jpg2"]
      },
      "image/jpeg": {
        source: "iana",
        compressible: false,
        extensions: ["jpeg", "jpg", "jpe"]
      },
      "image/jph": {
        source: "iana",
        extensions: ["jph"]
      },
      "image/jphc": {
        source: "iana",
        extensions: ["jhc"]
      },
      "image/jpm": {
        source: "iana",
        compressible: false,
        extensions: ["jpm"]
      },
      "image/jpx": {
        source: "iana",
        compressible: false,
        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: false
      },
      "image/png": {
        source: "iana",
        compressible: false,
        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: true,
        extensions: ["svg", "svgz"]
      },
      "image/t38": {
        source: "iana",
        extensions: ["t38"]
      },
      "image/tiff": {
        source: "iana",
        compressible: false,
        extensions: ["tif", "tiff"]
      },
      "image/tiff-fx": {
        source: "iana",
        extensions: ["tfx"]
      },
      "image/vnd.adobe.photoshop": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["ico"]
      },
      "image/vnd.mix": {
        source: "iana"
      },
      "image/vnd.mozilla.apng": {
        source: "iana"
      },
      "image/vnd.ms-dds": {
        compressible: true,
        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: true,
        extensions: ["ico"]
      },
      "image/x-jng": {
        source: "nginx",
        extensions: ["jng"]
      },
      "image/x-mrsid-image": {
        source: "apache",
        extensions: ["sid"]
      },
      "image/x-ms-bmp": {
        source: "nginx",
        compressible: true,
        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: false
      },
      "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: false
      },
      "message/imdn+xml": {
        source: "iana",
        compressible: true
      },
      "message/news": {
        source: "iana"
      },
      "message/partial": {
        source: "iana",
        compressible: false
      },
      "message/rfc822": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["gltf"]
      },
      "model/gltf-binary": {
        source: "iana",
        compressible: true,
        extensions: ["glb"]
      },
      "model/iges": {
        source: "iana",
        compressible: false,
        extensions: ["igs", "iges"]
      },
      "model/mesh": {
        source: "iana",
        compressible: false,
        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: true,
        extensions: ["stpx"]
      },
      "model/step+zip": {
        source: "iana",
        compressible: false,
        extensions: ["stpz"]
      },
      "model/step-xml+zip": {
        source: "iana",
        compressible: false,
        extensions: ["stpxz"]
      },
      "model/stl": {
        source: "iana",
        extensions: ["stl"]
      },
      "model/vnd.collada+xml": {
        source: "iana",
        compressible: true,
        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: true
      },
      "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: false,
        extensions: ["usdz"]
      },
      "model/vnd.valve.source.compiled-map": {
        source: "iana",
        extensions: ["bsp"]
      },
      "model/vnd.vtu": {
        source: "iana",
        extensions: ["vtu"]
      },
      "model/vrml": {
        source: "iana",
        compressible: false,
        extensions: ["wrl", "vrml"]
      },
      "model/x3d+binary": {
        source: "apache",
        compressible: false,
        extensions: ["x3db", "x3dbz"]
      },
      "model/x3d+fastinfoset": {
        source: "iana",
        extensions: ["x3db"]
      },
      "model/x3d+vrml": {
        source: "apache",
        compressible: false,
        extensions: ["x3dv", "x3dvz"]
      },
      "model/x3d+xml": {
        source: "iana",
        compressible: true,
        extensions: ["x3d", "x3dz"]
      },
      "model/x3d-vrml": {
        source: "iana",
        extensions: ["x3dv"]
      },
      "multipart/alternative": {
        source: "iana",
        compressible: false
      },
      "multipart/appledouble": {
        source: "iana"
      },
      "multipart/byteranges": {
        source: "iana"
      },
      "multipart/digest": {
        source: "iana"
      },
      "multipart/encrypted": {
        source: "iana",
        compressible: false
      },
      "multipart/form-data": {
        source: "iana",
        compressible: false
      },
      "multipart/header-set": {
        source: "iana"
      },
      "multipart/mixed": {
        source: "iana"
      },
      "multipart/multilingual": {
        source: "iana"
      },
      "multipart/parallel": {
        source: "iana"
      },
      "multipart/related": {
        source: "iana",
        compressible: false
      },
      "multipart/report": {
        source: "iana"
      },
      "multipart/signed": {
        source: "iana",
        compressible: false
      },
      "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: true,
        extensions: ["appcache", "manifest"]
      },
      "text/calendar": {
        source: "iana",
        extensions: ["ics", "ifb"]
      },
      "text/calender": {
        compressible: true
      },
      "text/cmd": {
        compressible: true
      },
      "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: true,
        extensions: ["css"]
      },
      "text/csv": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["html", "htm", "shtml"]
      },
      "text/jade": {
        extensions: ["jade"]
      },
      "text/javascript": {
        source: "iana",
        compressible: true
      },
      "text/jcr-cnd": {
        source: "iana"
      },
      "text/jsx": {
        compressible: true,
        extensions: ["jsx"]
      },
      "text/less": {
        compressible: true,
        extensions: ["less"]
      },
      "text/markdown": {
        source: "iana",
        compressible: true,
        extensions: ["markdown", "md"]
      },
      "text/mathml": {
        source: "nginx",
        extensions: ["mml"]
      },
      "text/mdx": {
        compressible: true,
        extensions: ["mdx"]
      },
      "text/mizar": {
        source: "iana"
      },
      "text/n3": {
        source: "iana",
        charset: "UTF-8",
        compressible: true,
        extensions: ["n3"]
      },
      "text/parameters": {
        source: "iana",
        charset: "UTF-8"
      },
      "text/parityfec": {
        source: "iana"
      },
      "text/plain": {
        source: "iana",
        compressible: true,
        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: true,
        extensions: ["rtx"]
      },
      "text/rtf": {
        source: "iana",
        compressible: true,
        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: true,
        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: true,
        extensions: ["uri", "uris", "urls"]
      },
      "text/vcard": {
        source: "iana",
        compressible: true,
        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: true,
        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: true
      },
      "text/x-handlebars-template": {
        extensions: ["hbs"]
      },
      "text/x-java-source": {
        source: "apache",
        extensions: ["java"]
      },
      "text/x-jquery-tmpl": {
        compressible: true
      },
      "text/x-lua": {
        extensions: ["lua"]
      },
      "text/x-markdown": {
        compressible: true,
        extensions: ["mkd"]
      },
      "text/x-nfo": {
        source: "apache",
        extensions: ["nfo"]
      },
      "text/x-opml": {
        source: "apache",
        extensions: ["opml"]
      },
      "text/x-org": {
        compressible: true,
        extensions: ["org"]
      },
      "text/x-pascal": {
        source: "apache",
        extensions: ["p", "pas"]
      },
      "text/x-processing": {
        compressible: true,
        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: true,
        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: true,
        extensions: ["xml"]
      },
      "text/xml-external-parsed-entity": {
        source: "iana"
      },
      "text/yaml": {
        compressible: true,
        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: false,
        extensions: ["mp4", "mp4v", "mpg4"]
      },
      "video/mp4v-es": {
        source: "iana"
      },
      "video/mpeg": {
        source: "iana",
        compressible: false,
        extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"]
      },
      "video/mpeg4-generic": {
        source: "iana"
      },
      "video/mpv": {
        source: "iana"
      },
      "video/nv": {
        source: "iana"
      },
      "video/ogg": {
        source: "iana",
        compressible: false,
        extensions: ["ogv"]
      },
      "video/parityfec": {
        source: "iana"
      },
      "video/pointer": {
        source: "iana"
      },
      "video/quicktime": {
        source: "iana",
        compressible: false,
        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: false,
        extensions: ["webm"]
      },
      "video/x-f4v": {
        source: "apache",
        extensions: ["f4v"]
      },
      "video/x-fli": {
        source: "apache",
        extensions: ["fli"]
      },
      "video/x-flv": {
        source: "apache",
        compressible: false,
        extensions: ["flv"]
      },
      "video/x-m4v": {
        source: "apache",
        extensions: ["m4v"]
      },
      "video/x-matroska": {
        source: "apache",
        compressible: false,
        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: false,
        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: true
      },
      "x-shader/x-vertex": {
        compressible: true
      }
    };
  }
});

// ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
var require_mime_db = __commonJS({
  "../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) {
    module2.exports = require_db();
  }
});

// ../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js
var require_mime_types = __commonJS({
  "../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) {
    "use strict";
    var db = require_mime_db();
    var extname = require("path").extname;
    var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
    var TEXT_TYPE_REGEXP = /^text\//i;
    exports2.charset = charset;
    exports2.charsets = { lookup: charset };
    exports2.contentType = contentType;
    exports2.extension = extension;
    exports2.extensions = /* @__PURE__ */ Object.create(null);
    exports2.lookup = lookup;
    exports2.types = /* @__PURE__ */ Object.create(null);
    populateMaps(exports2.extensions, exports2.types);
    function charset(type) {
      if (!type || typeof type !== "string") {
        return false;
      }
      var match = EXTRACT_TYPE_REGEXP.exec(type);
      var mime = match && db[match[1].toLowerCase()];
      if (mime && mime.charset) {
        return mime.charset;
      }
      if (match && TEXT_TYPE_REGEXP.test(match[1])) {
        return "UTF-8";
      }
      return false;
    }
    function contentType(str) {
      if (!str || typeof str !== "string") {
        return false;
      }
      var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str;
      if (!mime) {
        return false;
      }
      if (mime.indexOf("charset") === -1) {
        var charset2 = exports2.charset(mime);
        if (charset2) mime += "; charset=" + charset2.toLowerCase();
      }
      return mime;
    }
    function extension(type) {
      if (!type || typeof type !== "string") {
        return false;
      }
      var match = EXTRACT_TYPE_REGEXP.exec(type);
      var exts = match && exports2.extensions[match[1].toLowerCase()];
      if (!exts || !exts.length) {
        return false;
      }
      return exts[0];
    }
    function lookup(path2) {
      if (!path2 || typeof path2 !== "string") {
        return false;
      }
      var extension2 = extname("x." + path2).toLowerCase().substr(1);
      if (!extension2) {
        return false;
      }
      return exports2.types[extension2] || false;
    }
    function populateMaps(extensions, types) {
      var preference = ["nginx", "apache", void 0, "iana"];
      Object.keys(db).forEach(function forEachMimeType(type) {
        var mime = db[type];
        var exts = mime.extensions;
        if (!exts || !exts.length) {
          return;
        }
        extensions[type] = exts;
        for (var i3 = 0; i3 < exts.length; i3++) {
          var extension2 = exts[i3];
          if (types[extension2]) {
            var from = preference.indexOf(db[types[extension2]].source);
            var to = preference.indexOf(mime.source);
            if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) {
              continue;
            }
          }
          types[extension2] = type;
        }
      });
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js
var require_defer2 = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) {
    module2.exports = defer;
    function defer(fn) {
      var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null;
      if (nextTick) {
        nextTick(fn);
      } else {
        setTimeout(fn, 0);
      }
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js
var require_async2 = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) {
    var defer = require_defer2();
    module2.exports = async;
    function async(callback) {
      var isAsync = false;
      defer(function() {
        isAsync = true;
      });
      return function async_callback(err, result) {
        if (isAsync) {
          callback(err, result);
        } else {
          defer(function nextTick_callback() {
            callback(err, result);
          });
        }
      };
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js
var require_abort = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) {
    module2.exports = abort;
    function abort(state) {
      Object.keys(state.jobs).forEach(clean.bind(state));
      state.jobs = {};
    }
    function clean(key) {
      if (typeof this.jobs[key] == "function") {
        this.jobs[key]();
      }
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js
var require_iterate = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) {
    var async = require_async2();
    var abort = require_abort();
    module2.exports = iterate;
    function iterate(list, iterator, state, callback) {
      var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
      state.jobs[key] = runJob(iterator, key, list[key], function(error, output) {
        if (!(key in state.jobs)) {
          return;
        }
        delete state.jobs[key];
        if (error) {
          abort(state);
        } else {
          state.results[key] = output;
        }
        callback(error, state.results);
      });
    }
    function runJob(iterator, key, item, callback) {
      var aborter;
      if (iterator.length == 2) {
        aborter = iterator(item, async(callback));
      } else {
        aborter = iterator(item, key, async(callback));
      }
      return aborter;
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js
var require_state2 = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) {
    module2.exports = state;
    function state(list, sortMethod) {
      var isNamedList = !Array.isArray(list), initState = {
        index: 0,
        keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
        jobs: {},
        results: isNamedList ? {} : [],
        size: isNamedList ? Object.keys(list).length : list.length
      };
      if (sortMethod) {
        initState.keyedList.sort(isNamedList ? sortMethod : function(a, b3) {
          return sortMethod(list[a], list[b3]);
        });
      }
      return initState;
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js
var require_terminator = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) {
    var abort = require_abort();
    var async = require_async2();
    module2.exports = terminator;
    function terminator(callback) {
      if (!Object.keys(this.jobs).length) {
        return;
      }
      this.index = this.size;
      abort(this);
      async(callback)(null, this.results);
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js
var require_parallel2 = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) {
    var iterate = require_iterate();
    var initState = require_state2();
    var terminator = require_terminator();
    module2.exports = parallel;
    function parallel(list, iterator, callback) {
      var state = initState(list);
      while (state.index < (state["keyedList"] || list).length) {
        iterate(list, iterator, state, function(error, result) {
          if (error) {
            callback(error, result);
            return;
          }
          if (Object.keys(state.jobs).length === 0) {
            callback(null, state.results);
            return;
          }
        });
        state.index++;
      }
      return terminator.bind(state, callback);
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js
var require_serialOrdered = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) {
    var iterate = require_iterate();
    var initState = require_state2();
    var terminator = require_terminator();
    module2.exports = serialOrdered;
    module2.exports.ascending = ascending;
    module2.exports.descending = descending;
    function serialOrdered(list, iterator, sortMethod, callback) {
      var state = initState(list, sortMethod);
      iterate(list, iterator, state, function iteratorHandler(error, result) {
        if (error) {
          callback(error, result);
          return;
        }
        state.index++;
        if (state.index < (state["keyedList"] || list).length) {
          iterate(list, iterator, state, iteratorHandler);
          return;
        }
        callback(null, state.results);
      });
      return terminator.bind(state, callback);
    }
    function ascending(a, b3) {
      return a < b3 ? -1 : a > b3 ? 1 : 0;
    }
    function descending(a, b3) {
      return -1 * ascending(a, b3);
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js
var require_serial = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) {
    var serialOrdered = require_serialOrdered();
    module2.exports = serial;
    function serial(list, iterator, callback) {
      return serialOrdered(list, iterator, null, callback);
    }
  }
});

// ../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js
var require_asynckit = __commonJS({
  "../../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) {
    module2.exports = {
      parallel: require_parallel2(),
      serial: require_serial(),
      serialOrdered: require_serialOrdered()
    };
  }
});

// ../../../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js
var require_es_object_atoms = __commonJS({
  "../../../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) {
    "use strict";
    module2.exports = Object;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js
var require_es_errors = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) {
    "use strict";
    module2.exports = Error;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js
var require_eval = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) {
    "use strict";
    module2.exports = EvalError;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js
var require_range2 = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) {
    "use strict";
    module2.exports = RangeError;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js
var require_ref = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) {
    "use strict";
    module2.exports = ReferenceError;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js
var require_syntax = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) {
    "use strict";
    module2.exports = SyntaxError;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js
var require_type = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) {
    "use strict";
    module2.exports = TypeError;
  }
});

// ../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js
var require_uri = __commonJS({
  "../../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) {
    "use strict";
    module2.exports = URIError;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js
var require_abs = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.abs;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js
var require_floor = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.floor;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js
var require_max2 = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.max;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js
var require_min2 = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.min;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js
var require_pow = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.pow;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js
var require_round = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) {
    "use strict";
    module2.exports = Math.round;
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js
var require_isNaN = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) {
    "use strict";
    module2.exports = Number.isNaN || function isNaN2(a) {
      return a !== a;
    };
  }
});

// ../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js
var require_sign = __commonJS({
  "../../../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) {
    "use strict";
    var $isNaN = require_isNaN();
    module2.exports = function sign(number) {
      if ($isNaN(number) || number === 0) {
        return number;
      }
      return number < 0 ? -1 : 1;
    };
  }
});

// ../../../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js
var require_gOPD = __commonJS({
  "../../../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) {
    "use strict";
    module2.exports = Object.getOwnPropertyDescriptor;
  }
});

// ../../../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js
var require_gopd = __commonJS({
  "../../../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) {
    "use strict";
    var $gOPD = require_gOPD();
    if ($gOPD) {
      try {
        $gOPD([], "length");
      } catch (e3) {
        $gOPD = null;
      }
    }
    module2.exports = $gOPD;
  }
});

// ../../../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js
var require_es_define_property = __commonJS({
  "../../../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) {
    "use strict";
    var $defineProperty = Object.defineProperty || false;
    if ($defineProperty) {
      try {
        $defineProperty({}, "a", { value: 1 });
      } catch (e3) {
        $defineProperty = false;
      }
    }
    module2.exports = $defineProperty;
  }
});

// ../../../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js
var require_shams = __commonJS({
  "../../../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) {
    "use strict";
    module2.exports = function hasSymbols() {
      if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
        return false;
      }
      if (typeof Symbol.iterator === "symbol") {
        return true;
      }
      var obj = {};
      var sym = Symbol("test");
      var symObj = Object(sym);
      if (typeof sym === "string") {
        return false;
      }
      if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
        return false;
      }
      if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
        return false;
      }
      var symVal = 42;
      obj[sym] = symVal;
      for (var _ in obj) {
        return false;
      }
      if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
        return false;
      }
      if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
        return false;
      }
      var syms = Object.getOwnPropertySymbols(obj);
      if (syms.length !== 1 || syms[0] !== sym) {
        return false;
      }
      if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
        return false;
      }
      if (typeof Object.getOwnPropertyDescriptor === "function") {
        var descriptor = (
          /** @type {PropertyDescriptor} */
          Object.getOwnPropertyDescriptor(obj, sym)
        );
        if (descriptor.value !== symVal || descriptor.enumerable !== true) {
          return false;
        }
      }
      return true;
    };
  }
});

// ../../../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js
var require_has_symbols = __commonJS({
  "../../../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) {
    "use strict";
    var origSymbol = typeof Symbol !== "undefined" && Symbol;
    var hasSymbolSham = require_shams();
    module2.exports = function hasNativeSymbols() {
      if (typeof origSymbol !== "function") {
        return false;
      }
      if (typeof Symbol !== "function") {
        return false;
      }
      if (typeof origSymbol("foo") !== "symbol") {
        return false;
      }
      if (typeof Symbol("bar") !== "symbol") {
        return false;
      }
      return hasSymbolSham();
    };
  }
});

// ../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js
var require_Reflect_getPrototypeOf = __commonJS({
  "../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) {
    "use strict";
    module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
  }
});

// ../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js
var require_Object_getPrototypeOf = __commonJS({
  "../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) {
    "use strict";
    var $Object = require_es_object_atoms();
    module2.exports = $Object.getPrototypeOf || null;
  }
});

// ../../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js
var require_implementation = __commonJS({
  "../../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) {
    "use strict";
    var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
    var toStr = Object.prototype.toString;
    var max = Math.max;
    var funcType = "[object Function]";
    var concatty = function concatty2(a, b3) {
      var arr = [];
      for (var i3 = 0; i3 < a.length; i3 += 1) {
        arr[i3] = a[i3];
      }
      for (var j3 = 0; j3 < b3.length; j3 += 1) {
        arr[j3 + a.length] = b3[j3];
      }
      return arr;
    };
    var slicy = function slicy2(arrLike, offset) {
      var arr = [];
      for (var i3 = offset || 0, j3 = 0; i3 < arrLike.length; i3 += 1, j3 += 1) {
        arr[j3] = arrLike[i3];
      }
      return arr;
    };
    var joiny = function(arr, joiner) {
      var str = "";
      for (var i3 = 0; i3 < arr.length; i3 += 1) {
        str += arr[i3];
        if (i3 + 1 < arr.length) {
          str += joiner;
        }
      }
      return str;
    };
    module2.exports = function bind(that) {
      var target = this;
      if (typeof target !== "function" || toStr.apply(target) !== funcType) {
        throw new TypeError(ERROR_MESSAGE + target);
      }
      var args = slicy(arguments, 1);
      var bound;
      var binder = function() {
        if (this instanceof bound) {
          var result = target.apply(
            this,
            concatty(args, arguments)
          );
          if (Object(result) === result) {
            return result;
          }
          return this;
        }
        return target.apply(
          that,
          concatty(args, arguments)
        );
      };
      var boundLength = max(0, target.length - args.length);
      var boundArgs = [];
      for (var i3 = 0; i3 < boundLength; i3++) {
        boundArgs[i3] = "$" + i3;
      }
      bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
      if (target.prototype) {
        var Empty = function Empty2() {
        };
        Empty.prototype = target.prototype;
        bound.prototype = new Empty();
        Empty.prototype = null;
      }
      return bound;
    };
  }
});

// ../../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js
var require_function_bind = __commonJS({
  "../../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) {
    "use strict";
    var implementation = require_implementation();
    module2.exports = Function.prototype.bind || implementation;
  }
});

// ../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js
var require_functionCall = __commonJS({
  "../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) {
    "use strict";
    module2.exports = Function.prototype.call;
  }
});

// ../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js
var require_functionApply = __commonJS({
  "../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) {
    "use strict";
    module2.exports = Function.prototype.apply;
  }
});

// ../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js
var require_reflectApply = __commonJS({
  "../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) {
    "use strict";
    module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
  }
});

// ../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js
var require_actualApply = __commonJS({
  "../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) {
    "use strict";
    var bind = require_function_bind();
    var $apply = require_functionApply();
    var $call = require_functionCall();
    var $reflectApply = require_reflectApply();
    module2.exports = $reflectApply || bind.call($call, $apply);
  }
});

// ../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js
var require_call_bind_apply_helpers = __commonJS({
  "../../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) {
    "use strict";
    var bind = require_function_bind();
    var $TypeError = require_type();
    var $call = require_functionCall();
    var $actualApply = require_actualApply();
    module2.exports = function callBindBasic(args) {
      if (args.length < 1 || typeof args[0] !== "function") {
        throw new $TypeError("a function is required");
      }
      return $actualApply(bind, $call, args);
    };
  }
});

// ../../../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js
var require_get = __commonJS({
  "../../../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) {
    "use strict";
    var callBind = require_call_bind_apply_helpers();
    var gOPD = require_gopd();
    var hasProtoAccessor;
    try {
      hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */
      [].__proto__ === Array.prototype;
    } catch (e3) {
      if (!e3 || typeof e3 !== "object" || !("code" in e3) || e3.code !== "ERR_PROTO_ACCESS") {
        throw e3;
      }
    }
    var desc = !!hasProtoAccessor && gOPD && gOPD(
      Object.prototype,
      /** @type {keyof typeof Object.prototype} */
      "__proto__"
    );
    var $Object = Object;
    var $getPrototypeOf = $Object.getPrototypeOf;
    module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? (
      /** @type {import('./get')} */
      function getDunder(value) {
        return $getPrototypeOf(value == null ? value : $Object(value));
      }
    ) : false;
  }
});

// ../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js
var require_get_proto = __commonJS({
  "../../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) {
    "use strict";
    var reflectGetProto = require_Reflect_getPrototypeOf();
    var originalGetProto = require_Object_getPrototypeOf();
    var getDunderProto = require_get();
    module2.exports = reflectGetProto ? function getProto(O2) {
      return reflectGetProto(O2);
    } : originalGetProto ? function getProto(O2) {
      if (!O2 || typeof O2 !== "object" && typeof O2 !== "function") {
        throw new TypeError("getProto: not an object");
      }
      return originalGetProto(O2);
    } : getDunderProto ? function getProto(O2) {
      return getDunderProto(O2);
    } : null;
  }
});

// ../../../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js
var require_hasown = __commonJS({
  "../../../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) {
    "use strict";
    var call = Function.prototype.call;
    var $hasOwn = Object.prototype.hasOwnProperty;
    var bind = require_function_bind();
    module2.exports = bind.call(call, $hasOwn);
  }
});

// ../../../node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js
var require_get_intrinsic = __commonJS({
  "../../../node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports2, module2) {
    "use strict";
    var undefined2;
    var $Object = require_es_object_atoms();
    var $Error = require_es_errors();
    var $EvalError = require_eval();
    var $RangeError = require_range2();
    var $ReferenceError = require_ref();
    var $SyntaxError = require_syntax();
    var $TypeError = require_type();
    var $URIError = require_uri();
    var abs = require_abs();
    var floor = require_floor();
    var max = require_max2();
    var min = require_min2();
    var pow = require_pow();
    var round = require_round();
    var sign = require_sign();
    var $Function = Function;
    var getEvalledConstructor = function(expressionSyntax) {
      try {
        return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
      } catch (e3) {
      }
    };
    var $gOPD = require_gopd();
    var $defineProperty = require_es_define_property();
    var throwTypeError = function() {
      throw new $TypeError();
    };
    var ThrowTypeError = $gOPD ? function() {
      try {
        arguments.callee;
        return throwTypeError;
      } catch (calleeThrows) {
        try {
          return $gOPD(arguments, "callee").get;
        } catch (gOPDthrows) {
          return throwTypeError;
        }
      }
    }() : throwTypeError;
    var hasSymbols = require_has_symbols()();
    var getProto = require_get_proto();
    var $ObjectGPO = require_Object_getPrototypeOf();
    var $ReflectGPO = require_Reflect_getPrototypeOf();
    var $apply = require_functionApply();
    var $call = require_functionCall();
    var needsEval = {};
    var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
    var INTRINSICS = {
      __proto__: null,
      "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
      "%Array%": Array,
      "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
      "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
      "%AsyncFromSyncIteratorPrototype%": undefined2,
      "%AsyncFunction%": needsEval,
      "%AsyncGenerator%": needsEval,
      "%AsyncGeneratorFunction%": needsEval,
      "%AsyncIteratorPrototype%": needsEval,
      "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
      "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
      "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
      "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
      "%Boolean%": Boolean,
      "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
      "%Date%": Date,
      "%decodeURI%": decodeURI,
      "%decodeURIComponent%": decodeURIComponent,
      "%encodeURI%": encodeURI,
      "%encodeURIComponent%": encodeURIComponent,
      "%Error%": $Error,
      "%eval%": eval,
      // eslint-disable-line no-eval
      "%EvalError%": $EvalError,
      "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array,
      "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
      "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
      "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
      "%Function%": $Function,
      "%GeneratorFunction%": needsEval,
      "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
      "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
      "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
      "%isFinite%": isFinite,
      "%isNaN%": isNaN,
      "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
      "%JSON%": typeof JSON === "object" ? JSON : undefined2,
      "%Map%": typeof Map === "undefined" ? undefined2 : Map,
      "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
      "%Math%": Math,
      "%Number%": Number,
      "%Object%": $Object,
      "%Object.getOwnPropertyDescriptor%": $gOPD,
      "%parseFloat%": parseFloat,
      "%parseInt%": parseInt,
      "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
      "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
      "%RangeError%": $RangeError,
      "%ReferenceError%": $ReferenceError,
      "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
      "%RegExp%": RegExp,
      "%Set%": typeof Set === "undefined" ? undefined2 : Set,
      "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
      "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
      "%String%": String,
      "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
      "%Symbol%": hasSymbols ? Symbol : undefined2,
      "%SyntaxError%": $SyntaxError,
      "%ThrowTypeError%": ThrowTypeError,
      "%TypedArray%": TypedArray,
      "%TypeError%": $TypeError,
      "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
      "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
      "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
      "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
      "%URIError%": $URIError,
      "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
      "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
      "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet,
      "%Function.prototype.call%": $call,
      "%Function.prototype.apply%": $apply,
      "%Object.defineProperty%": $defineProperty,
      "%Object.getPrototypeOf%": $ObjectGPO,
      "%Math.abs%": abs,
      "%Math.floor%": floor,
      "%Math.max%": max,
      "%Math.min%": min,
      "%Math.pow%": pow,
      "%Math.round%": round,
      "%Math.sign%": sign,
      "%Reflect.getPrototypeOf%": $ReflectGPO
    };
    if (getProto) {
      try {
        null.error;
      } catch (e3) {
        errorProto = getProto(getProto(e3));
        INTRINSICS["%Error.prototype%"] = errorProto;
      }
    }
    var errorProto;
    var doEval = function doEval2(name) {
      var value;
      if (name === "%AsyncFunction%") {
        value = getEvalledConstructor("async function () {}");
      } else if (name === "%GeneratorFunction%") {
        value = getEvalledConstructor("function* () {}");
      } else if (name === "%AsyncGeneratorFunction%") {
        value = getEvalledConstructor("async function* () {}");
      } else if (name === "%AsyncGenerator%") {
        var fn = doEval2("%AsyncGeneratorFunction%");
        if (fn) {
          value = fn.prototype;
        }
      } else if (name === "%AsyncIteratorPrototype%") {
        var gen = doEval2("%AsyncGenerator%");
        if (gen && getProto) {
          value = getProto(gen.prototype);
        }
      }
      INTRINSICS[name] = value;
      return value;
    };
    var LEGACY_ALIASES = {
      __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"]
    };
    var bind = require_function_bind();
    var hasOwn = require_hasown();
    var $concat = bind.call($call, Array.prototype.concat);
    var $spliceApply = bind.call($apply, Array.prototype.splice);
    var $replace = bind.call($call, String.prototype.replace);
    var $strSlice = bind.call($call, String.prototype.slice);
    var $exec = bind.call($call, RegExp.prototype.exec);
    var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath = function stringToPath2(string) {
      var first = $strSlice(string, 0, 1);
      var last = $strSlice(string, -1);
      if (first === "%" && last !== "%") {
        throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
      } else if (last === "%" && first !== "%") {
        throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
      }
      var result = [];
      $replace(string, rePropName, function(match, number, quote, subString) {
        result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
      });
      return result;
    };
    var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
      var intrinsicName = name;
      var alias;
      if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
        alias = LEGACY_ALIASES[intrinsicName];
        intrinsicName = "%" + alias[0] + "%";
      }
      if (hasOwn(INTRINSICS, intrinsicName)) {
        var value = INTRINSICS[intrinsicName];
        if (value === needsEval) {
          value = doEval(intrinsicName);
        }
        if (typeof value === "undefined" && !allowMissing) {
          throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
        }
        return {
          alias,
          name: intrinsicName,
          value
        };
      }
      throw new $SyntaxError("intrinsic " + name + " does not exist!");
    };
    module2.exports = function GetIntrinsic(name, allowMissing) {
      if (typeof name !== "string" || name.length === 0) {
        throw new $TypeError("intrinsic name must be a non-empty string");
      }
      if (arguments.length > 1 && typeof allowMissing !== "boolean") {
        throw new $TypeError('"allowMissing" argument must be a boolean');
      }
      if ($exec(/^%?[^%]*%?$/, name) === null) {
        throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
      }
      var parts = stringToPath(name);
      var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
      var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
      var intrinsicRealName = intrinsic.name;
      var value = intrinsic.value;
      var skipFurtherCaching = false;
      var alias = intrinsic.alias;
      if (alias) {
        intrinsicBaseName = alias[0];
        $spliceApply(parts, $concat([0, 1], alias));
      }
      for (var i3 = 1, isOwn = true; i3 < parts.length; i3 += 1) {
        var part = parts[i3];
        var first = $strSlice(part, 0, 1);
        var last = $strSlice(part, -1);
        if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
          throw new $SyntaxError("property names with quotes must have matching quotes");
        }
        if (part === "constructor" || !isOwn) {
          skipFurtherCaching = true;
        }
        intrinsicBaseName += "." + part;
        intrinsicRealName = "%" + intrinsicBaseName + "%";
        if (hasOwn(INTRINSICS, intrinsicRealName)) {
          value = INTRINSICS[intrinsicRealName];
        } else if (value != null) {
          if (!(part in value)) {
            if (!allowMissing) {
              throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
            }
            return void 0;
          }
          if ($gOPD && i3 + 1 >= parts.length) {
            var desc = $gOPD(value, part);
            isOwn = !!desc;
            if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
              value = desc.get;
            } else {
              value = value[part];
            }
          } else {
            isOwn = hasOwn(value, part);
            value = value[part];
          }
          if (isOwn && !skipFurtherCaching) {
            INTRINSICS[intrinsicRealName] = value;
          }
        }
      }
      return value;
    };
  }
});

// ../../../node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js
var require_shams2 = __commonJS({
  "../../../node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) {
    "use strict";
    var hasSymbols = require_shams();
    module2.exports = function hasToStringTagShams() {
      return hasSymbols() && !!Symbol.toStringTag;
    };
  }
});

// ../../../node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js
var require_es_set_tostringtag = __commonJS({
  "../../../node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
    var hasToStringTag = require_shams2()();
    var hasOwn = require_hasown();
    var $TypeError = require_type();
    var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
    module2.exports = function setToStringTag(object, value) {
      var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
      var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
      if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") {
        throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
      }
      if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
        if ($defineProperty) {
          $defineProperty(object, toStringTag, {
            configurable: !nonConfigurable,
            enumerable: false,
            value,
            writable: false
          });
        } else {
          object[toStringTag] = value;
        }
      }
    };
  }
});

// ../../../node_modules/.pnpm/form-data@4.0.5/node_modules/form-data/lib/populate.js
var require_populate = __commonJS({
  "../../../node_modules/.pnpm/form-data@4.0.5/node_modules/form-data/lib/populate.js"(exports2, module2) {
    "use strict";
    module2.exports = function(dst, src) {
      Object.keys(src).forEach(function(prop) {
        dst[prop] = dst[prop] || src[prop];
      });
      return dst;
    };
  }
});

// ../../../node_modules/.pnpm/form-data@4.0.5/node_modules/form-data/lib/form_data.js
var require_form_data = __commonJS({
  "../../../node_modules/.pnpm/form-data@4.0.5/node_modules/form-data/lib/form_data.js"(exports2, module2) {
    "use strict";
    var CombinedStream = require_combined_stream();
    var util = require("util");
    var path2 = require("path");
    var http = require("http");
    var https = require("https");
    var parseUrl = require("url").parse;
    var fs2 = require("fs");
    var Stream = require("stream").Stream;
    var crypto = require("crypto");
    var mime = require_mime_types();
    var asynckit = require_asynckit();
    var setToStringTag = require_es_set_tostringtag();
    var hasOwn = require_hasown();
    var populate = require_populate();
    function FormData2(options) {
      if (!(this instanceof FormData2)) {
        return new FormData2(options);
      }
      this._overheadLength = 0;
      this._valueLength = 0;
      this._valuesToMeasure = [];
      CombinedStream.call(this);
      options = options || {};
      for (var option in options) {
        this[option] = options[option];
      }
    }
    util.inherits(FormData2, CombinedStream);
    FormData2.LINE_BREAK = "\r\n";
    FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream";
    FormData2.prototype.append = function(field, value, options) {
      options = options || {};
      if (typeof options === "string") {
        options = { filename: options };
      }
      var append = CombinedStream.prototype.append.bind(this);
      if (typeof value === "number" || value == null) {
        value = String(value);
      }
      if (Array.isArray(value)) {
        this._error(new Error("Arrays are not supported."));
        return;
      }
      var header = this._multiPartHeader(field, value, options);
      var footer = this._multiPartFooter();
      append(header);
      append(value);
      append(footer);
      this._trackLength(header, value, options);
    };
    FormData2.prototype._trackLength = function(header, value, options) {
      var valueLength = 0;
      if (options.knownLength != null) {
        valueLength += Number(options.knownLength);
      } else if (Buffer.isBuffer(value)) {
        valueLength = value.length;
      } else if (typeof value === "string") {
        valueLength = Buffer.byteLength(value);
      }
      this._valueLength += valueLength;
      this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length;
      if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) {
        return;
      }
      if (!options.knownLength) {
        this._valuesToMeasure.push(value);
      }
    };
    FormData2.prototype._lengthRetriever = function(value, callback) {
      if (hasOwn(value, "fd")) {
        if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
          callback(null, value.end + 1 - (value.start ? value.start : 0));
        } else {
          fs2.stat(value.path, function(err, stat) {
            if (err) {
              callback(err);
              return;
            }
            var fileSize = stat.size - (value.start ? value.start : 0);
            callback(null, fileSize);
          });
        }
      } else if (hasOwn(value, "httpVersion")) {
        callback(null, Number(value.headers["content-length"]));
      } else if (hasOwn(value, "httpModule")) {
        value.on("response", function(response) {
          value.pause();
          callback(null, Number(response.headers["content-length"]));
        });
        value.resume();
      } else {
        callback("Unknown stream");
      }
    };
    FormData2.prototype._multiPartHeader = function(field, value, options) {
      if (typeof options.header === "string") {
        return options.header;
      }
      var contentDisposition = this._getContentDisposition(value, options);
      var contentType = this._getContentType(value, options);
      var contents = "";
      var headers = {
        // add custom disposition as third element or keep it two elements if not
        "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
        // if no content type. allow it to be empty array
        "Content-Type": [].concat(contentType || [])
      };
      if (typeof options.header === "object") {
        populate(headers, options.header);
      }
      var header;
      for (var prop in headers) {
        if (hasOwn(headers, prop)) {
          header = headers[prop];
          if (header == null) {
            continue;
          }
          if (!Array.isArray(header)) {
            header = [header];
          }
          if (header.length) {
            contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK;
          }
        }
      }
      return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK;
    };
    FormData2.prototype._getContentDisposition = function(value, options) {
      var filename;
      if (typeof options.filepath === "string") {
        filename = path2.normalize(options.filepath).replace(/\\/g, "/");
      } else if (options.filename || value && (value.name || value.path)) {
        filename = path2.basename(options.filename || value && (value.name || value.path));
      } else if (value && value.readable && hasOwn(value, "httpVersion")) {
        filename = path2.basename(value.client._httpMessage.path || "");
      }
      if (filename) {
        return 'filename="' + filename + '"';
      }
    };
    FormData2.prototype._getContentType = function(value, options) {
      var contentType = options.contentType;
      if (!contentType && value && value.name) {
        contentType = mime.lookup(value.name);
      }
      if (!contentType && value && value.path) {
        contentType = mime.lookup(value.path);
      }
      if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) {
        contentType = value.headers["content-type"];
      }
      if (!contentType && (options.filepath || options.filename)) {
        contentType = mime.lookup(options.filepath || options.filename);
      }
      if (!contentType && value && typeof value === "object") {
        contentType = FormData2.DEFAULT_CONTENT_TYPE;
      }
      return contentType;
    };
    FormData2.prototype._multiPartFooter = function() {
      return function(next) {
        var footer = FormData2.LINE_BREAK;
        var lastPart = this._streams.length === 0;
        if (lastPart) {
          footer += this._lastBoundary();
        }
        next(footer);
      }.bind(this);
    };
    FormData2.prototype._lastBoundary = function() {
      return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK;
    };
    FormData2.prototype.getHeaders = function(userHeaders) {
      var header;
      var formHeaders = {
        "content-type": "multipart/form-data; boundary=" + this.getBoundary()
      };
      for (header in userHeaders) {
        if (hasOwn(userHeaders, header)) {
          formHeaders[header.toLowerCase()] = userHeaders[header];
        }
      }
      return formHeaders;
    };
    FormData2.prototype.setBoundary = function(boundary) {
      if (typeof boundary !== "string") {
        throw new TypeError("FormData boundary must be a string");
      }
      this._boundary = boundary;
    };
    FormData2.prototype.getBoundary = function() {
      if (!this._boundary) {
        this._generateBoundary();
      }
      return this._boundary;
    };
    FormData2.prototype.getBuffer = function() {
      var dataBuffer = new Buffer.alloc(0);
      var boundary = this.getBoundary();
      for (var i3 = 0, len = this._streams.length; i3 < len; i3++) {
        if (typeof this._streams[i3] !== "function") {
          if (Buffer.isBuffer(this._streams[i3])) {
            dataBuffer = Buffer.concat([dataBuffer, this._streams[i3]]);
          } else {
            dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i3])]);
          }
          if (typeof this._streams[i3] !== "string" || this._streams[i3].substring(2, boundary.length + 2) !== boundary) {
            dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]);
          }
        }
      }
      return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
    };
    FormData2.prototype._generateBoundary = function() {
      this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex");
    };
    FormData2.prototype.getLengthSync = function() {
      var knownLength = this._overheadLength + this._valueLength;
      if (this._streams.length) {
        knownLength += this._lastBoundary().length;
      }
      if (!this.hasKnownLength()) {
        this._error(new Error("Cannot calculate proper length in synchronous way."));
      }
      return knownLength;
    };
    FormData2.prototype.hasKnownLength = function() {
      var hasKnownLength = true;
      if (this._valuesToMeasure.length) {
        hasKnownLength = false;
      }
      return hasKnownLength;
    };
    FormData2.prototype.getLength = function(cb) {
      var knownLength = this._overheadLength + this._valueLength;
      if (this._streams.length) {
        knownLength += this._lastBoundary().length;
      }
      if (!this._valuesToMeasure.length) {
        process.nextTick(cb.bind(this, null, knownLength));
        return;
      }
      asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
        if (err) {
          cb(err);
          return;
        }
        values.forEach(function(length) {
          knownLength += length;
        });
        cb(null, knownLength);
      });
    };
    FormData2.prototype.submit = function(params, cb) {
      var request;
      var options;
      var defaults = { method: "post" };
      if (typeof params === "string") {
        params = parseUrl(params);
        options = populate({
          port: params.port,
          path: params.pathname,
          host: params.hostname,
          protocol: params.protocol
        }, defaults);
      } else {
        options = populate(params, defaults);
        if (!options.port) {
          options.port = options.protocol === "https:" ? 443 : 80;
        }
      }
      options.headers = this.getHeaders(params.headers);
      if (options.protocol === "https:") {
        request = https.request(options);
      } else {
        request = http.request(options);
      }
      this.getLength(function(err, length) {
        if (err && err !== "Unknown stream") {
          this._error(err);
          return;
        }
        if (length) {
          request.setHeader("Content-Length", length);
        }
        this.pipe(request);
        if (cb) {
          var onResponse;
          var callback = function(error, responce) {
            request.removeListener("error", callback);
            request.removeListener("response", onResponse);
            return cb.call(this, error, responce);
          };
          onResponse = callback.bind(this, null);
          request.on("error", callback);
          request.on("response", onResponse);
        }
      }.bind(this));
      return request;
    };
    FormData2.prototype._error = function(err) {
      if (!this.error) {
        this.error = err;
        this.pause();
        this.emit("error", err);
      }
    };
    FormData2.prototype.toString = function() {
      return "[object FormData]";
    };
    setToStringTag(FormData2.prototype, "FormData");
    module2.exports = FormData2;
  }
});

// ../../../node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js
var require_proxy_from_env = __commonJS({
  "../../../node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) {
    "use strict";
    var parseUrl = require("url").parse;
    var DEFAULT_PORTS = {
      ftp: 21,
      gopher: 70,
      http: 80,
      https: 443,
      ws: 80,
      wss: 443
    };
    var stringEndsWith = String.prototype.endsWith || function(s) {
      return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
    };
    function getProxyForUrl(url) {
      var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {};
      var proto = parsedUrl.protocol;
      var hostname = parsedUrl.host;
      var port = parsedUrl.port;
      if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
        return "";
      }
      proto = proto.split(":", 1)[0];
      hostname = hostname.replace(/:\d*$/, "");
      port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
      if (!shouldProxy(hostname, port)) {
        return "";
      }
      var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
      if (proxy && proxy.indexOf("://") === -1) {
        proxy = proto + "://" + proxy;
      }
      return proxy;
    }
    function shouldProxy(hostname, port) {
      var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
      if (!NO_PROXY) {
        return true;
      }
      if (NO_PROXY === "*") {
        return false;
      }
      return NO_PROXY.split(/[,\s]/).every(function(proxy) {
        if (!proxy) {
          return true;
        }
        var parsedProxy = proxy.match(/^(.+):(\d+)$/);
        var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
        var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
        if (parsedProxyPort && parsedProxyPort !== port) {
          return true;
        }
        if (!/^[.*]/.test(parsedProxyHostname)) {
          return hostname !== parsedProxyHostname;
        }
        if (parsedProxyHostname.charAt(0) === "*") {
          parsedProxyHostname = parsedProxyHostname.slice(1);
        }
        return !stringEndsWith.call(hostname, parsedProxyHostname);
      });
    }
    function getEnv(key) {
      return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
    }
    exports2.getProxyForUrl = getProxyForUrl;
  }
});

// ../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
var require_ms3 = __commonJS({
  "../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
    var s = 1e3;
    var m = s * 60;
    var h3 = m * 60;
    var d3 = h3 * 24;
    var w5 = d3 * 7;
    var y3 = d3 * 365.25;
    module2.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse2(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse2(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n3 = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n3 * y3;
        case "weeks":
        case "week":
        case "w":
          return n3 * w5;
        case "days":
        case "day":
        case "d":
          return n3 * d3;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n3 * h3;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n3 * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n3 * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n3;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d3) {
        return Math.round(ms / d3) + "d";
      }
      if (msAbs >= h3) {
        return Math.round(ms / h3) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d3) {
        return plural(ms, msAbs, d3, "day");
      }
      if (msAbs >= h3) {
        return plural(ms, msAbs, h3, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n3, name) {
      var isPlural = msAbs >= n3 * 1.5;
      return Math.round(ms / n3) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/common.js
var require_common2 = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/common.js"(exports2, module2) {
    function setup(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms3();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i3 = 0; i3 < namespace.length; i3++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i3);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug(...args) {
          if (!debug.enabled) {
            return;
          }
          const self2 = debug;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self2.diff = ms;
          self2.prev = prevTime;
          self2.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
            if (match === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format2];
            if (typeof formatter === "function") {
              const val = args[index];
              match = formatter.call(self2, val);
              args.splice(index, 1);
              index--;
            }
            return match;
          });
          createDebug.formatArgs.call(self2, args);
          const logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        debug.namespace = namespace;
        debug.useColors = createDebug.useColors();
        debug.color = createDebug.selectColor(namespace);
        debug.extend = extend;
        debug.destroy = createDebug.destroy;
        Object.defineProperty(debug, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v3) => {
            enableOverride = v3;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug);
        }
        return debug;
      }
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module2.exports = setup;
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports2, module2) {
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.storage = localstorage();
    exports2.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports2.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 useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && 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 !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c3 = "color: " + this.color;
      args.splice(1, 0, c3, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match) => {
        if (match === "%%") {
          return;
        }
        index++;
        if (match === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c3);
    }
    exports2.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports2.storage.setItem("debug", namespaces);
        } else {
          exports2.storage.removeItem("debug");
        }
      } catch (error) {
      }
    }
    function load() {
      let r3;
      try {
        r3 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
      } catch (error) {
      }
      if (!r3 && typeof process !== "undefined" && "env" in process) {
        r3 = process.env.DEBUG;
      }
      return r3;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error) {
      }
    }
    module2.exports = require_common2()(exports2);
    var { formatters } = module2.exports;
    formatters.j = function(v3) {
      try {
        return JSON.stringify(v3);
      } catch (error) {
        return "[UnexpectedJSONParseError]: " + error.message;
      }
    };
  }
});

// ../../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
var require_has_flag2 = __commonJS({
  "../../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (flag, argv) => {
      argv = argv || process.argv;
      const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
      const pos = argv.indexOf(prefix + flag);
      const terminatorPos = argv.indexOf("--");
      return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
    };
  }
});

// ../../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
var require_supports_color = __commonJS({
  "../../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
    "use strict";
    var os2 = require("os");
    var hasFlag = require_has_flag2();
    var env = process.env;
    var forceColor;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
      forceColor = false;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      forceColor = true;
    }
    if ("FORCE_COLOR" in env) {
      forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(stream) {
      if (forceColor === false) {
        return 0;
      }
      if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
        return 3;
      }
      if (hasFlag("color=256")) {
        return 2;
      }
      if (stream && !stream.isTTY && forceColor !== true) {
        return 0;
      }
      const min = forceColor ? 1 : 0;
      if (process.platform === "win32") {
        const osRelease = os2.release().split(".");
        if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if (env.COLORTERM === "truecolor") {
        return 3;
      }
      if ("TERM_PROGRAM" in env) {
        const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version >= 3 ? 3 : 2;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      if (env.TERM === "dumb") {
        return min;
      }
      return min;
    }
    function getSupportLevel(stream) {
      const level = supportsColor(stream);
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel(process.stdout),
      stderr: getSupportLevel(process.stderr)
    };
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/node.js
var require_node3 = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/node.js"(exports2, module2) {
    var tty = require("tty");
    var util = require("util");
    exports2.init = init;
    exports2.log = log;
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.destroy = util.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    );
    exports2.colors = [6, 2, 3, 4, 5, 1];
    try {
      const supportsColor = require_supports_color();
      if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
        exports2.colors = [
          20,
          21,
          26,
          27,
          32,
          33,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          56,
          57,
          62,
          63,
          68,
          69,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          92,
          93,
          98,
          99,
          112,
          113,
          128,
          129,
          134,
          135,
          148,
          149,
          160,
          161,
          162,
          163,
          164,
          165,
          166,
          167,
          168,
          169,
          170,
          171,
          172,
          173,
          178,
          179,
          184,
          185,
          196,
          197,
          198,
          199,
          200,
          201,
          202,
          203,
          204,
          205,
          206,
          207,
          208,
          209,
          214,
          215,
          220,
          221
        ];
      }
    } catch (error) {
    }
    exports2.inspectOpts = Object.keys(process.env).filter((key) => {
      return /^debug_/i.test(key);
    }).reduce((obj, key) => {
      const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
        return k.toUpperCase();
      });
      let val = process.env[key];
      if (/^(yes|on|true|enabled)$/i.test(val)) {
        val = true;
      } else if (/^(no|off|false|disabled)$/i.test(val)) {
        val = false;
      } else if (val === "null") {
        val = null;
      } else {
        val = Number(val);
      }
      obj[prop] = val;
      return obj;
    }, {});
    function useColors() {
      return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
    }
    function formatArgs(args) {
      const { namespace: name, useColors: useColors2 } = this;
      if (useColors2) {
        const c3 = this.color;
        const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
        const prefix = `  ${colorCode};1m${name} \x1B[0m`;
        args[0] = prefix + args[0].split("\n").join("\n" + prefix);
        args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
      } else {
        args[0] = getDate() + name + " " + args[0];
      }
    }
    function getDate() {
      if (exports2.inspectOpts.hideDate) {
        return "";
      }
      return (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    function log(...args) {
      return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
    }
    function save(namespaces) {
      if (namespaces) {
        process.env.DEBUG = namespaces;
      } else {
        delete process.env.DEBUG;
      }
    }
    function load() {
      return process.env.DEBUG;
    }
    function init(debug) {
      debug.inspectOpts = {};
      const keys = Object.keys(exports2.inspectOpts);
      for (let i3 = 0; i3 < keys.length; i3++) {
        debug.inspectOpts[keys[i3]] = exports2.inspectOpts[keys[i3]];
      }
    }
    module2.exports = require_common2()(exports2);
    var { formatters } = module2.exports;
    formatters.o = function(v3) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v3, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
    };
    formatters.O = function(v3) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v3, this.inspectOpts);
    };
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/index.js
var require_src = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/index.js"(exports2, module2) {
    if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
      module2.exports = require_browser();
    } else {
      module2.exports = require_node3();
    }
  }
});

// ../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js
var require_debug = __commonJS({
  "../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) {
    var debug;
    module2.exports = function() {
      if (!debug) {
        try {
          debug = require_src()("follow-redirects");
        } catch (error) {
        }
        if (typeof debug !== "function") {
          debug = function() {
          };
        }
      }
      debug.apply(null, arguments);
    };
  }
});

// ../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js
var require_follow_redirects = __commonJS({
  "../../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module2) {
    var url = require("url");
    var URL2 = url.URL;
    var http = require("http");
    var https = require("https");
    var Writable = require("stream").Writable;
    var assert = require("assert");
    var debug = require_debug();
    (function detectUnsupportedEnvironment() {
      var looksLikeNode = typeof process !== "undefined";
      var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
      var looksLikeV8 = isFunction(Error.captureStackTrace);
      if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
        console.warn("The follow-redirects package should be excluded from browser builds.");
      }
    })();
    var useNativeURL = false;
    try {
      assert(new URL2(""));
    } catch (error) {
      useNativeURL = error.code === "ERR_INVALID_URL";
    }
    var preservedUrlFields = [
      "auth",
      "host",
      "hostname",
      "href",
      "path",
      "pathname",
      "port",
      "protocol",
      "query",
      "search",
      "hash"
    ];
    var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
    var eventHandlers = /* @__PURE__ */ Object.create(null);
    events.forEach(function(event) {
      eventHandlers[event] = function(arg1, arg2, arg3) {
        this._redirectable.emit(event, arg1, arg2, arg3);
      };
    });
    var InvalidUrlError = createErrorType(
      "ERR_INVALID_URL",
      "Invalid URL",
      TypeError
    );
    var RedirectionError = createErrorType(
      "ERR_FR_REDIRECTION_FAILURE",
      "Redirected request failed"
    );
    var TooManyRedirectsError = createErrorType(
      "ERR_FR_TOO_MANY_REDIRECTS",
      "Maximum number of redirects exceeded",
      RedirectionError
    );
    var MaxBodyLengthExceededError = createErrorType(
      "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
      "Request body larger than maxBodyLength limit"
    );
    var WriteAfterEndError = createErrorType(
      "ERR_STREAM_WRITE_AFTER_END",
      "write after end"
    );
    var destroy = Writable.prototype.destroy || noop;
    function RedirectableRequest(options, responseCallback) {
      Writable.call(this);
      this._sanitizeOptions(options);
      this._options = options;
      this._ended = false;
      this._ending = false;
      this._redirectCount = 0;
      this._redirects = [];
      this._requestBodyLength = 0;
      this._requestBodyBuffers = [];
      if (responseCallback) {
        this.on("response", responseCallback);
      }
      var self2 = this;
      this._onNativeResponse = function(response) {
        try {
          self2._processResponse(response);
        } catch (cause) {
          self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
        }
      };
      this._performRequest();
    }
    RedirectableRequest.prototype = Object.create(Writable.prototype);
    RedirectableRequest.prototype.abort = function() {
      destroyRequest(this._currentRequest);
      this._currentRequest.abort();
      this.emit("abort");
    };
    RedirectableRequest.prototype.destroy = function(error) {
      destroyRequest(this._currentRequest, error);
      destroy.call(this, error);
      return this;
    };
    RedirectableRequest.prototype.write = function(data, encoding, callback) {
      if (this._ending) {
        throw new WriteAfterEndError();
      }
      if (!isString(data) && !isBuffer(data)) {
        throw new TypeError("data should be a string, Buffer or Uint8Array");
      }
      if (isFunction(encoding)) {
        callback = encoding;
        encoding = null;
      }
      if (data.length === 0) {
        if (callback) {
          callback();
        }
        return;
      }
      if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
        this._requestBodyLength += data.length;
        this._requestBodyBuffers.push({ data, encoding });
        this._currentRequest.write(data, encoding, callback);
      } else {
        this.emit("error", new MaxBodyLengthExceededError());
        this.abort();
      }
    };
    RedirectableRequest.prototype.end = function(data, encoding, callback) {
      if (isFunction(data)) {
        callback = data;
        data = encoding = null;
      } else if (isFunction(encoding)) {
        callback = encoding;
        encoding = null;
      }
      if (!data) {
        this._ended = this._ending = true;
        this._currentRequest.end(null, null, callback);
      } else {
        var self2 = this;
        var currentRequest = this._currentRequest;
        this.write(data, encoding, function() {
          self2._ended = true;
          currentRequest.end(null, null, callback);
        });
        this._ending = true;
      }
    };
    RedirectableRequest.prototype.setHeader = function(name, value) {
      this._options.headers[name] = value;
      this._currentRequest.setHeader(name, value);
    };
    RedirectableRequest.prototype.removeHeader = function(name) {
      delete this._options.headers[name];
      this._currentRequest.removeHeader(name);
    };
    RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
      var self2 = this;
      function destroyOnTimeout(socket) {
        socket.setTimeout(msecs);
        socket.removeListener("timeout", socket.destroy);
        socket.addListener("timeout", socket.destroy);
      }
      function startTimer(socket) {
        if (self2._timeout) {
          clearTimeout(self2._timeout);
        }
        self2._timeout = setTimeout(function() {
          self2.emit("timeout");
          clearTimer();
        }, msecs);
        destroyOnTimeout(socket);
      }
      function clearTimer() {
        if (self2._timeout) {
          clearTimeout(self2._timeout);
          self2._timeout = null;
        }
        self2.removeListener("abort", clearTimer);
        self2.removeListener("error", clearTimer);
        self2.removeListener("response", clearTimer);
        self2.removeListener("close", clearTimer);
        if (callback) {
          self2.removeListener("timeout", callback);
        }
        if (!self2.socket) {
          self2._currentRequest.removeListener("socket", startTimer);
        }
      }
      if (callback) {
        this.on("timeout", callback);
      }
      if (this.socket) {
        startTimer(this.socket);
      } else {
        this._currentRequest.once("socket", startTimer);
      }
      this.on("socket", destroyOnTimeout);
      this.on("abort", clearTimer);
      this.on("error", clearTimer);
      this.on("response", clearTimer);
      this.on("close", clearTimer);
      return this;
    };
    [
      "flushHeaders",
      "getHeader",
      "setNoDelay",
      "setSocketKeepAlive"
    ].forEach(function(method) {
      RedirectableRequest.prototype[method] = function(a, b3) {
        return this._currentRequest[method](a, b3);
      };
    });
    ["aborted", "connection", "socket"].forEach(function(property) {
      Object.defineProperty(RedirectableRequest.prototype, property, {
        get: function() {
          return this._currentRequest[property];
        }
      });
    });
    RedirectableRequest.prototype._sanitizeOptions = function(options) {
      if (!options.headers) {
        options.headers = {};
      }
      if (options.host) {
        if (!options.hostname) {
          options.hostname = options.host;
        }
        delete options.host;
      }
      if (!options.pathname && options.path) {
        var searchPos = options.path.indexOf("?");
        if (searchPos < 0) {
          options.pathname = options.path;
        } else {
          options.pathname = options.path.substring(0, searchPos);
          options.search = options.path.substring(searchPos);
        }
      }
    };
    RedirectableRequest.prototype._performRequest = function() {
      var protocol = this._options.protocol;
      var nativeProtocol = this._options.nativeProtocols[protocol];
      if (!nativeProtocol) {
        throw new TypeError("Unsupported protocol " + protocol);
      }
      if (this._options.agents) {
        var scheme = protocol.slice(0, -1);
        this._options.agent = this._options.agents[scheme];
      }
      var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
      request._redirectable = this;
      for (var event of events) {
        request.on(event, eventHandlers[event]);
      }
      this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : (
        // When making a request to a proxy, […]
        // a client MUST send the target URI in absolute-form […].
        this._options.path
      );
      if (this._isRedirect) {
        var i3 = 0;
        var self2 = this;
        var buffers = this._requestBodyBuffers;
        (function writeNext(error) {
          if (request === self2._currentRequest) {
            if (error) {
              self2.emit("error", error);
            } else if (i3 < buffers.length) {
              var buffer = buffers[i3++];
              if (!request.finished) {
                request.write(buffer.data, buffer.encoding, writeNext);
              }
            } else if (self2._ended) {
              request.end();
            }
          }
        })();
      }
    };
    RedirectableRequest.prototype._processResponse = function(response) {
      var statusCode = response.statusCode;
      if (this._options.trackRedirects) {
        this._redirects.push({
          url: this._currentUrl,
          headers: response.headers,
          statusCode
        });
      }
      var location = response.headers.location;
      if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
        response.responseUrl = this._currentUrl;
        response.redirects = this._redirects;
        this.emit("response", response);
        this._requestBodyBuffers = [];
        return;
      }
      destroyRequest(this._currentRequest);
      response.destroy();
      if (++this._redirectCount > this._options.maxRedirects) {
        throw new TooManyRedirectsError();
      }
      var requestHeaders;
      var beforeRedirect = this._options.beforeRedirect;
      if (beforeRedirect) {
        requestHeaders = Object.assign({
          // The Host header was set by nativeProtocol.request
          Host: response.req.getHeader("host")
        }, this._options.headers);
      }
      var method = this._options.method;
      if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that
      // the server is redirecting the user agent to a different resource […]
      // A user agent can perform a retrieval request targeting that URI
      // (a GET or HEAD request if using HTTP) […]
      statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
        this._options.method = "GET";
        this._requestBodyBuffers = [];
        removeMatchingHeaders(/^content-/i, this._options.headers);
      }
      var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
      var currentUrlParts = parseUrl(this._currentUrl);
      var currentHost = currentHostHeader || currentUrlParts.host;
      var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost }));
      var redirectUrl = resolveUrl(location, currentUrl);
      debug("redirecting to", redirectUrl.href);
      this._isRedirect = true;
      spreadUrlObject(redirectUrl, this._options);
      if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
        removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
      }
      if (isFunction(beforeRedirect)) {
        var responseDetails = {
          headers: response.headers,
          statusCode
        };
        var requestDetails = {
          url: currentUrl,
          method,
          headers: requestHeaders
        };
        beforeRedirect(this._options, responseDetails, requestDetails);
        this._sanitizeOptions(this._options);
      }
      this._performRequest();
    };
    function wrap(protocols) {
      var exports3 = {
        maxRedirects: 21,
        maxBodyLength: 10 * 1024 * 1024
      };
      var nativeProtocols = {};
      Object.keys(protocols).forEach(function(scheme) {
        var protocol = scheme + ":";
        var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
        var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol);
        function request(input, options, callback) {
          if (isURL(input)) {
            input = spreadUrlObject(input);
          } else if (isString(input)) {
            input = spreadUrlObject(parseUrl(input));
          } else {
            callback = options;
            options = validateUrl(input);
            input = { protocol };
          }
          if (isFunction(options)) {
            callback = options;
            options = null;
          }
          options = Object.assign({
            maxRedirects: exports3.maxRedirects,
            maxBodyLength: exports3.maxBodyLength
          }, input, options);
          options.nativeProtocols = nativeProtocols;
          if (!isString(options.host) && !isString(options.hostname)) {
            options.hostname = "::1";
          }
          assert.equal(options.protocol, protocol, "protocol mismatch");
          debug("options", options);
          return new RedirectableRequest(options, callback);
        }
        function get(input, options, callback) {
          var wrappedRequest = wrappedProtocol.request(input, options, callback);
          wrappedRequest.end();
          return wrappedRequest;
        }
        Object.defineProperties(wrappedProtocol, {
          request: { value: request, configurable: true, enumerable: true, writable: true },
          get: { value: get, configurable: true, enumerable: true, writable: true }
        });
      });
      return exports3;
    }
    function noop() {
    }
    function parseUrl(input) {
      var parsed;
      if (useNativeURL) {
        parsed = new URL2(input);
      } else {
        parsed = validateUrl(url.parse(input));
        if (!isString(parsed.protocol)) {
          throw new InvalidUrlError({ input });
        }
      }
      return parsed;
    }
    function resolveUrl(relative, base) {
      return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative));
    }
    function validateUrl(input) {
      if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
        throw new InvalidUrlError({ input: input.href || input });
      }
      if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
        throw new InvalidUrlError({ input: input.href || input });
      }
      return input;
    }
    function spreadUrlObject(urlObject, target) {
      var spread = target || {};
      for (var key of preservedUrlFields) {
        spread[key] = urlObject[key];
      }
      if (spread.hostname.startsWith("[")) {
        spread.hostname = spread.hostname.slice(1, -1);
      }
      if (spread.port !== "") {
        spread.port = Number(spread.port);
      }
      spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
      return spread;
    }
    function removeMatchingHeaders(regex, headers) {
      var lastValue;
      for (var header in headers) {
        if (regex.test(header)) {
          lastValue = headers[header];
          delete headers[header];
        }
      }
      return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
    }
    function createErrorType(code, message, baseClass) {
      function CustomError(properties) {
        if (isFunction(Error.captureStackTrace)) {
          Error.captureStackTrace(this, this.constructor);
        }
        Object.assign(this, properties || {});
        this.code = code;
        this.message = this.cause ? message + ": " + this.cause.message : message;
      }
      CustomError.prototype = new (baseClass || Error)();
      Object.defineProperties(CustomError.prototype, {
        constructor: {
          value: CustomError,
          enumerable: false
        },
        name: {
          value: "Error [" + code + "]",
          enumerable: false
        }
      });
      return CustomError;
    }
    function destroyRequest(request, error) {
      for (var event of events) {
        request.removeListener(event, eventHandlers[event]);
      }
      request.on("error", noop);
      request.destroy(error);
    }
    function isSubdomain(subdomain, domain) {
      assert(isString(subdomain) && isString(domain));
      var dot = subdomain.length - domain.length - 1;
      return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
    }
    function isString(value) {
      return typeof value === "string" || value instanceof String;
    }
    function isFunction(value) {
      return typeof value === "function";
    }
    function isBuffer(value) {
      return typeof value === "object" && "length" in value;
    }
    function isURL(value) {
      return URL2 && value instanceof URL2;
    }
    module2.exports = wrap({ http, https });
    module2.exports.wrap = wrap;
  }
});

// ../../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/dist/node/axios.cjs
var require_axios = __commonJS({
  "../../../node_modules/.pnpm/axios@1.13.6/node_modules/axios/dist/node/axios.cjs"(exports2, module2) {
    "use strict";
    var FormData$1 = require_form_data();
    var crypto = require("crypto");
    var url = require("url");
    var proxyFromEnv = require_proxy_from_env();
    var http = require("http");
    var https = require("https");
    var http2 = require("http2");
    var util = require("util");
    var followRedirects = require_follow_redirects();
    var zlib = require("zlib");
    var stream = require("stream");
    var events = require("events");
    function _interopDefaultLegacy(e3) {
      return e3 && typeof e3 === "object" && "default" in e3 ? e3 : { "default": e3 };
    }
    var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1);
    var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto);
    var url__default = /* @__PURE__ */ _interopDefaultLegacy(url);
    var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv);
    var http__default = /* @__PURE__ */ _interopDefaultLegacy(http);
    var https__default = /* @__PURE__ */ _interopDefaultLegacy(https);
    var http2__default = /* @__PURE__ */ _interopDefaultLegacy(http2);
    var util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
    var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects);
    var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib);
    var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream);
    function bind(fn, thisArg) {
      return function wrap() {
        return fn.apply(thisArg, arguments);
      };
    }
    var { toString } = Object.prototype;
    var { getPrototypeOf } = Object;
    var { iterator, toStringTag } = Symbol;
    var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
      const str = toString.call(thing);
      return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
    })(/* @__PURE__ */ Object.create(null));
    var kindOfTest = (type) => {
      type = type.toLowerCase();
      return (thing) => kindOf(thing) === type;
    };
    var typeOfTest = (type) => (thing) => typeof thing === type;
    var { isArray } = Array;
    var isUndefined = typeOfTest("undefined");
    function isBuffer(val) {
      return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
    }
    var isArrayBuffer = kindOfTest("ArrayBuffer");
    function isArrayBufferView(val) {
      let result;
      if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
        result = ArrayBuffer.isView(val);
      } else {
        result = val && val.buffer && isArrayBuffer(val.buffer);
      }
      return result;
    }
    var isString = typeOfTest("string");
    var isFunction$1 = typeOfTest("function");
    var isNumber = typeOfTest("number");
    var isObject = (thing) => thing !== null && typeof thing === "object";
    var isBoolean = (thing) => thing === true || thing === false;
    var isPlainObject = (val) => {
      if (kindOf(val) !== "object") {
        return false;
      }
      const prototype2 = getPrototypeOf(val);
      return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
    };
    var isEmptyObject = (val) => {
      if (!isObject(val) || isBuffer(val)) {
        return false;
      }
      try {
        return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
      } catch (e3) {
        return false;
      }
    };
    var isDate = kindOfTest("Date");
    var isFile = kindOfTest("File");
    var isReactNativeBlob = (value) => {
      return !!(value && typeof value.uri !== "undefined");
    };
    var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
    var isBlob = kindOfTest("Blob");
    var isFileList = kindOfTest("FileList");
    var isStream = (val) => isObject(val) && isFunction$1(val.pipe);
    function getGlobal() {
      if (typeof globalThis !== "undefined") return globalThis;
      if (typeof self !== "undefined") return self;
      if (typeof window !== "undefined") return window;
      if (typeof global !== "undefined") return global;
      return {};
    }
    var G = getGlobal();
    var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
    var isFormData = (thing) => {
      let kind;
      return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
      kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
    };
    var isURLSearchParams = kindOfTest("URLSearchParams");
    var [isReadableStream, isRequest2, isResponse, isHeaders] = [
      "ReadableStream",
      "Request",
      "Response",
      "Headers"
    ].map(kindOfTest);
    var trim = (str) => {
      return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
    };
    function forEach(obj, fn, { allOwnKeys = false } = {}) {
      if (obj === null || typeof obj === "undefined") {
        return;
      }
      let i3;
      let l3;
      if (typeof obj !== "object") {
        obj = [obj];
      }
      if (isArray(obj)) {
        for (i3 = 0, l3 = obj.length; i3 < l3; i3++) {
          fn.call(null, obj[i3], i3, obj);
        }
      } else {
        if (isBuffer(obj)) {
          return;
        }
        const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
        const len = keys.length;
        let key;
        for (i3 = 0; i3 < len; i3++) {
          key = keys[i3];
          fn.call(null, obj[key], key, obj);
        }
      }
    }
    function findKey(obj, key) {
      if (isBuffer(obj)) {
        return null;
      }
      key = key.toLowerCase();
      const keys = Object.keys(obj);
      let i3 = keys.length;
      let _key;
      while (i3-- > 0) {
        _key = keys[i3];
        if (key === _key.toLowerCase()) {
          return _key;
        }
      }
      return null;
    }
    var _global = (() => {
      if (typeof globalThis !== "undefined") return globalThis;
      return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
    })();
    var isContextDefined = (context) => !isUndefined(context) && context !== _global;
    function merge() {
      const { caseless, skipUndefined } = isContextDefined(this) && this || {};
      const result = {};
      const assignValue = (val, key) => {
        if (key === "__proto__" || key === "constructor" || key === "prototype") {
          return;
        }
        const targetKey = caseless && findKey(result, key) || key;
        if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
          result[targetKey] = merge(result[targetKey], val);
        } else if (isPlainObject(val)) {
          result[targetKey] = merge({}, val);
        } else if (isArray(val)) {
          result[targetKey] = val.slice();
        } else if (!skipUndefined || !isUndefined(val)) {
          result[targetKey] = val;
        }
      };
      for (let i3 = 0, l3 = arguments.length; i3 < l3; i3++) {
        arguments[i3] && forEach(arguments[i3], assignValue);
      }
      return result;
    }
    var extend = (a, b3, thisArg, { allOwnKeys } = {}) => {
      forEach(
        b3,
        (val, key) => {
          if (thisArg && isFunction$1(val)) {
            Object.defineProperty(a, key, {
              value: bind(val, thisArg),
              writable: true,
              enumerable: true,
              configurable: true
            });
          } else {
            Object.defineProperty(a, key, {
              value: val,
              writable: true,
              enumerable: true,
              configurable: true
            });
          }
        },
        { allOwnKeys }
      );
      return a;
    };
    var stripBOM = (content) => {
      if (content.charCodeAt(0) === 65279) {
        content = content.slice(1);
      }
      return content;
    };
    var inherits = (constructor, superConstructor, props, descriptors) => {
      constructor.prototype = Object.create(superConstructor.prototype, descriptors);
      Object.defineProperty(constructor.prototype, "constructor", {
        value: constructor,
        writable: true,
        enumerable: false,
        configurable: true
      });
      Object.defineProperty(constructor, "super", {
        value: superConstructor.prototype
      });
      props && Object.assign(constructor.prototype, props);
    };
    var toFlatObject = (sourceObj, destObj, filter, propFilter) => {
      let props;
      let i3;
      let prop;
      const merged = {};
      destObj = destObj || {};
      if (sourceObj == null) return destObj;
      do {
        props = Object.getOwnPropertyNames(sourceObj);
        i3 = props.length;
        while (i3-- > 0) {
          prop = props[i3];
          if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
            destObj[prop] = sourceObj[prop];
            merged[prop] = true;
          }
        }
        sourceObj = filter !== false && getPrototypeOf(sourceObj);
      } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
      return destObj;
    };
    var endsWith = (str, searchString, position) => {
      str = String(str);
      if (position === void 0 || position > str.length) {
        position = str.length;
      }
      position -= searchString.length;
      const lastIndex = str.indexOf(searchString, position);
      return lastIndex !== -1 && lastIndex === position;
    };
    var toArray = (thing) => {
      if (!thing) return null;
      if (isArray(thing)) return thing;
      let i3 = thing.length;
      if (!isNumber(i3)) return null;
      const arr = new Array(i3);
      while (i3-- > 0) {
        arr[i3] = thing[i3];
      }
      return arr;
    };
    var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
      return (thing) => {
        return TypedArray && thing instanceof TypedArray;
      };
    })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
    var forEachEntry = (obj, fn) => {
      const generator = obj && obj[iterator];
      const _iterator = generator.call(obj);
      let result;
      while ((result = _iterator.next()) && !result.done) {
        const pair = result.value;
        fn.call(obj, pair[0], pair[1]);
      }
    };
    var matchAll = (regExp, str) => {
      let matches;
      const arr = [];
      while ((matches = regExp.exec(str)) !== null) {
        arr.push(matches);
      }
      return arr;
    };
    var isHTMLForm = kindOfTest("HTMLFormElement");
    var toCamelCase = (str) => {
      return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p22) {
        return p1.toUpperCase() + p22;
      });
    };
    var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
    var isRegExp = kindOfTest("RegExp");
    var reduceDescriptors = (obj, reducer) => {
      const descriptors = Object.getOwnPropertyDescriptors(obj);
      const reducedDescriptors = {};
      forEach(descriptors, (descriptor, name) => {
        let ret;
        if ((ret = reducer(descriptor, name, obj)) !== false) {
          reducedDescriptors[name] = ret || descriptor;
        }
      });
      Object.defineProperties(obj, reducedDescriptors);
    };
    var freezeMethods = (obj) => {
      reduceDescriptors(obj, (descriptor, name) => {
        if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
          return false;
        }
        const value = obj[name];
        if (!isFunction$1(value)) return;
        descriptor.enumerable = false;
        if ("writable" in descriptor) {
          descriptor.writable = false;
          return;
        }
        if (!descriptor.set) {
          descriptor.set = () => {
            throw Error("Can not rewrite read-only method '" + name + "'");
          };
        }
      });
    };
    var toObjectSet = (arrayOrString, delimiter) => {
      const obj = {};
      const define2 = (arr) => {
        arr.forEach((value) => {
          obj[value] = true;
        });
      };
      isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
      return obj;
    };
    var noop = () => {
    };
    var toFiniteNumber = (value, defaultValue) => {
      return value != null && Number.isFinite(value = +value) ? value : defaultValue;
    };
    function isSpecCompliantForm(thing) {
      return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
    }
    var toJSONObject = (obj) => {
      const stack = new Array(10);
      const visit = (source, i3) => {
        if (isObject(source)) {
          if (stack.indexOf(source) >= 0) {
            return;
          }
          if (isBuffer(source)) {
            return source;
          }
          if (!("toJSON" in source)) {
            stack[i3] = source;
            const target = isArray(source) ? [] : {};
            forEach(source, (value, key) => {
              const reducedValue = visit(value, i3 + 1);
              !isUndefined(reducedValue) && (target[key] = reducedValue);
            });
            stack[i3] = void 0;
            return target;
          }
        }
        return source;
      };
      return visit(obj, 0);
    };
    var isAsyncFn = kindOfTest("AsyncFunction");
    var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
    var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
      if (setImmediateSupported) {
        return setImmediate;
      }
      return postMessageSupported ? ((token2, callbacks) => {
        _global.addEventListener(
          "message",
          ({ source, data }) => {
            if (source === _global && data === token2) {
              callbacks.length && callbacks.shift()();
            }
          },
          false
        );
        return (cb) => {
          callbacks.push(cb);
          _global.postMessage(token2, "*");
        };
      })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
    })(typeof setImmediate === "function", isFunction$1(_global.postMessage));
    var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
    var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
    var utils$1 = {
      isArray,
      isArrayBuffer,
      isBuffer,
      isFormData,
      isArrayBufferView,
      isString,
      isNumber,
      isBoolean,
      isObject,
      isPlainObject,
      isEmptyObject,
      isReadableStream,
      isRequest: isRequest2,
      isResponse,
      isHeaders,
      isUndefined,
      isDate,
      isFile,
      isReactNativeBlob,
      isReactNative,
      isBlob,
      isRegExp,
      isFunction: isFunction$1,
      isStream,
      isURLSearchParams,
      isTypedArray,
      isFileList,
      forEach,
      merge,
      extend,
      trim,
      stripBOM,
      inherits,
      toFlatObject,
      kindOf,
      kindOfTest,
      endsWith,
      toArray,
      forEachEntry,
      matchAll,
      isHTMLForm,
      hasOwnProperty,
      hasOwnProp: hasOwnProperty,
      // an alias to avoid ESLint no-prototype-builtins detection
      reduceDescriptors,
      freezeMethods,
      toObjectSet,
      toCamelCase,
      noop,
      toFiniteNumber,
      findKey,
      global: _global,
      isContextDefined,
      isSpecCompliantForm,
      toJSONObject,
      isAsyncFn,
      isThenable,
      setImmediate: _setImmediate,
      asap,
      isIterable
    };
    var AxiosError = class _AxiosError extends Error {
      static from(error, code, config, request, response, customProps) {
        const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
        axiosError.cause = error;
        axiosError.name = error.name;
        if (error.status != null && axiosError.status == null) {
          axiosError.status = error.status;
        }
        customProps && Object.assign(axiosError, customProps);
        return axiosError;
      }
      /**
       * Create an Error with the specified message, config, error code, request and response.
       *
       * @param {string} message The error message.
       * @param {string} [code] The error code (for example, 'ECONNABORTED').
       * @param {Object} [config] The config.
       * @param {Object} [request] The request.
       * @param {Object} [response] The response.
       *
       * @returns {Error} The created error.
       */
      constructor(message, code, config, request, response) {
        super(message);
        Object.defineProperty(this, "message", {
          value: message,
          enumerable: true,
          writable: true,
          configurable: true
        });
        this.name = "AxiosError";
        this.isAxiosError = true;
        code && (this.code = code);
        config && (this.config = config);
        request && (this.request = request);
        if (response) {
          this.response = response;
          this.status = response.status;
        }
      }
      toJSON() {
        return {
          // Standard
          message: this.message,
          name: this.name,
          // Microsoft
          description: this.description,
          number: this.number,
          // Mozilla
          fileName: this.fileName,
          lineNumber: this.lineNumber,
          columnNumber: this.columnNumber,
          stack: this.stack,
          // Axios
          config: utils$1.toJSONObject(this.config),
          code: this.code,
          status: this.status
        };
      }
    };
    AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
    AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
    AxiosError.ECONNABORTED = "ECONNABORTED";
    AxiosError.ETIMEDOUT = "ETIMEDOUT";
    AxiosError.ERR_NETWORK = "ERR_NETWORK";
    AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
    AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
    AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
    AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
    AxiosError.ERR_CANCELED = "ERR_CANCELED";
    AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
    AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
    var AxiosError$1 = AxiosError;
    function isVisitable(thing) {
      return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
    }
    function removeBrackets(key) {
      return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
    }
    function renderKey(path2, key, dots) {
      if (!path2) return key;
      return path2.concat(key).map(function each(token2, i3) {
        token2 = removeBrackets(token2);
        return !dots && i3 ? "[" + token2 + "]" : token2;
      }).join(dots ? "." : "");
    }
    function isFlatArray(arr) {
      return utils$1.isArray(arr) && !arr.some(isVisitable);
    }
    var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
      return /^is[A-Z]/.test(prop);
    });
    function toFormData(obj, formData, options) {
      if (!utils$1.isObject(obj)) {
        throw new TypeError("target must be an object");
      }
      formData = formData || new (FormData__default["default"] || FormData)();
      options = utils$1.toFlatObject(
        options,
        {
          metaTokens: true,
          dots: false,
          indexes: false
        },
        false,
        function defined(option, source) {
          return !utils$1.isUndefined(source[option]);
        }
      );
      const metaTokens = options.metaTokens;
      const visitor = options.visitor || defaultVisitor;
      const dots = options.dots;
      const indexes = options.indexes;
      const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
      const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
      if (!utils$1.isFunction(visitor)) {
        throw new TypeError("visitor must be a function");
      }
      function convertValue(value) {
        if (value === null) return "";
        if (utils$1.isDate(value)) {
          return value.toISOString();
        }
        if (utils$1.isBoolean(value)) {
          return value.toString();
        }
        if (!useBlob && utils$1.isBlob(value)) {
          throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
        }
        if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
          return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
        }
        return value;
      }
      function defaultVisitor(value, key, path2) {
        let arr = value;
        if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
          formData.append(renderKey(path2, key, dots), convertValue(value));
          return false;
        }
        if (value && !path2 && typeof value === "object") {
          if (utils$1.endsWith(key, "{}")) {
            key = metaTokens ? key : key.slice(0, -2);
            value = JSON.stringify(value);
          } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
            key = removeBrackets(key);
            arr.forEach(function each(el, index) {
              !(utils$1.isUndefined(el) || el === null) && formData.append(
                // eslint-disable-next-line no-nested-ternary
                indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
                convertValue(el)
              );
            });
            return false;
          }
        }
        if (isVisitable(value)) {
          return true;
        }
        formData.append(renderKey(path2, key, dots), convertValue(value));
        return false;
      }
      const stack = [];
      const exposedHelpers = Object.assign(predicates, {
        defaultVisitor,
        convertValue,
        isVisitable
      });
      function build(value, path2) {
        if (utils$1.isUndefined(value)) return;
        if (stack.indexOf(value) !== -1) {
          throw Error("Circular reference detected in " + path2.join("."));
        }
        stack.push(value);
        utils$1.forEach(value, function each(el, key) {
          const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path2, exposedHelpers);
          if (result === true) {
            build(el, path2 ? path2.concat(key) : [key]);
          }
        });
        stack.pop();
      }
      if (!utils$1.isObject(obj)) {
        throw new TypeError("data must be an object");
      }
      build(obj);
      return formData;
    }
    function encode$1(str) {
      const charMap = {
        "!": "%21",
        "'": "%27",
        "(": "%28",
        ")": "%29",
        "~": "%7E",
        "%20": "+",
        "%00": "\0"
      };
      return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
        return charMap[match];
      });
    }
    function AxiosURLSearchParams(params, options) {
      this._pairs = [];
      params && toFormData(params, this, options);
    }
    var prototype = AxiosURLSearchParams.prototype;
    prototype.append = function append(name, value) {
      this._pairs.push([name, value]);
    };
    prototype.toString = function toString2(encoder) {
      const _encode = encoder ? function(value) {
        return encoder.call(this, value, encode$1);
      } : encode$1;
      return this._pairs.map(function each(pair) {
        return _encode(pair[0]) + "=" + _encode(pair[1]);
      }, "").join("&");
    };
    function encode(val) {
      return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
    }
    function buildURL(url2, params, options) {
      if (!params) {
        return url2;
      }
      const _encode = options && options.encode || encode;
      const _options = utils$1.isFunction(options) ? {
        serialize: options
      } : options;
      const serializeFn = _options && _options.serialize;
      let serializedParams;
      if (serializeFn) {
        serializedParams = serializeFn(params, _options);
      } else {
        serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
      }
      if (serializedParams) {
        const hashmarkIndex = url2.indexOf("#");
        if (hashmarkIndex !== -1) {
          url2 = url2.slice(0, hashmarkIndex);
        }
        url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
      }
      return url2;
    }
    var InterceptorManager = class {
      constructor() {
        this.handlers = [];
      }
      /**
       * Add a new interceptor to the stack
       *
       * @param {Function} fulfilled The function to handle `then` for a `Promise`
       * @param {Function} rejected The function to handle `reject` for a `Promise`
       * @param {Object} options The options for the interceptor, synchronous and runWhen
       *
       * @return {Number} An ID used to remove interceptor later
       */
      use(fulfilled, rejected, options) {
        this.handlers.push({
          fulfilled,
          rejected,
          synchronous: options ? options.synchronous : false,
          runWhen: options ? options.runWhen : null
        });
        return this.handlers.length - 1;
      }
      /**
       * Remove an interceptor from the stack
       *
       * @param {Number} id The ID that was returned by `use`
       *
       * @returns {void}
       */
      eject(id) {
        if (this.handlers[id]) {
          this.handlers[id] = null;
        }
      }
      /**
       * Clear all interceptors from the stack
       *
       * @returns {void}
       */
      clear() {
        if (this.handlers) {
          this.handlers = [];
        }
      }
      /**
       * Iterate over all the registered interceptors
       *
       * This method is particularly useful for skipping over any
       * interceptors that may have become `null` calling `eject`.
       *
       * @param {Function} fn The function to call for each interceptor
       *
       * @returns {void}
       */
      forEach(fn) {
        utils$1.forEach(this.handlers, function forEachHandler(h3) {
          if (h3 !== null) {
            fn(h3);
          }
        });
      }
    };
    var InterceptorManager$1 = InterceptorManager;
    var transitionalDefaults = {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false,
      legacyInterceptorReqResOrdering: true
    };
    var URLSearchParams = url__default["default"].URLSearchParams;
    var ALPHA = "abcdefghijklmnopqrstuvwxyz";
    var DIGIT = "0123456789";
    var ALPHABET = {
      DIGIT,
      ALPHA,
      ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
    };
    var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
      let str = "";
      const { length } = alphabet;
      const randomValues = new Uint32Array(size);
      crypto__default["default"].randomFillSync(randomValues);
      for (let i3 = 0; i3 < size; i3++) {
        str += alphabet[randomValues[i3] % length];
      }
      return str;
    };
    var platform$1 = {
      isNode: true,
      classes: {
        URLSearchParams,
        FormData: FormData__default["default"],
        Blob: typeof Blob !== "undefined" && Blob || null
      },
      ALPHABET,
      generateString,
      protocols: ["http", "https", "file", "data"]
    };
    var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
    var _navigator = typeof navigator === "object" && navigator || void 0;
    var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
    var hasStandardBrowserWebWorkerEnv = (() => {
      return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
      self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
    })();
    var origin = hasBrowserEnv && window.location.href || "http://localhost";
    var utils = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      hasBrowserEnv,
      hasStandardBrowserWebWorkerEnv,
      hasStandardBrowserEnv,
      navigator: _navigator,
      origin
    });
    var platform2 = {
      ...utils,
      ...platform$1
    };
    function toURLEncodedForm(data, options) {
      return toFormData(data, new platform2.classes.URLSearchParams(), {
        visitor: function(value, key, path2, helpers) {
          if (platform2.isNode && utils$1.isBuffer(value)) {
            this.append(key, value.toString("base64"));
            return false;
          }
          return helpers.defaultVisitor.apply(this, arguments);
        },
        ...options
      });
    }
    function parsePropPath(name) {
      return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
        return match[0] === "[]" ? "" : match[1] || match[0];
      });
    }
    function arrayToObject(arr) {
      const obj = {};
      const keys = Object.keys(arr);
      let i3;
      const len = keys.length;
      let key;
      for (i3 = 0; i3 < len; i3++) {
        key = keys[i3];
        obj[key] = arr[key];
      }
      return obj;
    }
    function formDataToJSON(formData) {
      function buildPath(path2, value, target, index) {
        let name = path2[index++];
        if (name === "__proto__") return true;
        const isNumericKey = Number.isFinite(+name);
        const isLast = index >= path2.length;
        name = !name && utils$1.isArray(target) ? target.length : name;
        if (isLast) {
          if (utils$1.hasOwnProp(target, name)) {
            target[name] = [target[name], value];
          } else {
            target[name] = value;
          }
          return !isNumericKey;
        }
        if (!target[name] || !utils$1.isObject(target[name])) {
          target[name] = [];
        }
        const result = buildPath(path2, value, target[name], index);
        if (result && utils$1.isArray(target[name])) {
          target[name] = arrayToObject(target[name]);
        }
        return !isNumericKey;
      }
      if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
        const obj = {};
        utils$1.forEachEntry(formData, (name, value) => {
          buildPath(parsePropPath(name), value, obj, 0);
        });
        return obj;
      }
      return null;
    }
    function stringifySafely(rawValue, parser, encoder) {
      if (utils$1.isString(rawValue)) {
        try {
          (parser || JSON.parse)(rawValue);
          return utils$1.trim(rawValue);
        } catch (e3) {
          if (e3.name !== "SyntaxError") {
            throw e3;
          }
        }
      }
      return (encoder || JSON.stringify)(rawValue);
    }
    var defaults = {
      transitional: transitionalDefaults,
      adapter: ["xhr", "http", "fetch"],
      transformRequest: [
        function transformRequest(data, headers) {
          const contentType = headers.getContentType() || "";
          const hasJSONContentType = contentType.indexOf("application/json") > -1;
          const isObjectPayload = utils$1.isObject(data);
          if (isObjectPayload && utils$1.isHTMLForm(data)) {
            data = new FormData(data);
          }
          const isFormData2 = utils$1.isFormData(data);
          if (isFormData2) {
            return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
          }
          if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
            return data;
          }
          if (utils$1.isArrayBufferView(data)) {
            return data.buffer;
          }
          if (utils$1.isURLSearchParams(data)) {
            headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
            return data.toString();
          }
          let isFileList2;
          if (isObjectPayload) {
            if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
              return toURLEncodedForm(data, this.formSerializer).toString();
            }
            if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
              const _FormData = this.env && this.env.FormData;
              return toFormData(
                isFileList2 ? { "files[]": data } : data,
                _FormData && new _FormData(),
                this.formSerializer
              );
            }
          }
          if (isObjectPayload || hasJSONContentType) {
            headers.setContentType("application/json", false);
            return stringifySafely(data);
          }
          return data;
        }
      ],
      transformResponse: [
        function transformResponse(data) {
          const transitional = this.transitional || defaults.transitional;
          const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
          const JSONRequested = this.responseType === "json";
          if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
            return data;
          }
          if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
            const silentJSONParsing = transitional && transitional.silentJSONParsing;
            const strictJSONParsing = !silentJSONParsing && JSONRequested;
            try {
              return JSON.parse(data, this.parseReviver);
            } catch (e3) {
              if (strictJSONParsing) {
                if (e3.name === "SyntaxError") {
                  throw AxiosError$1.from(e3, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
                }
                throw e3;
              }
            }
          }
          return data;
        }
      ],
      /**
       * A timeout in milliseconds to abort a request. If set to 0 (default) a
       * timeout is not created.
       */
      timeout: 0,
      xsrfCookieName: "XSRF-TOKEN",
      xsrfHeaderName: "X-XSRF-TOKEN",
      maxContentLength: -1,
      maxBodyLength: -1,
      env: {
        FormData: platform2.classes.FormData,
        Blob: platform2.classes.Blob
      },
      validateStatus: function validateStatus(status) {
        return status >= 200 && status < 300;
      },
      headers: {
        common: {
          Accept: "application/json, text/plain, */*",
          "Content-Type": void 0
        }
      }
    };
    utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
      defaults.headers[method] = {};
    });
    var defaults$1 = defaults;
    var ignoreDuplicateOf = utils$1.toObjectSet([
      "age",
      "authorization",
      "content-length",
      "content-type",
      "etag",
      "expires",
      "from",
      "host",
      "if-modified-since",
      "if-unmodified-since",
      "last-modified",
      "location",
      "max-forwards",
      "proxy-authorization",
      "referer",
      "retry-after",
      "user-agent"
    ]);
    var parseHeaders = (rawHeaders) => {
      const parsed = {};
      let key;
      let val;
      let i3;
      rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
        i3 = line.indexOf(":");
        key = line.substring(0, i3).trim().toLowerCase();
        val = line.substring(i3 + 1).trim();
        if (!key || parsed[key] && ignoreDuplicateOf[key]) {
          return;
        }
        if (key === "set-cookie") {
          if (parsed[key]) {
            parsed[key].push(val);
          } else {
            parsed[key] = [val];
          }
        } else {
          parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
        }
      });
      return parsed;
    };
    var $internals = Symbol("internals");
    function normalizeHeader(header) {
      return header && String(header).trim().toLowerCase();
    }
    function normalizeValue(value) {
      if (value === false || value == null) {
        return value;
      }
      return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
    }
    function parseTokens(str) {
      const tokens = /* @__PURE__ */ Object.create(null);
      const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
      let match;
      while (match = tokensRE.exec(str)) {
        tokens[match[1]] = match[2];
      }
      return tokens;
    }
    var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
    function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
      if (utils$1.isFunction(filter)) {
        return filter.call(this, value, header);
      }
      if (isHeaderNameFilter) {
        value = header;
      }
      if (!utils$1.isString(value)) return;
      if (utils$1.isString(filter)) {
        return value.indexOf(filter) !== -1;
      }
      if (utils$1.isRegExp(filter)) {
        return filter.test(value);
      }
    }
    function formatHeader(header) {
      return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w5, char, str) => {
        return char.toUpperCase() + str;
      });
    }
    function buildAccessors(obj, header) {
      const accessorName = utils$1.toCamelCase(" " + header);
      ["get", "set", "has"].forEach((methodName) => {
        Object.defineProperty(obj, methodName + accessorName, {
          value: function(arg1, arg2, arg3) {
            return this[methodName].call(this, header, arg1, arg2, arg3);
          },
          configurable: true
        });
      });
    }
    var AxiosHeaders = class {
      constructor(headers) {
        headers && this.set(headers);
      }
      set(header, valueOrRewrite, rewrite) {
        const self2 = this;
        function setHeader(_value, _header, _rewrite) {
          const lHeader = normalizeHeader(_header);
          if (!lHeader) {
            throw new Error("header name must be a non-empty string");
          }
          const key = utils$1.findKey(self2, lHeader);
          if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
            self2[key || _header] = normalizeValue(_value);
          }
        }
        const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
        if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
          setHeaders(header, valueOrRewrite);
        } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
          setHeaders(parseHeaders(header), valueOrRewrite);
        } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
          let obj = {}, dest, key;
          for (const entry of header) {
            if (!utils$1.isArray(entry)) {
              throw TypeError("Object iterator must return a key-value pair");
            }
            obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
          }
          setHeaders(obj, valueOrRewrite);
        } else {
          header != null && setHeader(valueOrRewrite, header, rewrite);
        }
        return this;
      }
      get(header, parser) {
        header = normalizeHeader(header);
        if (header) {
          const key = utils$1.findKey(this, header);
          if (key) {
            const value = this[key];
            if (!parser) {
              return value;
            }
            if (parser === true) {
              return parseTokens(value);
            }
            if (utils$1.isFunction(parser)) {
              return parser.call(this, value, key);
            }
            if (utils$1.isRegExp(parser)) {
              return parser.exec(value);
            }
            throw new TypeError("parser must be boolean|regexp|function");
          }
        }
      }
      has(header, matcher) {
        header = normalizeHeader(header);
        if (header) {
          const key = utils$1.findKey(this, header);
          return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
        }
        return false;
      }
      delete(header, matcher) {
        const self2 = this;
        let deleted = false;
        function deleteHeader(_header) {
          _header = normalizeHeader(_header);
          if (_header) {
            const key = utils$1.findKey(self2, _header);
            if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
              delete self2[key];
              deleted = true;
            }
          }
        }
        if (utils$1.isArray(header)) {
          header.forEach(deleteHeader);
        } else {
          deleteHeader(header);
        }
        return deleted;
      }
      clear(matcher) {
        const keys = Object.keys(this);
        let i3 = keys.length;
        let deleted = false;
        while (i3--) {
          const key = keys[i3];
          if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
            delete this[key];
            deleted = true;
          }
        }
        return deleted;
      }
      normalize(format2) {
        const self2 = this;
        const headers = {};
        utils$1.forEach(this, (value, header) => {
          const key = utils$1.findKey(headers, header);
          if (key) {
            self2[key] = normalizeValue(value);
            delete self2[header];
            return;
          }
          const normalized = format2 ? formatHeader(header) : String(header).trim();
          if (normalized !== header) {
            delete self2[header];
          }
          self2[normalized] = normalizeValue(value);
          headers[normalized] = true;
        });
        return this;
      }
      concat(...targets) {
        return this.constructor.concat(this, ...targets);
      }
      toJSON(asStrings) {
        const obj = /* @__PURE__ */ Object.create(null);
        utils$1.forEach(this, (value, header) => {
          value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
        });
        return obj;
      }
      [Symbol.iterator]() {
        return Object.entries(this.toJSON())[Symbol.iterator]();
      }
      toString() {
        return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
      }
      getSetCookie() {
        return this.get("set-cookie") || [];
      }
      get [Symbol.toStringTag]() {
        return "AxiosHeaders";
      }
      static from(thing) {
        return thing instanceof this ? thing : new this(thing);
      }
      static concat(first, ...targets) {
        const computed = new this(first);
        targets.forEach((target) => computed.set(target));
        return computed;
      }
      static accessor(header) {
        const internals = this[$internals] = this[$internals] = {
          accessors: {}
        };
        const accessors = internals.accessors;
        const prototype2 = this.prototype;
        function defineAccessor(_header) {
          const lHeader = normalizeHeader(_header);
          if (!accessors[lHeader]) {
            buildAccessors(prototype2, _header);
            accessors[lHeader] = true;
          }
        }
        utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
        return this;
      }
    };
    AxiosHeaders.accessor([
      "Content-Type",
      "Content-Length",
      "Accept",
      "Accept-Encoding",
      "User-Agent",
      "Authorization"
    ]);
    utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
      let mapped = key[0].toUpperCase() + key.slice(1);
      return {
        get: () => value,
        set(headerValue) {
          this[mapped] = headerValue;
        }
      };
    });
    utils$1.freezeMethods(AxiosHeaders);
    var AxiosHeaders$1 = AxiosHeaders;
    function transformData(fns, response) {
      const config = this || defaults$1;
      const context = response || config;
      const headers = AxiosHeaders$1.from(context.headers);
      let data = context.data;
      utils$1.forEach(fns, function transform(fn) {
        data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
      });
      headers.normalize();
      return data;
    }
    function isCancel(value) {
      return !!(value && value.__CANCEL__);
    }
    var CanceledError = class extends AxiosError$1 {
      /**
       * A `CanceledError` is an object that is thrown when an operation is canceled.
       *
       * @param {string=} message The message.
       * @param {Object=} config The config.
       * @param {Object=} request The request.
       *
       * @returns {CanceledError} The created error.
       */
      constructor(message, config, request) {
        super(message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
        this.name = "CanceledError";
        this.__CANCEL__ = true;
      }
    };
    var CanceledError$1 = CanceledError;
    function settle(resolve4, reject, response) {
      const validateStatus = response.config.validateStatus;
      if (!response.status || !validateStatus || validateStatus(response.status)) {
        resolve4(response);
      } else {
        reject(
          new AxiosError$1(
            "Request failed with status code " + response.status,
            [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
            response.config,
            response.request,
            response
          )
        );
      }
    }
    function isAbsoluteURL(url2) {
      if (typeof url2 !== "string") {
        return false;
      }
      return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
    }
    function combineURLs(baseURL, relativeURL) {
      return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
    }
    function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
      let isRelativeUrl = !isAbsoluteURL(requestedURL);
      if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
        return combineURLs(baseURL, requestedURL);
      }
      return requestedURL;
    }
    var VERSION = "1.13.6";
    function parseProtocol(url2) {
      const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
      return match && match[1] || "";
    }
    var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
    function fromDataURI(uri, asBlob, options) {
      const _Blob = options && options.Blob || platform2.classes.Blob;
      const protocol = parseProtocol(uri);
      if (asBlob === void 0 && _Blob) {
        asBlob = true;
      }
      if (protocol === "data") {
        uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
        const match = DATA_URL_PATTERN.exec(uri);
        if (!match) {
          throw new AxiosError$1("Invalid URL", AxiosError$1.ERR_INVALID_URL);
        }
        const mime = match[1];
        const isBase64 = match[2];
        const body = match[3];
        const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
        if (asBlob) {
          if (!_Blob) {
            throw new AxiosError$1("Blob is not supported", AxiosError$1.ERR_NOT_SUPPORT);
          }
          return new _Blob([buffer], { type: mime });
        }
        return buffer;
      }
      throw new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_NOT_SUPPORT);
    }
    var kInternals = Symbol("internals");
    var AxiosTransformStream = class extends stream__default["default"].Transform {
      constructor(options) {
        options = utils$1.toFlatObject(
          options,
          {
            maxRate: 0,
            chunkSize: 64 * 1024,
            minChunkSize: 100,
            timeWindow: 500,
            ticksRate: 2,
            samplesCount: 15
          },
          null,
          (prop, source) => {
            return !utils$1.isUndefined(source[prop]);
          }
        );
        super({
          readableHighWaterMark: options.chunkSize
        });
        const internals = this[kInternals] = {
          timeWindow: options.timeWindow,
          chunkSize: options.chunkSize,
          maxRate: options.maxRate,
          minChunkSize: options.minChunkSize,
          bytesSeen: 0,
          isCaptured: false,
          notifiedBytesLoaded: 0,
          ts: Date.now(),
          bytes: 0,
          onReadCallback: null
        };
        this.on("newListener", (event) => {
          if (event === "progress") {
            if (!internals.isCaptured) {
              internals.isCaptured = true;
            }
          }
        });
      }
      _read(size) {
        const internals = this[kInternals];
        if (internals.onReadCallback) {
          internals.onReadCallback();
        }
        return super._read(size);
      }
      _transform(chunk, encoding, callback) {
        const internals = this[kInternals];
        const maxRate = internals.maxRate;
        const readableHighWaterMark = this.readableHighWaterMark;
        const timeWindow = internals.timeWindow;
        const divider = 1e3 / timeWindow;
        const bytesThreshold = maxRate / divider;
        const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
        const pushChunk = (_chunk, _callback) => {
          const bytes = Buffer.byteLength(_chunk);
          internals.bytesSeen += bytes;
          internals.bytes += bytes;
          internals.isCaptured && this.emit("progress", internals.bytesSeen);
          if (this.push(_chunk)) {
            process.nextTick(_callback);
          } else {
            internals.onReadCallback = () => {
              internals.onReadCallback = null;
              process.nextTick(_callback);
            };
          }
        };
        const transformChunk = (_chunk, _callback) => {
          const chunkSize = Buffer.byteLength(_chunk);
          let chunkRemainder = null;
          let maxChunkSize = readableHighWaterMark;
          let bytesLeft;
          let passed = 0;
          if (maxRate) {
            const now = Date.now();
            if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
              internals.ts = now;
              bytesLeft = bytesThreshold - internals.bytes;
              internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
              passed = 0;
            }
            bytesLeft = bytesThreshold - internals.bytes;
          }
          if (maxRate) {
            if (bytesLeft <= 0) {
              return setTimeout(() => {
                _callback(null, _chunk);
              }, timeWindow - passed);
            }
            if (bytesLeft < maxChunkSize) {
              maxChunkSize = bytesLeft;
            }
          }
          if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
            chunkRemainder = _chunk.subarray(maxChunkSize);
            _chunk = _chunk.subarray(0, maxChunkSize);
          }
          pushChunk(
            _chunk,
            chunkRemainder ? () => {
              process.nextTick(_callback, null, chunkRemainder);
            } : _callback
          );
        };
        transformChunk(chunk, function transformNextChunk(err, _chunk) {
          if (err) {
            return callback(err);
          }
          if (_chunk) {
            transformChunk(_chunk, transformNextChunk);
          } else {
            callback(null);
          }
        });
      }
    };
    var AxiosTransformStream$1 = AxiosTransformStream;
    var { asyncIterator } = Symbol;
    var readBlob = async function* (blob) {
      if (blob.stream) {
        yield* blob.stream();
      } else if (blob.arrayBuffer) {
        yield await blob.arrayBuffer();
      } else if (blob[asyncIterator]) {
        yield* blob[asyncIterator]();
      } else {
        yield blob;
      }
    };
    var readBlob$1 = readBlob;
    var BOUNDARY_ALPHABET = platform2.ALPHABET.ALPHA_DIGIT + "-_";
    var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder();
    var CRLF = "\r\n";
    var CRLF_BYTES = textEncoder.encode(CRLF);
    var CRLF_BYTES_COUNT = 2;
    var FormDataPart = class {
      constructor(name, value) {
        const { escapeName } = this.constructor;
        const isStringValue = utils$1.isString(value);
        let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
        if (isStringValue) {
          value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
        } else {
          headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
        }
        this.headers = textEncoder.encode(headers + CRLF);
        this.contentLength = isStringValue ? value.byteLength : value.size;
        this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
        this.name = name;
        this.value = value;
      }
      async *encode() {
        yield this.headers;
        const { value } = this;
        if (utils$1.isTypedArray(value)) {
          yield value;
        } else {
          yield* readBlob$1(value);
        }
        yield CRLF_BYTES;
      }
      static escapeName(name) {
        return String(name).replace(
          /[\r\n"]/g,
          (match) => ({
            "\r": "%0D",
            "\n": "%0A",
            '"': "%22"
          })[match]
        );
      }
    };
    var formDataToStream = (form, headersHandler, options) => {
      const {
        tag = "form-data-boundary",
        size = 25,
        boundary = tag + "-" + platform2.generateString(size, BOUNDARY_ALPHABET)
      } = options || {};
      if (!utils$1.isFormData(form)) {
        throw TypeError("FormData instance required");
      }
      if (boundary.length < 1 || boundary.length > 70) {
        throw Error("boundary must be 10-70 characters long");
      }
      const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
      const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
      let contentLength = footerBytes.byteLength;
      const parts = Array.from(form.entries()).map(([name, value]) => {
        const part = new FormDataPart(name, value);
        contentLength += part.size;
        return part;
      });
      contentLength += boundaryBytes.byteLength * parts.length;
      contentLength = utils$1.toFiniteNumber(contentLength);
      const computedHeaders = {
        "Content-Type": `multipart/form-data; boundary=${boundary}`
      };
      if (Number.isFinite(contentLength)) {
        computedHeaders["Content-Length"] = contentLength;
      }
      headersHandler && headersHandler(computedHeaders);
      return stream.Readable.from(
        async function* () {
          for (const part of parts) {
            yield boundaryBytes;
            yield* part.encode();
          }
          yield footerBytes;
        }()
      );
    };
    var formDataToStream$1 = formDataToStream;
    var ZlibHeaderTransformStream = class extends stream__default["default"].Transform {
      __transform(chunk, encoding, callback) {
        this.push(chunk);
        callback();
      }
      _transform(chunk, encoding, callback) {
        if (chunk.length !== 0) {
          this._transform = this.__transform;
          if (chunk[0] !== 120) {
            const header = Buffer.alloc(2);
            header[0] = 120;
            header[1] = 156;
            this.push(header, encoding);
          }
        }
        this.__transform(chunk, encoding, callback);
      }
    };
    var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
    var callbackify = (fn, reducer) => {
      return utils$1.isAsyncFn(fn) ? function(...args) {
        const cb = args.pop();
        fn.apply(this, args).then((value) => {
          try {
            reducer ? cb(null, ...reducer(value)) : cb(null, value);
          } catch (err) {
            cb(err);
          }
        }, cb);
      } : fn;
    };
    var callbackify$1 = callbackify;
    function speedometer(samplesCount, min) {
      samplesCount = samplesCount || 10;
      const bytes = new Array(samplesCount);
      const timestamps = new Array(samplesCount);
      let head = 0;
      let tail = 0;
      let firstSampleTS;
      min = min !== void 0 ? min : 1e3;
      return function push(chunkLength) {
        const now = Date.now();
        const startedAt = timestamps[tail];
        if (!firstSampleTS) {
          firstSampleTS = now;
        }
        bytes[head] = chunkLength;
        timestamps[head] = now;
        let i3 = tail;
        let bytesCount = 0;
        while (i3 !== head) {
          bytesCount += bytes[i3++];
          i3 = i3 % samplesCount;
        }
        head = (head + 1) % samplesCount;
        if (head === tail) {
          tail = (tail + 1) % samplesCount;
        }
        if (now - firstSampleTS < min) {
          return;
        }
        const passed = startedAt && now - startedAt;
        return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
      };
    }
    function throttle(fn, freq) {
      let timestamp = 0;
      let threshold = 1e3 / freq;
      let lastArgs;
      let timer;
      const invoke = (args, now = Date.now()) => {
        timestamp = now;
        lastArgs = null;
        if (timer) {
          clearTimeout(timer);
          timer = null;
        }
        fn(...args);
      };
      const throttled = (...args) => {
        const now = Date.now();
        const passed = now - timestamp;
        if (passed >= threshold) {
          invoke(args, now);
        } else {
          lastArgs = args;
          if (!timer) {
            timer = setTimeout(() => {
              timer = null;
              invoke(lastArgs);
            }, threshold - passed);
          }
        }
      };
      const flush = () => lastArgs && invoke(lastArgs);
      return [throttled, flush];
    }
    var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
      let bytesNotified = 0;
      const _speedometer = speedometer(50, 250);
      return throttle((e3) => {
        const loaded = e3.loaded;
        const total = e3.lengthComputable ? e3.total : void 0;
        const progressBytes = loaded - bytesNotified;
        const rate = _speedometer(progressBytes);
        const inRange = loaded <= total;
        bytesNotified = loaded;
        const data = {
          loaded,
          total,
          progress: total ? loaded / total : void 0,
          bytes: progressBytes,
          rate: rate ? rate : void 0,
          estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
          event: e3,
          lengthComputable: total != null,
          [isDownloadStream ? "download" : "upload"]: true
        };
        listener(data);
      }, freq);
    };
    var progressEventDecorator = (total, throttled) => {
      const lengthComputable = total != null;
      return [
        (loaded) => throttled[0]({
          lengthComputable,
          total,
          loaded
        }),
        throttled[1]
      ];
    };
    var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
    function estimateDataURLDecodedBytes(url2) {
      if (!url2 || typeof url2 !== "string") return 0;
      if (!url2.startsWith("data:")) return 0;
      const comma = url2.indexOf(",");
      if (comma < 0) return 0;
      const meta = url2.slice(5, comma);
      const body = url2.slice(comma + 1);
      const isBase64 = /;base64/i.test(meta);
      if (isBase64) {
        let effectiveLen = body.length;
        const len = body.length;
        for (let i3 = 0; i3 < len; i3++) {
          if (body.charCodeAt(i3) === 37 && i3 + 2 < len) {
            const a = body.charCodeAt(i3 + 1);
            const b3 = body.charCodeAt(i3 + 2);
            const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b3 >= 48 && b3 <= 57 || b3 >= 65 && b3 <= 70 || b3 >= 97 && b3 <= 102);
            if (isHex) {
              effectiveLen -= 2;
              i3 += 2;
            }
          }
        }
        let pad2 = 0;
        let idx = len - 1;
        const tailIsPct3D = (j3) => j3 >= 2 && body.charCodeAt(j3 - 2) === 37 && // '%'
        body.charCodeAt(j3 - 1) === 51 && // '3'
        (body.charCodeAt(j3) === 68 || body.charCodeAt(j3) === 100);
        if (idx >= 0) {
          if (body.charCodeAt(idx) === 61) {
            pad2++;
            idx--;
          } else if (tailIsPct3D(idx)) {
            pad2++;
            idx -= 3;
          }
        }
        if (pad2 === 1 && idx >= 0) {
          if (body.charCodeAt(idx) === 61) {
            pad2++;
          } else if (tailIsPct3D(idx)) {
            pad2++;
          }
        }
        const groups = Math.floor(effectiveLen / 4);
        const bytes = groups * 3 - (pad2 || 0);
        return bytes > 0 ? bytes : 0;
      }
      return Buffer.byteLength(body, "utf8");
    }
    var zlibOptions = {
      flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
      finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
    };
    var brotliOptions = {
      flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
      finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
    };
    var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
    var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"];
    var isHttps = /https:?/;
    var supportedProtocols = platform2.protocols.map((protocol) => {
      return protocol + ":";
    });
    var flushOnFinish = (stream2, [throttled, flush]) => {
      stream2.on("end", flush).on("error", flush);
      return throttled;
    };
    var Http2Sessions = class {
      constructor() {
        this.sessions = /* @__PURE__ */ Object.create(null);
      }
      getSession(authority, options) {
        options = Object.assign(
          {
            sessionTimeout: 1e3
          },
          options
        );
        let authoritySessions = this.sessions[authority];
        if (authoritySessions) {
          let len = authoritySessions.length;
          for (let i3 = 0; i3 < len; i3++) {
            const [sessionHandle, sessionOptions] = authoritySessions[i3];
            if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) {
              return sessionHandle;
            }
          }
        }
        const session = http2__default["default"].connect(authority, options);
        let removed;
        const removeSession = () => {
          if (removed) {
            return;
          }
          removed = true;
          let entries = authoritySessions, len = entries.length, i3 = len;
          while (i3--) {
            if (entries[i3][0] === session) {
              if (len === 1) {
                delete this.sessions[authority];
              } else {
                entries.splice(i3, 1);
              }
              return;
            }
          }
        };
        const originalRequestFn = session.request;
        const { sessionTimeout } = options;
        if (sessionTimeout != null) {
          let timer;
          let streamsCount = 0;
          session.request = function() {
            const stream2 = originalRequestFn.apply(this, arguments);
            streamsCount++;
            if (timer) {
              clearTimeout(timer);
              timer = null;
            }
            stream2.once("close", () => {
              if (!--streamsCount) {
                timer = setTimeout(() => {
                  timer = null;
                  removeSession();
                }, sessionTimeout);
              }
            });
            return stream2;
          };
        }
        session.once("close", removeSession);
        let entry = [session, options];
        authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
        return session;
      }
    };
    var http2Sessions = new Http2Sessions();
    function dispatchBeforeRedirect(options, responseDetails) {
      if (options.beforeRedirects.proxy) {
        options.beforeRedirects.proxy(options);
      }
      if (options.beforeRedirects.config) {
        options.beforeRedirects.config(options, responseDetails);
      }
    }
    function setProxy(options, configProxy, location) {
      let proxy = configProxy;
      if (!proxy && proxy !== false) {
        const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
        if (proxyUrl) {
          proxy = new URL(proxyUrl);
        }
      }
      if (proxy) {
        if (proxy.username) {
          proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
        }
        if (proxy.auth) {
          const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
          if (validProxyAuth) {
            proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
          } else if (typeof proxy.auth === "object") {
            throw new AxiosError$1("Invalid proxy authorization", AxiosError$1.ERR_BAD_OPTION, { proxy });
          }
          const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
          options.headers["Proxy-Authorization"] = "Basic " + base64;
        }
        options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
        const proxyHost = proxy.hostname || proxy.host;
        options.hostname = proxyHost;
        options.host = proxyHost;
        options.port = proxy.port;
        options.path = location;
        if (proxy.protocol) {
          options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
        }
      }
      options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
        setProxy(redirectOptions, configProxy, redirectOptions.href);
      };
    }
    var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
    var wrapAsync = (asyncExecutor) => {
      return new Promise((resolve4, reject) => {
        let onDone;
        let isDone;
        const done = (value, isRejected) => {
          if (isDone) return;
          isDone = true;
          onDone && onDone(value, isRejected);
        };
        const _resolve = (value) => {
          done(value);
          resolve4(value);
        };
        const _reject = (reason) => {
          done(reason, true);
          reject(reason);
        };
        asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
      });
    };
    var resolveFamily = ({ address, family }) => {
      if (!utils$1.isString(address)) {
        throw TypeError("address must be a string");
      }
      return {
        address,
        family: family || (address.indexOf(".") < 0 ? 6 : 4)
      };
    };
    var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family });
    var http2Transport = {
      request(options, cb) {
        const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
        const { http2Options, headers } = options;
        const session = http2Sessions.getSession(authority, http2Options);
        const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = http2__default["default"].constants;
        const http2Headers = {
          [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
          [HTTP2_HEADER_METHOD]: options.method,
          [HTTP2_HEADER_PATH]: options.path
        };
        utils$1.forEach(headers, (header, name) => {
          name.charAt(0) !== ":" && (http2Headers[name] = header);
        });
        const req = session.request(http2Headers);
        req.once("response", (responseHeaders) => {
          const response = req;
          responseHeaders = Object.assign({}, responseHeaders);
          const status = responseHeaders[HTTP2_HEADER_STATUS];
          delete responseHeaders[HTTP2_HEADER_STATUS];
          response.headers = responseHeaders;
          response.statusCode = +status;
          cb(response);
        });
        return req;
      }
    };
    var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) {
      return wrapAsync(async function dispatchHttpRequest(resolve4, reject, onDone) {
        let { data, lookup, family, httpVersion = 1, http2Options } = config;
        const { responseType, responseEncoding } = config;
        const method = config.method.toUpperCase();
        let isDone;
        let rejected = false;
        let req;
        httpVersion = +httpVersion;
        if (Number.isNaN(httpVersion)) {
          throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
        }
        if (httpVersion !== 1 && httpVersion !== 2) {
          throw TypeError(`Unsupported protocol version '${httpVersion}'`);
        }
        const isHttp2 = httpVersion === 2;
        if (lookup) {
          const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
          lookup = (hostname, opt, cb) => {
            _lookup(hostname, opt, (err, arg0, arg1) => {
              if (err) {
                return cb(err);
              }
              const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
              opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
            });
          };
        }
        const abortEmitter = new events.EventEmitter();
        function abort(reason) {
          try {
            abortEmitter.emit(
              "abort",
              !reason || reason.type ? new CanceledError$1(null, config, req) : reason
            );
          } catch (err) {
            console.warn("emit error", err);
          }
        }
        abortEmitter.once("abort", reject);
        const onFinished = () => {
          if (config.cancelToken) {
            config.cancelToken.unsubscribe(abort);
          }
          if (config.signal) {
            config.signal.removeEventListener("abort", abort);
          }
          abortEmitter.removeAllListeners();
        };
        if (config.cancelToken || config.signal) {
          config.cancelToken && config.cancelToken.subscribe(abort);
          if (config.signal) {
            config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
          }
        }
        onDone((response, isRejected) => {
          isDone = true;
          if (isRejected) {
            rejected = true;
            onFinished();
            return;
          }
          const { data: data2 } = response;
          if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) {
            const offListeners = stream__default["default"].finished(data2, () => {
              offListeners();
              onFinished();
            });
          } else {
            onFinished();
          }
        });
        const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
        const parsed = new URL(fullPath, platform2.hasBrowserEnv ? platform2.origin : void 0);
        const protocol = parsed.protocol || supportedProtocols[0];
        if (protocol === "data:") {
          if (config.maxContentLength > -1) {
            const dataUrl = String(config.url || fullPath || "");
            const estimated = estimateDataURLDecodedBytes(dataUrl);
            if (estimated > config.maxContentLength) {
              return reject(
                new AxiosError$1(
                  "maxContentLength size of " + config.maxContentLength + " exceeded",
                  AxiosError$1.ERR_BAD_RESPONSE,
                  config
                )
              );
            }
          }
          let convertedData;
          if (method !== "GET") {
            return settle(resolve4, reject, {
              status: 405,
              statusText: "method not allowed",
              headers: {},
              config
            });
          }
          try {
            convertedData = fromDataURI(config.url, responseType === "blob", {
              Blob: config.env && config.env.Blob
            });
          } catch (err) {
            throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
          }
          if (responseType === "text") {
            convertedData = convertedData.toString(responseEncoding);
            if (!responseEncoding || responseEncoding === "utf8") {
              convertedData = utils$1.stripBOM(convertedData);
            }
          } else if (responseType === "stream") {
            convertedData = stream__default["default"].Readable.from(convertedData);
          }
          return settle(resolve4, reject, {
            data: convertedData,
            status: 200,
            statusText: "OK",
            headers: new AxiosHeaders$1(),
            config
          });
        }
        if (supportedProtocols.indexOf(protocol) === -1) {
          return reject(
            new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_BAD_REQUEST, config)
          );
        }
        const headers = AxiosHeaders$1.from(config.headers).normalize();
        headers.set("User-Agent", "axios/" + VERSION, false);
        const { onUploadProgress, onDownloadProgress } = config;
        const maxRate = config.maxRate;
        let maxUploadRate = void 0;
        let maxDownloadRate = void 0;
        if (utils$1.isSpecCompliantForm(data)) {
          const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
          data = formDataToStream$1(
            data,
            (formHeaders) => {
              headers.set(formHeaders);
            },
            {
              tag: `axios-${VERSION}-boundary`,
              boundary: userBoundary && userBoundary[1] || void 0
            }
          );
        } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
          headers.set(data.getHeaders());
          if (!headers.hasContentLength()) {
            try {
              const knownLength = await util__default["default"].promisify(data.getLength).call(data);
              Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
            } catch (e3) {
            }
          }
        } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
          data.size && headers.setContentType(data.type || "application/octet-stream");
          headers.setContentLength(data.size || 0);
          data = stream__default["default"].Readable.from(readBlob$1(data));
        } else if (data && !utils$1.isStream(data)) {
          if (Buffer.isBuffer(data)) ;
          else if (utils$1.isArrayBuffer(data)) {
            data = Buffer.from(new Uint8Array(data));
          } else if (utils$1.isString(data)) {
            data = Buffer.from(data, "utf-8");
          } else {
            return reject(
              new AxiosError$1(
                "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
                AxiosError$1.ERR_BAD_REQUEST,
                config
              )
            );
          }
          headers.setContentLength(data.length, false);
          if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
            return reject(
              new AxiosError$1(
                "Request body larger than maxBodyLength limit",
                AxiosError$1.ERR_BAD_REQUEST,
                config
              )
            );
          }
        }
        const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
        if (utils$1.isArray(maxRate)) {
          maxUploadRate = maxRate[0];
          maxDownloadRate = maxRate[1];
        } else {
          maxUploadRate = maxDownloadRate = maxRate;
        }
        if (data && (onUploadProgress || maxUploadRate)) {
          if (!utils$1.isStream(data)) {
            data = stream__default["default"].Readable.from(data, { objectMode: false });
          }
          data = stream__default["default"].pipeline(
            [
              data,
              new AxiosTransformStream$1({
                maxRate: utils$1.toFiniteNumber(maxUploadRate)
              })
            ],
            utils$1.noop
          );
          onUploadProgress && data.on(
            "progress",
            flushOnFinish(
              data,
              progressEventDecorator(
                contentLength,
                progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
              )
            )
          );
        }
        let auth = void 0;
        if (config.auth) {
          const username = config.auth.username || "";
          const password = config.auth.password || "";
          auth = username + ":" + password;
        }
        if (!auth && parsed.username) {
          const urlUsername = parsed.username;
          const urlPassword = parsed.password;
          auth = urlUsername + ":" + urlPassword;
        }
        auth && headers.delete("authorization");
        let path2;
        try {
          path2 = buildURL(
            parsed.pathname + parsed.search,
            config.params,
            config.paramsSerializer
          ).replace(/^\?/, "");
        } catch (err) {
          const customErr = new Error(err.message);
          customErr.config = config;
          customErr.url = config.url;
          customErr.exists = true;
          return reject(customErr);
        }
        headers.set(
          "Accept-Encoding",
          "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""),
          false
        );
        const options = {
          path: path2,
          method,
          headers: headers.toJSON(),
          agents: { http: config.httpAgent, https: config.httpsAgent },
          auth,
          protocol,
          family,
          beforeRedirect: dispatchBeforeRedirect,
          beforeRedirects: {},
          http2Options
        };
        !utils$1.isUndefined(lookup) && (options.lookup = lookup);
        if (config.socketPath) {
          options.socketPath = config.socketPath;
        } else {
          options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
          options.port = parsed.port;
          setProxy(
            options,
            config.proxy,
            protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path
          );
        }
        let transport;
        const isHttpsRequest = isHttps.test(options.protocol);
        options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
        if (isHttp2) {
          transport = http2Transport;
        } else {
          if (config.transport) {
            transport = config.transport;
          } else if (config.maxRedirects === 0) {
            transport = isHttpsRequest ? https__default["default"] : http__default["default"];
          } else {
            if (config.maxRedirects) {
              options.maxRedirects = config.maxRedirects;
            }
            if (config.beforeRedirect) {
              options.beforeRedirects.config = config.beforeRedirect;
            }
            transport = isHttpsRequest ? httpsFollow : httpFollow;
          }
        }
        if (config.maxBodyLength > -1) {
          options.maxBodyLength = config.maxBodyLength;
        } else {
          options.maxBodyLength = Infinity;
        }
        if (config.insecureHTTPParser) {
          options.insecureHTTPParser = config.insecureHTTPParser;
        }
        req = transport.request(options, function handleResponse(res) {
          if (req.destroyed) return;
          const streams = [res];
          const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
          if (onDownloadProgress || maxDownloadRate) {
            const transformStream = new AxiosTransformStream$1({
              maxRate: utils$1.toFiniteNumber(maxDownloadRate)
            });
            onDownloadProgress && transformStream.on(
              "progress",
              flushOnFinish(
                transformStream,
                progressEventDecorator(
                  responseLength,
                  progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
                )
              )
            );
            streams.push(transformStream);
          }
          let responseStream = res;
          const lastRequest = res.req || req;
          if (config.decompress !== false && res.headers["content-encoding"]) {
            if (method === "HEAD" || res.statusCode === 204) {
              delete res.headers["content-encoding"];
            }
            switch ((res.headers["content-encoding"] || "").toLowerCase()) {
              /*eslint default-case:0*/
              case "gzip":
              case "x-gzip":
              case "compress":
              case "x-compress":
                streams.push(zlib__default["default"].createUnzip(zlibOptions));
                delete res.headers["content-encoding"];
                break;
              case "deflate":
                streams.push(new ZlibHeaderTransformStream$1());
                streams.push(zlib__default["default"].createUnzip(zlibOptions));
                delete res.headers["content-encoding"];
                break;
              case "br":
                if (isBrotliSupported) {
                  streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
                  delete res.headers["content-encoding"];
                }
            }
          }
          responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
          const response = {
            status: res.statusCode,
            statusText: res.statusMessage,
            headers: new AxiosHeaders$1(res.headers),
            config,
            request: lastRequest
          };
          if (responseType === "stream") {
            response.data = responseStream;
            settle(resolve4, reject, response);
          } else {
            const responseBuffer = [];
            let totalResponseBytes = 0;
            responseStream.on("data", function handleStreamData(chunk) {
              responseBuffer.push(chunk);
              totalResponseBytes += chunk.length;
              if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
                rejected = true;
                responseStream.destroy();
                abort(
                  new AxiosError$1(
                    "maxContentLength size of " + config.maxContentLength + " exceeded",
                    AxiosError$1.ERR_BAD_RESPONSE,
                    config,
                    lastRequest
                  )
                );
              }
            });
            responseStream.on("aborted", function handlerStreamAborted() {
              if (rejected) {
                return;
              }
              const err = new AxiosError$1(
                "stream has been aborted",
                AxiosError$1.ERR_BAD_RESPONSE,
                config,
                lastRequest
              );
              responseStream.destroy(err);
              reject(err);
            });
            responseStream.on("error", function handleStreamError(err) {
              if (req.destroyed) return;
              reject(AxiosError$1.from(err, null, config, lastRequest));
            });
            responseStream.on("end", function handleStreamEnd() {
              try {
                let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
                if (responseType !== "arraybuffer") {
                  responseData = responseData.toString(responseEncoding);
                  if (!responseEncoding || responseEncoding === "utf8") {
                    responseData = utils$1.stripBOM(responseData);
                  }
                }
                response.data = responseData;
              } catch (err) {
                return reject(AxiosError$1.from(err, null, config, response.request, response));
              }
              settle(resolve4, reject, response);
            });
          }
          abortEmitter.once("abort", (err) => {
            if (!responseStream.destroyed) {
              responseStream.emit("error", err);
              responseStream.destroy();
            }
          });
        });
        abortEmitter.once("abort", (err) => {
          if (req.close) {
            req.close();
          } else {
            req.destroy(err);
          }
        });
        req.on("error", function handleRequestError(err) {
          reject(AxiosError$1.from(err, null, config, req));
        });
        req.on("socket", function handleRequestSocket(socket) {
          socket.setKeepAlive(true, 1e3 * 60);
        });
        if (config.timeout) {
          const timeout = parseInt(config.timeout, 10);
          if (Number.isNaN(timeout)) {
            abort(
              new AxiosError$1(
                "error trying to parse `config.timeout` to int",
                AxiosError$1.ERR_BAD_OPTION_VALUE,
                config,
                req
              )
            );
            return;
          }
          req.setTimeout(timeout, function handleRequestTimeout() {
            if (isDone) return;
            let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
            const transitional = config.transitional || transitionalDefaults;
            if (config.timeoutErrorMessage) {
              timeoutErrorMessage = config.timeoutErrorMessage;
            }
            abort(
              new AxiosError$1(
                timeoutErrorMessage,
                transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
                config,
                req
              )
            );
          });
        } else {
          req.setTimeout(0);
        }
        if (utils$1.isStream(data)) {
          let ended = false;
          let errored = false;
          data.on("end", () => {
            ended = true;
          });
          data.once("error", (err) => {
            errored = true;
            req.destroy(err);
          });
          data.on("close", () => {
            if (!ended && !errored) {
              abort(new CanceledError$1("Request stream has been aborted", config, req));
            }
          });
          data.pipe(req);
        } else {
          data && req.write(data);
          req.end();
        }
      });
    };
    var isURLSameOrigin = platform2.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
      url2 = new URL(url2, platform2.origin);
      return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
    })(
      new URL(platform2.origin),
      platform2.navigator && /(msie|trident)/i.test(platform2.navigator.userAgent)
    ) : () => true;
    var cookies = platform2.hasStandardBrowserEnv ? (
      // Standard browser envs support document.cookie
      {
        write(name, value, expires, path2, domain, secure, sameSite) {
          if (typeof document === "undefined") return;
          const cookie = [`${name}=${encodeURIComponent(value)}`];
          if (utils$1.isNumber(expires)) {
            cookie.push(`expires=${new Date(expires).toUTCString()}`);
          }
          if (utils$1.isString(path2)) {
            cookie.push(`path=${path2}`);
          }
          if (utils$1.isString(domain)) {
            cookie.push(`domain=${domain}`);
          }
          if (secure === true) {
            cookie.push("secure");
          }
          if (utils$1.isString(sameSite)) {
            cookie.push(`SameSite=${sameSite}`);
          }
          document.cookie = cookie.join("; ");
        },
        read(name) {
          if (typeof document === "undefined") return null;
          const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
          return match ? decodeURIComponent(match[1]) : null;
        },
        remove(name) {
          this.write(name, "", Date.now() - 864e5, "/");
        }
      }
    ) : (
      // Non-standard browser env (web workers, react-native) lack needed support.
      {
        write() {
        },
        read() {
          return null;
        },
        remove() {
        }
      }
    );
    var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
    function mergeConfig(config1, config2) {
      config2 = config2 || {};
      const config = {};
      function getMergedValue(target, source, prop, caseless) {
        if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
          return utils$1.merge.call({ caseless }, target, source);
        } else if (utils$1.isPlainObject(source)) {
          return utils$1.merge({}, source);
        } else if (utils$1.isArray(source)) {
          return source.slice();
        }
        return source;
      }
      function mergeDeepProperties(a, b3, prop, caseless) {
        if (!utils$1.isUndefined(b3)) {
          return getMergedValue(a, b3, prop, caseless);
        } else if (!utils$1.isUndefined(a)) {
          return getMergedValue(void 0, a, prop, caseless);
        }
      }
      function valueFromConfig2(a, b3) {
        if (!utils$1.isUndefined(b3)) {
          return getMergedValue(void 0, b3);
        }
      }
      function defaultToConfig2(a, b3) {
        if (!utils$1.isUndefined(b3)) {
          return getMergedValue(void 0, b3);
        } else if (!utils$1.isUndefined(a)) {
          return getMergedValue(void 0, a);
        }
      }
      function mergeDirectKeys(a, b3, prop) {
        if (prop in config2) {
          return getMergedValue(a, b3);
        } else if (prop in config1) {
          return getMergedValue(void 0, a);
        }
      }
      const mergeMap = {
        url: valueFromConfig2,
        method: valueFromConfig2,
        data: valueFromConfig2,
        baseURL: defaultToConfig2,
        transformRequest: defaultToConfig2,
        transformResponse: defaultToConfig2,
        paramsSerializer: defaultToConfig2,
        timeout: defaultToConfig2,
        timeoutMessage: defaultToConfig2,
        withCredentials: defaultToConfig2,
        withXSRFToken: defaultToConfig2,
        adapter: defaultToConfig2,
        responseType: defaultToConfig2,
        xsrfCookieName: defaultToConfig2,
        xsrfHeaderName: defaultToConfig2,
        onUploadProgress: defaultToConfig2,
        onDownloadProgress: defaultToConfig2,
        decompress: defaultToConfig2,
        maxContentLength: defaultToConfig2,
        maxBodyLength: defaultToConfig2,
        beforeRedirect: defaultToConfig2,
        transport: defaultToConfig2,
        httpAgent: defaultToConfig2,
        httpsAgent: defaultToConfig2,
        cancelToken: defaultToConfig2,
        socketPath: defaultToConfig2,
        responseEncoding: defaultToConfig2,
        validateStatus: mergeDirectKeys,
        headers: (a, b3, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b3), prop, true)
      };
      utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
        if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
        const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
        const configValue = merge2(config1[prop], config2[prop], prop);
        utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
      });
      return config;
    }
    var resolveConfig = (config) => {
      const newConfig = mergeConfig({}, config);
      let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
      newConfig.headers = headers = AxiosHeaders$1.from(headers);
      newConfig.url = buildURL(
        buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
        config.params,
        config.paramsSerializer
      );
      if (auth) {
        headers.set(
          "Authorization",
          "Basic " + btoa(
            (auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
          )
        );
      }
      if (utils$1.isFormData(data)) {
        if (platform2.hasStandardBrowserEnv || platform2.hasStandardBrowserWebWorkerEnv) {
          headers.setContentType(void 0);
        } else if (utils$1.isFunction(data.getHeaders)) {
          const formHeaders = data.getHeaders();
          const allowedHeaders = ["content-type", "content-length"];
          Object.entries(formHeaders).forEach(([key, val]) => {
            if (allowedHeaders.includes(key.toLowerCase())) {
              headers.set(key, val);
            }
          });
        }
      }
      if (platform2.hasStandardBrowserEnv) {
        withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
        if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
          const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
          if (xsrfValue) {
            headers.set(xsrfHeaderName, xsrfValue);
          }
        }
      }
      return newConfig;
    };
    var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
    var xhrAdapter = isXHRAdapterSupported && function(config) {
      return new Promise(function dispatchXhrRequest(resolve4, reject) {
        const _config = resolveConfig(config);
        let requestData = _config.data;
        const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
        let { responseType, onUploadProgress, onDownloadProgress } = _config;
        let onCanceled;
        let uploadThrottled, downloadThrottled;
        let flushUpload, flushDownload;
        function done() {
          flushUpload && flushUpload();
          flushDownload && flushDownload();
          _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
          _config.signal && _config.signal.removeEventListener("abort", onCanceled);
        }
        let request = new XMLHttpRequest();
        request.open(_config.method.toUpperCase(), _config.url, true);
        request.timeout = _config.timeout;
        function onloadend() {
          if (!request) {
            return;
          }
          const responseHeaders = AxiosHeaders$1.from(
            "getAllResponseHeaders" in request && request.getAllResponseHeaders()
          );
          const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
          const response = {
            data: responseData,
            status: request.status,
            statusText: request.statusText,
            headers: responseHeaders,
            config,
            request
          };
          settle(
            function _resolve(value) {
              resolve4(value);
              done();
            },
            function _reject(err) {
              reject(err);
              done();
            },
            response
          );
          request = null;
        }
        if ("onloadend" in request) {
          request.onloadend = onloadend;
        } else {
          request.onreadystatechange = function handleLoad() {
            if (!request || request.readyState !== 4) {
              return;
            }
            if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
              return;
            }
            setTimeout(onloadend);
          };
        }
        request.onabort = function handleAbort() {
          if (!request) {
            return;
          }
          reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
          request = null;
        };
        request.onerror = function handleError(event) {
          const msg = event && event.message ? event.message : "Network Error";
          const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
          err.event = event || null;
          reject(err);
          request = null;
        };
        request.ontimeout = function handleTimeout() {
          let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
          const transitional = _config.transitional || transitionalDefaults;
          if (_config.timeoutErrorMessage) {
            timeoutErrorMessage = _config.timeoutErrorMessage;
          }
          reject(
            new AxiosError$1(
              timeoutErrorMessage,
              transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
              config,
              request
            )
          );
          request = null;
        };
        requestData === void 0 && requestHeaders.setContentType(null);
        if ("setRequestHeader" in request) {
          utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
            request.setRequestHeader(key, val);
          });
        }
        if (!utils$1.isUndefined(_config.withCredentials)) {
          request.withCredentials = !!_config.withCredentials;
        }
        if (responseType && responseType !== "json") {
          request.responseType = _config.responseType;
        }
        if (onDownloadProgress) {
          [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
          request.addEventListener("progress", downloadThrottled);
        }
        if (onUploadProgress && request.upload) {
          [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
          request.upload.addEventListener("progress", uploadThrottled);
          request.upload.addEventListener("loadend", flushUpload);
        }
        if (_config.cancelToken || _config.signal) {
          onCanceled = (cancel) => {
            if (!request) {
              return;
            }
            reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
            request.abort();
            request = null;
          };
          _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
          if (_config.signal) {
            _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
          }
        }
        const protocol = parseProtocol(_config.url);
        if (protocol && platform2.protocols.indexOf(protocol) === -1) {
          reject(
            new AxiosError$1(
              "Unsupported protocol " + protocol + ":",
              AxiosError$1.ERR_BAD_REQUEST,
              config
            )
          );
          return;
        }
        request.send(requestData || null);
      });
    };
    var composeSignals = (signals, timeout) => {
      const { length } = signals = signals ? signals.filter(Boolean) : [];
      if (timeout || length) {
        let controller = new AbortController();
        let aborted;
        const onabort = function(reason) {
          if (!aborted) {
            aborted = true;
            unsubscribe();
            const err = reason instanceof Error ? reason : this.reason;
            controller.abort(
              err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)
            );
          }
        };
        let timer = timeout && setTimeout(() => {
          timer = null;
          onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
        }, timeout);
        const unsubscribe = () => {
          if (signals) {
            timer && clearTimeout(timer);
            timer = null;
            signals.forEach((signal2) => {
              signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
            });
            signals = null;
          }
        };
        signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
        const { signal } = controller;
        signal.unsubscribe = () => utils$1.asap(unsubscribe);
        return signal;
      }
    };
    var composeSignals$1 = composeSignals;
    var streamChunk = function* (chunk, chunkSize) {
      let len = chunk.byteLength;
      if (!chunkSize || len < chunkSize) {
        yield chunk;
        return;
      }
      let pos = 0;
      let end;
      while (pos < len) {
        end = pos + chunkSize;
        yield chunk.slice(pos, end);
        pos = end;
      }
    };
    var readBytes = async function* (iterable, chunkSize) {
      for await (const chunk of readStream(iterable)) {
        yield* streamChunk(chunk, chunkSize);
      }
    };
    var readStream = async function* (stream2) {
      if (stream2[Symbol.asyncIterator]) {
        yield* stream2;
        return;
      }
      const reader = stream2.getReader();
      try {
        for (; ; ) {
          const { done, value } = await reader.read();
          if (done) {
            break;
          }
          yield value;
        }
      } finally {
        await reader.cancel();
      }
    };
    var trackStream = (stream2, chunkSize, onProgress, onFinish) => {
      const iterator2 = readBytes(stream2, chunkSize);
      let bytes = 0;
      let done;
      let _onFinish = (e3) => {
        if (!done) {
          done = true;
          onFinish && onFinish(e3);
        }
      };
      return new ReadableStream(
        {
          async pull(controller) {
            try {
              const { done: done2, value } = await iterator2.next();
              if (done2) {
                _onFinish();
                controller.close();
                return;
              }
              let len = value.byteLength;
              if (onProgress) {
                let loadedBytes = bytes += len;
                onProgress(loadedBytes);
              }
              controller.enqueue(new Uint8Array(value));
            } catch (err) {
              _onFinish(err);
              throw err;
            }
          },
          cancel(reason) {
            _onFinish(reason);
            return iterator2.return();
          }
        },
        {
          highWaterMark: 2
        }
      );
    };
    var DEFAULT_CHUNK_SIZE = 64 * 1024;
    var { isFunction } = utils$1;
    var globalFetchAPI = (({ Request, Response }) => ({
      Request,
      Response
    }))(utils$1.global);
    var { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils$1.global;
    var test = (fn, ...args) => {
      try {
        return !!fn(...args);
      } catch (e3) {
        return false;
      }
    };
    var factory = (env) => {
      env = utils$1.merge.call(
        {
          skipUndefined: true
        },
        globalFetchAPI,
        env
      );
      const { fetch: envFetch, Request, Response } = env;
      const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
      const isRequestSupported = isFunction(Request);
      const isResponseSupported = isFunction(Response);
      if (!isFetchSupported) {
        return false;
      }
      const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
      const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
      const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
        let duplexAccessed = false;
        const hasContentType = new Request(platform2.origin, {
          body: new ReadableStream$1(),
          method: "POST",
          get duplex() {
            duplexAccessed = true;
            return "half";
          }
        }).headers.has("Content-Type");
        return duplexAccessed && !hasContentType;
      });
      const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
      const resolvers = {
        stream: supportsResponseStream && ((res) => res.body)
      };
      isFetchSupported && (() => {
        ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
          !resolvers[type] && (resolvers[type] = (res, config) => {
            let method = res && res[type];
            if (method) {
              return method.call(res);
            }
            throw new AxiosError$1(
              `Response type '${type}' is not supported`,
              AxiosError$1.ERR_NOT_SUPPORT,
              config
            );
          });
        });
      })();
      const getBodyLength = async (body) => {
        if (body == null) {
          return 0;
        }
        if (utils$1.isBlob(body)) {
          return body.size;
        }
        if (utils$1.isSpecCompliantForm(body)) {
          const _request = new Request(platform2.origin, {
            method: "POST",
            body
          });
          return (await _request.arrayBuffer()).byteLength;
        }
        if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
          return body.byteLength;
        }
        if (utils$1.isURLSearchParams(body)) {
          body = body + "";
        }
        if (utils$1.isString(body)) {
          return (await encodeText(body)).byteLength;
        }
      };
      const resolveBodyLength = async (headers, body) => {
        const length = utils$1.toFiniteNumber(headers.getContentLength());
        return length == null ? getBodyLength(body) : length;
      };
      return async (config) => {
        let {
          url: url2,
          method,
          data,
          signal,
          cancelToken,
          timeout,
          onDownloadProgress,
          onUploadProgress,
          responseType,
          headers,
          withCredentials = "same-origin",
          fetchOptions
        } = resolveConfig(config);
        let _fetch = envFetch || fetch;
        responseType = responseType ? (responseType + "").toLowerCase() : "text";
        let composedSignal = composeSignals$1(
          [signal, cancelToken && cancelToken.toAbortSignal()],
          timeout
        );
        let request = null;
        const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
          composedSignal.unsubscribe();
        });
        let requestContentLength;
        try {
          if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
            let _request = new Request(url2, {
              method: "POST",
              body: data,
              duplex: "half"
            });
            let contentTypeHeader;
            if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
              headers.setContentType(contentTypeHeader);
            }
            if (_request.body) {
              const [onProgress, flush] = progressEventDecorator(
                requestContentLength,
                progressEventReducer(asyncDecorator(onUploadProgress))
              );
              data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
            }
          }
          if (!utils$1.isString(withCredentials)) {
            withCredentials = withCredentials ? "include" : "omit";
          }
          const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
          const resolvedOptions = {
            ...fetchOptions,
            signal: composedSignal,
            method: method.toUpperCase(),
            headers: headers.normalize().toJSON(),
            body: data,
            duplex: "half",
            credentials: isCredentialsSupported ? withCredentials : void 0
          };
          request = isRequestSupported && new Request(url2, resolvedOptions);
          let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
          const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
          if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
            const options = {};
            ["status", "statusText", "headers"].forEach((prop) => {
              options[prop] = response[prop];
            });
            const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
            const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
              responseContentLength,
              progressEventReducer(asyncDecorator(onDownloadProgress), true)
            ) || [];
            response = new Response(
              trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
                flush && flush();
                unsubscribe && unsubscribe();
              }),
              options
            );
          }
          responseType = responseType || "text";
          let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](
            response,
            config
          );
          !isStreamResponse && unsubscribe && unsubscribe();
          return await new Promise((resolve4, reject) => {
            settle(resolve4, reject, {
              data: responseData,
              headers: AxiosHeaders$1.from(response.headers),
              status: response.status,
              statusText: response.statusText,
              config,
              request
            });
          });
        } catch (err) {
          unsubscribe && unsubscribe();
          if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
            throw Object.assign(
              new AxiosError$1(
                "Network Error",
                AxiosError$1.ERR_NETWORK,
                config,
                request,
                err && err.response
              ),
              {
                cause: err.cause || err
              }
            );
          }
          throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
        }
      };
    };
    var seedCache = /* @__PURE__ */ new Map();
    var getFetch = (config) => {
      let env = config && config.env || {};
      const { fetch: fetch2, Request, Response } = env;
      const seeds = [Request, Response, fetch2];
      let len = seeds.length, i3 = len, seed, target, map = seedCache;
      while (i3--) {
        seed = seeds[i3];
        target = map.get(seed);
        target === void 0 && map.set(seed, target = i3 ? /* @__PURE__ */ new Map() : factory(env));
        map = target;
      }
      return target;
    };
    getFetch();
    var knownAdapters = {
      http: httpAdapter,
      xhr: xhrAdapter,
      fetch: {
        get: getFetch
      }
    };
    utils$1.forEach(knownAdapters, (fn, value) => {
      if (fn) {
        try {
          Object.defineProperty(fn, "name", { value });
        } catch (e3) {
        }
        Object.defineProperty(fn, "adapterName", { value });
      }
    });
    var renderReason = (reason) => `- ${reason}`;
    var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
    function getAdapter(adapters2, config) {
      adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
      const { length } = adapters2;
      let nameOrAdapter;
      let adapter;
      const rejectedReasons = {};
      for (let i3 = 0; i3 < length; i3++) {
        nameOrAdapter = adapters2[i3];
        let id;
        adapter = nameOrAdapter;
        if (!isResolvedHandle(nameOrAdapter)) {
          adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
          if (adapter === void 0) {
            throw new AxiosError$1(`Unknown adapter '${id}'`);
          }
        }
        if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
          break;
        }
        rejectedReasons[id || "#" + i3] = adapter;
      }
      if (!adapter) {
        const reasons = Object.entries(rejectedReasons).map(
          ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
        );
        let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
        throw new AxiosError$1(
          `There is no suitable adapter to dispatch the request ` + s,
          "ERR_NOT_SUPPORT"
        );
      }
      return adapter;
    }
    var adapters = {
      /**
       * Resolve an adapter from a list of adapter names or functions.
       * @type {Function}
       */
      getAdapter,
      /**
       * Exposes all known adapters
       * @type {Object<string, Function|Object>}
       */
      adapters: knownAdapters
    };
    function throwIfCancellationRequested(config) {
      if (config.cancelToken) {
        config.cancelToken.throwIfRequested();
      }
      if (config.signal && config.signal.aborted) {
        throw new CanceledError$1(null, config);
      }
    }
    function dispatchRequest(config) {
      throwIfCancellationRequested(config);
      config.headers = AxiosHeaders$1.from(config.headers);
      config.data = transformData.call(config, config.transformRequest);
      if (["post", "put", "patch"].indexOf(config.method) !== -1) {
        config.headers.setContentType("application/x-www-form-urlencoded", false);
      }
      const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
      return adapter(config).then(
        function onAdapterResolution(response) {
          throwIfCancellationRequested(config);
          response.data = transformData.call(config, config.transformResponse, response);
          response.headers = AxiosHeaders$1.from(response.headers);
          return response;
        },
        function onAdapterRejection(reason) {
          if (!isCancel(reason)) {
            throwIfCancellationRequested(config);
            if (reason && reason.response) {
              reason.response.data = transformData.call(
                config,
                config.transformResponse,
                reason.response
              );
              reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
            }
          }
          return Promise.reject(reason);
        }
      );
    }
    var validators$1 = {};
    ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i3) => {
      validators$1[type] = function validator2(thing) {
        return typeof thing === type || "a" + (i3 < 1 ? "n " : " ") + type;
      };
    });
    var deprecatedWarnings = {};
    validators$1.transitional = function transitional(validator2, version, message) {
      function formatMessage2(opt, desc) {
        return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
      }
      return (value, opt, opts) => {
        if (validator2 === false) {
          throw new AxiosError$1(
            formatMessage2(opt, " has been removed" + (version ? " in " + version : "")),
            AxiosError$1.ERR_DEPRECATED
          );
        }
        if (version && !deprecatedWarnings[opt]) {
          deprecatedWarnings[opt] = true;
          console.warn(
            formatMessage2(
              opt,
              " has been deprecated since v" + version + " and will be removed in the near future"
            )
          );
        }
        return validator2 ? validator2(value, opt, opts) : true;
      };
    };
    validators$1.spelling = function spelling(correctSpelling) {
      return (value, opt) => {
        console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
        return true;
      };
    };
    function assertOptions(options, schema, allowUnknown) {
      if (typeof options !== "object") {
        throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
      }
      const keys = Object.keys(options);
      let i3 = keys.length;
      while (i3-- > 0) {
        const opt = keys[i3];
        const validator2 = schema[opt];
        if (validator2) {
          const value = options[opt];
          const result = value === void 0 || validator2(value, opt, options);
          if (result !== true) {
            throw new AxiosError$1(
              "option " + opt + " must be " + result,
              AxiosError$1.ERR_BAD_OPTION_VALUE
            );
          }
          continue;
        }
        if (allowUnknown !== true) {
          throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
        }
      }
    }
    var validator = {
      assertOptions,
      validators: validators$1
    };
    var validators = validator.validators;
    var Axios = class {
      constructor(instanceConfig) {
        this.defaults = instanceConfig || {};
        this.interceptors = {
          request: new InterceptorManager$1(),
          response: new InterceptorManager$1()
        };
      }
      /**
       * Dispatch a request
       *
       * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
       * @param {?Object} config
       *
       * @returns {Promise} The Promise to be fulfilled
       */
      async request(configOrUrl, config) {
        try {
          return await this._request(configOrUrl, config);
        } catch (err) {
          if (err instanceof Error) {
            let dummy = {};
            Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
            const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
            try {
              if (!err.stack) {
                err.stack = stack;
              } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
                err.stack += "\n" + stack;
              }
            } catch (e3) {
            }
          }
          throw err;
        }
      }
      _request(configOrUrl, config) {
        if (typeof configOrUrl === "string") {
          config = config || {};
          config.url = configOrUrl;
        } else {
          config = configOrUrl || {};
        }
        config = mergeConfig(this.defaults, config);
        const { transitional, paramsSerializer, headers } = config;
        if (transitional !== void 0) {
          validator.assertOptions(
            transitional,
            {
              silentJSONParsing: validators.transitional(validators.boolean),
              forcedJSONParsing: validators.transitional(validators.boolean),
              clarifyTimeoutError: validators.transitional(validators.boolean),
              legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
            },
            false
          );
        }
        if (paramsSerializer != null) {
          if (utils$1.isFunction(paramsSerializer)) {
            config.paramsSerializer = {
              serialize: paramsSerializer
            };
          } else {
            validator.assertOptions(
              paramsSerializer,
              {
                encode: validators.function,
                serialize: validators.function
              },
              true
            );
          }
        }
        if (config.allowAbsoluteUrls !== void 0) ;
        else if (this.defaults.allowAbsoluteUrls !== void 0) {
          config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
        } else {
          config.allowAbsoluteUrls = true;
        }
        validator.assertOptions(
          config,
          {
            baseUrl: validators.spelling("baseURL"),
            withXsrfToken: validators.spelling("withXSRFToken")
          },
          true
        );
        config.method = (config.method || this.defaults.method || "get").toLowerCase();
        let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
        headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
          delete headers[method];
        });
        config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
        const requestInterceptorChain = [];
        let synchronousRequestInterceptors = true;
        this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
          if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
            return;
          }
          synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
          const transitional2 = config.transitional || transitionalDefaults;
          const legacyInterceptorReqResOrdering = transitional2 && transitional2.legacyInterceptorReqResOrdering;
          if (legacyInterceptorReqResOrdering) {
            requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
          } else {
            requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
          }
        });
        const responseInterceptorChain = [];
        this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
          responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
        });
        let promise;
        let i3 = 0;
        let len;
        if (!synchronousRequestInterceptors) {
          const chain = [dispatchRequest.bind(this), void 0];
          chain.unshift(...requestInterceptorChain);
          chain.push(...responseInterceptorChain);
          len = chain.length;
          promise = Promise.resolve(config);
          while (i3 < len) {
            promise = promise.then(chain[i3++], chain[i3++]);
          }
          return promise;
        }
        len = requestInterceptorChain.length;
        let newConfig = config;
        while (i3 < len) {
          const onFulfilled = requestInterceptorChain[i3++];
          const onRejected = requestInterceptorChain[i3++];
          try {
            newConfig = onFulfilled(newConfig);
          } catch (error) {
            onRejected.call(this, error);
            break;
          }
        }
        try {
          promise = dispatchRequest.call(this, newConfig);
        } catch (error) {
          return Promise.reject(error);
        }
        i3 = 0;
        len = responseInterceptorChain.length;
        while (i3 < len) {
          promise = promise.then(responseInterceptorChain[i3++], responseInterceptorChain[i3++]);
        }
        return promise;
      }
      getUri(config) {
        config = mergeConfig(this.defaults, config);
        const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
        return buildURL(fullPath, config.params, config.paramsSerializer);
      }
    };
    utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
      Axios.prototype[method] = function(url2, config) {
        return this.request(
          mergeConfig(config || {}, {
            method,
            url: url2,
            data: (config || {}).data
          })
        );
      };
    });
    utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
      function generateHTTPMethod(isForm) {
        return function httpMethod(url2, data, config) {
          return this.request(
            mergeConfig(config || {}, {
              method,
              headers: isForm ? {
                "Content-Type": "multipart/form-data"
              } : {},
              url: url2,
              data
            })
          );
        };
      }
      Axios.prototype[method] = generateHTTPMethod();
      Axios.prototype[method + "Form"] = generateHTTPMethod(true);
    });
    var Axios$1 = Axios;
    var CancelToken = class _CancelToken {
      constructor(executor) {
        if (typeof executor !== "function") {
          throw new TypeError("executor must be a function.");
        }
        let resolvePromise;
        this.promise = new Promise(function promiseExecutor(resolve4) {
          resolvePromise = resolve4;
        });
        const token2 = this;
        this.promise.then((cancel) => {
          if (!token2._listeners) return;
          let i3 = token2._listeners.length;
          while (i3-- > 0) {
            token2._listeners[i3](cancel);
          }
          token2._listeners = null;
        });
        this.promise.then = (onfulfilled) => {
          let _resolve;
          const promise = new Promise((resolve4) => {
            token2.subscribe(resolve4);
            _resolve = resolve4;
          }).then(onfulfilled);
          promise.cancel = function reject() {
            token2.unsubscribe(_resolve);
          };
          return promise;
        };
        executor(function cancel(message, config, request) {
          if (token2.reason) {
            return;
          }
          token2.reason = new CanceledError$1(message, config, request);
          resolvePromise(token2.reason);
        });
      }
      /**
       * Throws a `CanceledError` if cancellation has been requested.
       */
      throwIfRequested() {
        if (this.reason) {
          throw this.reason;
        }
      }
      /**
       * Subscribe to the cancel signal
       */
      subscribe(listener) {
        if (this.reason) {
          listener(this.reason);
          return;
        }
        if (this._listeners) {
          this._listeners.push(listener);
        } else {
          this._listeners = [listener];
        }
      }
      /**
       * Unsubscribe from the cancel signal
       */
      unsubscribe(listener) {
        if (!this._listeners) {
          return;
        }
        const index = this._listeners.indexOf(listener);
        if (index !== -1) {
          this._listeners.splice(index, 1);
        }
      }
      toAbortSignal() {
        const controller = new AbortController();
        const abort = (err) => {
          controller.abort(err);
        };
        this.subscribe(abort);
        controller.signal.unsubscribe = () => this.unsubscribe(abort);
        return controller.signal;
      }
      /**
       * Returns an object that contains a new `CancelToken` and a function that, when called,
       * cancels the `CancelToken`.
       */
      static source() {
        let cancel;
        const token2 = new _CancelToken(function executor(c3) {
          cancel = c3;
        });
        return {
          token: token2,
          cancel
        };
      }
    };
    var CancelToken$1 = CancelToken;
    function spread(callback) {
      return function wrap(arr) {
        return callback.apply(null, arr);
      };
    }
    function isAxiosError(payload) {
      return utils$1.isObject(payload) && payload.isAxiosError === true;
    }
    var HttpStatusCode = {
      Continue: 100,
      SwitchingProtocols: 101,
      Processing: 102,
      EarlyHints: 103,
      Ok: 200,
      Created: 201,
      Accepted: 202,
      NonAuthoritativeInformation: 203,
      NoContent: 204,
      ResetContent: 205,
      PartialContent: 206,
      MultiStatus: 207,
      AlreadyReported: 208,
      ImUsed: 226,
      MultipleChoices: 300,
      MovedPermanently: 301,
      Found: 302,
      SeeOther: 303,
      NotModified: 304,
      UseProxy: 305,
      Unused: 306,
      TemporaryRedirect: 307,
      PermanentRedirect: 308,
      BadRequest: 400,
      Unauthorized: 401,
      PaymentRequired: 402,
      Forbidden: 403,
      NotFound: 404,
      MethodNotAllowed: 405,
      NotAcceptable: 406,
      ProxyAuthenticationRequired: 407,
      RequestTimeout: 408,
      Conflict: 409,
      Gone: 410,
      LengthRequired: 411,
      PreconditionFailed: 412,
      PayloadTooLarge: 413,
      UriTooLong: 414,
      UnsupportedMediaType: 415,
      RangeNotSatisfiable: 416,
      ExpectationFailed: 417,
      ImATeapot: 418,
      MisdirectedRequest: 421,
      UnprocessableEntity: 422,
      Locked: 423,
      FailedDependency: 424,
      TooEarly: 425,
      UpgradeRequired: 426,
      PreconditionRequired: 428,
      TooManyRequests: 429,
      RequestHeaderFieldsTooLarge: 431,
      UnavailableForLegalReasons: 451,
      InternalServerError: 500,
      NotImplemented: 501,
      BadGateway: 502,
      ServiceUnavailable: 503,
      GatewayTimeout: 504,
      HttpVersionNotSupported: 505,
      VariantAlsoNegotiates: 506,
      InsufficientStorage: 507,
      LoopDetected: 508,
      NotExtended: 510,
      NetworkAuthenticationRequired: 511,
      WebServerIsDown: 521,
      ConnectionTimedOut: 522,
      OriginIsUnreachable: 523,
      TimeoutOccurred: 524,
      SslHandshakeFailed: 525,
      InvalidSslCertificate: 526
    };
    Object.entries(HttpStatusCode).forEach(([key, value]) => {
      HttpStatusCode[value] = key;
    });
    var HttpStatusCode$1 = HttpStatusCode;
    function createInstance(defaultConfig) {
      const context = new Axios$1(defaultConfig);
      const instance = bind(Axios$1.prototype.request, context);
      utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
      utils$1.extend(instance, context, null, { allOwnKeys: true });
      instance.create = function create(instanceConfig) {
        return createInstance(mergeConfig(defaultConfig, instanceConfig));
      };
      return instance;
    }
    var axios = createInstance(defaults$1);
    axios.Axios = Axios$1;
    axios.CanceledError = CanceledError$1;
    axios.CancelToken = CancelToken$1;
    axios.isCancel = isCancel;
    axios.VERSION = VERSION;
    axios.toFormData = toFormData;
    axios.AxiosError = AxiosError$1;
    axios.Cancel = axios.CanceledError;
    axios.all = function all(promises) {
      return Promise.all(promises);
    };
    axios.spread = spread;
    axios.isAxiosError = isAxiosError;
    axios.mergeConfig = mergeConfig;
    axios.AxiosHeaders = AxiosHeaders$1;
    axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
    axios.getAdapter = adapters.getAdapter;
    axios.HttpStatusCode = HttpStatusCode$1;
    axios.default = axios;
    module2.exports = axios;
  }
});

// ../../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js
var require_util_inspect = __commonJS({
  "../../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js"(exports2, module2) {
    module2.exports = require("util").inspect;
  }
});

// ../../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js
var require_object_inspect = __commonJS({
  "../../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js"(exports2, module2) {
    var hasMap = typeof Map === "function" && Map.prototype;
    var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
    var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
    var mapForEach = hasMap && Map.prototype.forEach;
    var hasSet = typeof Set === "function" && Set.prototype;
    var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
    var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
    var setForEach = hasSet && Set.prototype.forEach;
    var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
    var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
    var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
    var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
    var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
    var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
    var booleanValueOf = Boolean.prototype.valueOf;
    var objectToString = Object.prototype.toString;
    var functionToString = Function.prototype.toString;
    var $match = String.prototype.match;
    var $slice = String.prototype.slice;
    var $replace = String.prototype.replace;
    var $toUpperCase = String.prototype.toUpperCase;
    var $toLowerCase = String.prototype.toLowerCase;
    var $test = RegExp.prototype.test;
    var $concat = Array.prototype.concat;
    var $join = Array.prototype.join;
    var $arrSlice = Array.prototype.slice;
    var $floor = Math.floor;
    var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
    var gOPS = Object.getOwnPropertySymbols;
    var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
    var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
    var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
    var isEnumerable = Object.prototype.propertyIsEnumerable;
    var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O2) {
      return O2.__proto__;
    } : null);
    function addNumericSeparator(num, str) {
      if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
        return str;
      }
      var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
      if (typeof num === "number") {
        var int = num < 0 ? -$floor(-num) : $floor(num);
        if (int !== num) {
          var intStr = String(int);
          var dec = $slice.call(str, intStr.length + 1);
          return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
        }
      }
      return $replace.call(str, sepRegex, "$&_");
    }
    var utilInspect = require_util_inspect();
    var inspectCustom = utilInspect.custom;
    var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
    var quotes = {
      __proto__: null,
      "double": '"',
      single: "'"
    };
    var quoteREs = {
      __proto__: null,
      "double": /(["\\])/g,
      single: /(['\\])/g
    };
    module2.exports = function inspect_(obj, options, depth, seen) {
      var opts = options || {};
      if (has(opts, "quoteStyle") && !has(quotes, opts.quoteStyle)) {
        throw new TypeError('option "quoteStyle" must be "single" or "double"');
      }
      if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
        throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
      }
      var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
      if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
        throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
      }
      if (has(opts, "indent") && opts.indent !== null && opts.indent !== "	" && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
        throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
      }
      if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
        throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
      }
      var numericSeparator = opts.numericSeparator;
      if (typeof obj === "undefined") {
        return "undefined";
      }
      if (obj === null) {
        return "null";
      }
      if (typeof obj === "boolean") {
        return obj ? "true" : "false";
      }
      if (typeof obj === "string") {
        return inspectString(obj, opts);
      }
      if (typeof obj === "number") {
        if (obj === 0) {
          return Infinity / obj > 0 ? "0" : "-0";
        }
        var str = String(obj);
        return numericSeparator ? addNumericSeparator(obj, str) : str;
      }
      if (typeof obj === "bigint") {
        var bigIntStr = String(obj) + "n";
        return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
      }
      var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
      if (typeof depth === "undefined") {
        depth = 0;
      }
      if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
        return isArray(obj) ? "[Array]" : "[Object]";
      }
      var indent = getIndent(opts, depth);
      if (typeof seen === "undefined") {
        seen = [];
      } else if (indexOf(seen, obj) >= 0) {
        return "[Circular]";
      }
      function inspect(value, from, noIndent) {
        if (from) {
          seen = $arrSlice.call(seen);
          seen.push(from);
        }
        if (noIndent) {
          var newOpts = {
            depth: opts.depth
          };
          if (has(opts, "quoteStyle")) {
            newOpts.quoteStyle = opts.quoteStyle;
          }
          return inspect_(value, newOpts, depth + 1, seen);
        }
        return inspect_(value, opts, depth + 1, seen);
      }
      if (typeof obj === "function" && !isRegExp(obj)) {
        var name = nameOf(obj);
        var keys = arrObjKeys(obj, inspect);
        return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
      }
      if (isSymbol(obj)) {
        var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
        return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
      }
      if (isElement(obj)) {
        var s = "<" + $toLowerCase.call(String(obj.nodeName));
        var attrs = obj.attributes || [];
        for (var i3 = 0; i3 < attrs.length; i3++) {
          s += " " + attrs[i3].name + "=" + wrapQuotes(quote(attrs[i3].value), "double", opts);
        }
        s += ">";
        if (obj.childNodes && obj.childNodes.length) {
          s += "...";
        }
        s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
        return s;
      }
      if (isArray(obj)) {
        if (obj.length === 0) {
          return "[]";
        }
        var xs = arrObjKeys(obj, inspect);
        if (indent && !singleLineValues(xs)) {
          return "[" + indentedJoin(xs, indent) + "]";
        }
        return "[ " + $join.call(xs, ", ") + " ]";
      }
      if (isError(obj)) {
        var parts = arrObjKeys(obj, inspect);
        if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
          return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
        }
        if (parts.length === 0) {
          return "[" + String(obj) + "]";
        }
        return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
      }
      if (typeof obj === "object" && customInspect) {
        if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
          return utilInspect(obj, { depth: maxDepth - depth });
        } else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
          return obj.inspect();
        }
      }
      if (isMap(obj)) {
        var mapParts = [];
        if (mapForEach) {
          mapForEach.call(obj, function(value, key) {
            mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
          });
        }
        return collectionOf("Map", mapSize.call(obj), mapParts, indent);
      }
      if (isSet(obj)) {
        var setParts = [];
        if (setForEach) {
          setForEach.call(obj, function(value) {
            setParts.push(inspect(value, obj));
          });
        }
        return collectionOf("Set", setSize.call(obj), setParts, indent);
      }
      if (isWeakMap(obj)) {
        return weakCollectionOf("WeakMap");
      }
      if (isWeakSet(obj)) {
        return weakCollectionOf("WeakSet");
      }
      if (isWeakRef(obj)) {
        return weakCollectionOf("WeakRef");
      }
      if (isNumber(obj)) {
        return markBoxed(inspect(Number(obj)));
      }
      if (isBigInt(obj)) {
        return markBoxed(inspect(bigIntValueOf.call(obj)));
      }
      if (isBoolean(obj)) {
        return markBoxed(booleanValueOf.call(obj));
      }
      if (isString(obj)) {
        return markBoxed(inspect(String(obj)));
      }
      if (typeof window !== "undefined" && obj === window) {
        return "{ [object Window] }";
      }
      if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) {
        return "{ [object globalThis] }";
      }
      if (!isDate(obj) && !isRegExp(obj)) {
        var ys = arrObjKeys(obj, inspect);
        var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
        var protoTag = obj instanceof Object ? "" : "null prototype";
        var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
        var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
        var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
        if (ys.length === 0) {
          return tag + "{}";
        }
        if (indent) {
          return tag + "{" + indentedJoin(ys, indent) + "}";
        }
        return tag + "{ " + $join.call(ys, ", ") + " }";
      }
      return String(obj);
    };
    function wrapQuotes(s, defaultStyle, opts) {
      var style = opts.quoteStyle || defaultStyle;
      var quoteChar = quotes[style];
      return quoteChar + s + quoteChar;
    }
    function quote(s) {
      return $replace.call(String(s), /"/g, "&quot;");
    }
    function canTrustToString(obj) {
      return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
    }
    function isArray(obj) {
      return toStr(obj) === "[object Array]" && canTrustToString(obj);
    }
    function isDate(obj) {
      return toStr(obj) === "[object Date]" && canTrustToString(obj);
    }
    function isRegExp(obj) {
      return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
    }
    function isError(obj) {
      return toStr(obj) === "[object Error]" && canTrustToString(obj);
    }
    function isString(obj) {
      return toStr(obj) === "[object String]" && canTrustToString(obj);
    }
    function isNumber(obj) {
      return toStr(obj) === "[object Number]" && canTrustToString(obj);
    }
    function isBoolean(obj) {
      return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
    }
    function isSymbol(obj) {
      if (hasShammedSymbols) {
        return obj && typeof obj === "object" && obj instanceof Symbol;
      }
      if (typeof obj === "symbol") {
        return true;
      }
      if (!obj || typeof obj !== "object" || !symToString) {
        return false;
      }
      try {
        symToString.call(obj);
        return true;
      } catch (e3) {
      }
      return false;
    }
    function isBigInt(obj) {
      if (!obj || typeof obj !== "object" || !bigIntValueOf) {
        return false;
      }
      try {
        bigIntValueOf.call(obj);
        return true;
      } catch (e3) {
      }
      return false;
    }
    var hasOwn = Object.prototype.hasOwnProperty || function(key) {
      return key in this;
    };
    function has(obj, key) {
      return hasOwn.call(obj, key);
    }
    function toStr(obj) {
      return objectToString.call(obj);
    }
    function nameOf(f) {
      if (f.name) {
        return f.name;
      }
      var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
      if (m) {
        return m[1];
      }
      return null;
    }
    function indexOf(xs, x3) {
      if (xs.indexOf) {
        return xs.indexOf(x3);
      }
      for (var i3 = 0, l3 = xs.length; i3 < l3; i3++) {
        if (xs[i3] === x3) {
          return i3;
        }
      }
      return -1;
    }
    function isMap(x3) {
      if (!mapSize || !x3 || typeof x3 !== "object") {
        return false;
      }
      try {
        mapSize.call(x3);
        try {
          setSize.call(x3);
        } catch (s) {
          return true;
        }
        return x3 instanceof Map;
      } catch (e3) {
      }
      return false;
    }
    function isWeakMap(x3) {
      if (!weakMapHas || !x3 || typeof x3 !== "object") {
        return false;
      }
      try {
        weakMapHas.call(x3, weakMapHas);
        try {
          weakSetHas.call(x3, weakSetHas);
        } catch (s) {
          return true;
        }
        return x3 instanceof WeakMap;
      } catch (e3) {
      }
      return false;
    }
    function isWeakRef(x3) {
      if (!weakRefDeref || !x3 || typeof x3 !== "object") {
        return false;
      }
      try {
        weakRefDeref.call(x3);
        return true;
      } catch (e3) {
      }
      return false;
    }
    function isSet(x3) {
      if (!setSize || !x3 || typeof x3 !== "object") {
        return false;
      }
      try {
        setSize.call(x3);
        try {
          mapSize.call(x3);
        } catch (m) {
          return true;
        }
        return x3 instanceof Set;
      } catch (e3) {
      }
      return false;
    }
    function isWeakSet(x3) {
      if (!weakSetHas || !x3 || typeof x3 !== "object") {
        return false;
      }
      try {
        weakSetHas.call(x3, weakSetHas);
        try {
          weakMapHas.call(x3, weakMapHas);
        } catch (s) {
          return true;
        }
        return x3 instanceof WeakSet;
      } catch (e3) {
      }
      return false;
    }
    function isElement(x3) {
      if (!x3 || typeof x3 !== "object") {
        return false;
      }
      if (typeof HTMLElement !== "undefined" && x3 instanceof HTMLElement) {
        return true;
      }
      return typeof x3.nodeName === "string" && typeof x3.getAttribute === "function";
    }
    function inspectString(str, opts) {
      if (str.length > opts.maxStringLength) {
        var remaining = str.length - opts.maxStringLength;
        var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
        return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
      }
      var quoteRE = quoteREs[opts.quoteStyle || "single"];
      quoteRE.lastIndex = 0;
      var s = $replace.call($replace.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte);
      return wrapQuotes(s, "single", opts);
    }
    function lowbyte(c3) {
      var n3 = c3.charCodeAt(0);
      var x3 = {
        8: "b",
        9: "t",
        10: "n",
        12: "f",
        13: "r"
      }[n3];
      if (x3) {
        return "\\" + x3;
      }
      return "\\x" + (n3 < 16 ? "0" : "") + $toUpperCase.call(n3.toString(16));
    }
    function markBoxed(str) {
      return "Object(" + str + ")";
    }
    function weakCollectionOf(type) {
      return type + " { ? }";
    }
    function collectionOf(type, size, entries, indent) {
      var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
      return type + " (" + size + ") {" + joinedEntries + "}";
    }
    function singleLineValues(xs) {
      for (var i3 = 0; i3 < xs.length; i3++) {
        if (indexOf(xs[i3], "\n") >= 0) {
          return false;
        }
      }
      return true;
    }
    function getIndent(opts, depth) {
      var baseIndent;
      if (opts.indent === "	") {
        baseIndent = "	";
      } else if (typeof opts.indent === "number" && opts.indent > 0) {
        baseIndent = $join.call(Array(opts.indent + 1), " ");
      } else {
        return null;
      }
      return {
        base: baseIndent,
        prev: $join.call(Array(depth + 1), baseIndent)
      };
    }
    function indentedJoin(xs, indent) {
      if (xs.length === 0) {
        return "";
      }
      var lineJoiner = "\n" + indent.prev + indent.base;
      return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
    }
    function arrObjKeys(obj, inspect) {
      var isArr = isArray(obj);
      var xs = [];
      if (isArr) {
        xs.length = obj.length;
        for (var i3 = 0; i3 < obj.length; i3++) {
          xs[i3] = has(obj, i3) ? inspect(obj[i3], obj) : "";
        }
      }
      var syms = typeof gOPS === "function" ? gOPS(obj) : [];
      var symMap;
      if (hasShammedSymbols) {
        symMap = {};
        for (var k = 0; k < syms.length; k++) {
          symMap["$" + syms[k]] = syms[k];
        }
      }
      for (var key in obj) {
        if (!has(obj, key)) {
          continue;
        }
        if (isArr && String(Number(key)) === key && key < obj.length) {
          continue;
        }
        if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
          continue;
        } else if ($test.call(/[^\w$]/, key)) {
          xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
        } else {
          xs.push(key + ": " + inspect(obj[key], obj));
        }
      }
      if (typeof gOPS === "function") {
        for (var j3 = 0; j3 < syms.length; j3++) {
          if (isEnumerable.call(obj, syms[j3])) {
            xs.push("[" + inspect(syms[j3]) + "]: " + inspect(obj[syms[j3]], obj));
          }
        }
      }
      return xs;
    }
  }
});

// ../../../node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.js
var require_side_channel_list = __commonJS({
  "../../../node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.js"(exports2, module2) {
    "use strict";
    var inspect = require_object_inspect();
    var $TypeError = require_type();
    var listGetNode = function(list, key, isDelete) {
      var prev = list;
      var curr;
      for (; (curr = prev.next) != null; prev = curr) {
        if (curr.key === key) {
          prev.next = curr.next;
          if (!isDelete) {
            curr.next = /** @type {NonNullable<typeof list.next>} */
            list.next;
            list.next = curr;
          }
          return curr;
        }
      }
    };
    var listGet = function(objects, key) {
      if (!objects) {
        return void 0;
      }
      var node = listGetNode(objects, key);
      return node && node.value;
    };
    var listSet = function(objects, key, value) {
      var node = listGetNode(objects, key);
      if (node) {
        node.value = value;
      } else {
        objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
        {
          // eslint-disable-line no-param-reassign, no-extra-parens
          key,
          next: objects.next,
          value
        };
      }
    };
    var listHas = function(objects, key) {
      if (!objects) {
        return false;
      }
      return !!listGetNode(objects, key);
    };
    var listDelete = function(objects, key) {
      if (objects) {
        return listGetNode(objects, key, true);
      }
    };
    module2.exports = function getSideChannelList() {
      var $o;
      var channel = {
        assert: function(key) {
          if (!channel.has(key)) {
            throw new $TypeError("Side channel does not contain " + inspect(key));
          }
        },
        "delete": function(key) {
          var root = $o && $o.next;
          var deletedNode = listDelete($o, key);
          if (deletedNode && root && root === deletedNode) {
            $o = void 0;
          }
          return !!deletedNode;
        },
        get: function(key) {
          return listGet($o, key);
        },
        has: function(key) {
          return listHas($o, key);
        },
        set: function(key, value) {
          if (!$o) {
            $o = {
              next: void 0
            };
          }
          listSet(
            /** @type {NonNullable<typeof $o>} */
            $o,
            key,
            value
          );
        }
      };
      return channel;
    };
  }
});

// ../../../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js
var require_call_bound = __commonJS({
  "../../../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBindBasic = require_call_bind_apply_helpers();
    var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
    module2.exports = function callBoundIntrinsic(name, allowMissing) {
      var intrinsic = (
        /** @type {(this: unknown, ...args: unknown[]) => unknown} */
        GetIntrinsic(name, !!allowMissing)
      );
      if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
        return callBindBasic(
          /** @type {const} */
          [intrinsic]
        );
      }
      return intrinsic;
    };
  }
});

// ../../../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js
var require_side_channel_map = __commonJS({
  "../../../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBound = require_call_bound();
    var inspect = require_object_inspect();
    var $TypeError = require_type();
    var $Map = GetIntrinsic("%Map%", true);
    var $mapGet = callBound("Map.prototype.get", true);
    var $mapSet = callBound("Map.prototype.set", true);
    var $mapHas = callBound("Map.prototype.has", true);
    var $mapDelete = callBound("Map.prototype.delete", true);
    var $mapSize = callBound("Map.prototype.size", true);
    module2.exports = !!$Map && /** @type {Exclude<import('.'), false>} */
    function getSideChannelMap() {
      var $m;
      var channel = {
        assert: function(key) {
          if (!channel.has(key)) {
            throw new $TypeError("Side channel does not contain " + inspect(key));
          }
        },
        "delete": function(key) {
          if ($m) {
            var result = $mapDelete($m, key);
            if ($mapSize($m) === 0) {
              $m = void 0;
            }
            return result;
          }
          return false;
        },
        get: function(key) {
          if ($m) {
            return $mapGet($m, key);
          }
        },
        has: function(key) {
          if ($m) {
            return $mapHas($m, key);
          }
          return false;
        },
        set: function(key, value) {
          if (!$m) {
            $m = new $Map();
          }
          $mapSet($m, key, value);
        }
      };
      return channel;
    };
  }
});

// ../../../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js
var require_side_channel_weakmap = __commonJS({
  "../../../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js"(exports2, module2) {
    "use strict";
    var GetIntrinsic = require_get_intrinsic();
    var callBound = require_call_bound();
    var inspect = require_object_inspect();
    var getSideChannelMap = require_side_channel_map();
    var $TypeError = require_type();
    var $WeakMap = GetIntrinsic("%WeakMap%", true);
    var $weakMapGet = callBound("WeakMap.prototype.get", true);
    var $weakMapSet = callBound("WeakMap.prototype.set", true);
    var $weakMapHas = callBound("WeakMap.prototype.has", true);
    var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
    module2.exports = $WeakMap ? (
      /** @type {Exclude<import('.'), false>} */
      function getSideChannelWeakMap() {
        var $wm;
        var $m;
        var channel = {
          assert: function(key) {
            if (!channel.has(key)) {
              throw new $TypeError("Side channel does not contain " + inspect(key));
            }
          },
          "delete": function(key) {
            if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
              if ($wm) {
                return $weakMapDelete($wm, key);
              }
            } else if (getSideChannelMap) {
              if ($m) {
                return $m["delete"](key);
              }
            }
            return false;
          },
          get: function(key) {
            if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
              if ($wm) {
                return $weakMapGet($wm, key);
              }
            }
            return $m && $m.get(key);
          },
          has: function(key) {
            if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
              if ($wm) {
                return $weakMapHas($wm, key);
              }
            }
            return !!$m && $m.has(key);
          },
          set: function(key, value) {
            if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
              if (!$wm) {
                $wm = new $WeakMap();
              }
              $weakMapSet($wm, key, value);
            } else if (getSideChannelMap) {
              if (!$m) {
                $m = getSideChannelMap();
              }
              $m.set(key, value);
            }
          }
        };
        return channel;
      }
    ) : getSideChannelMap;
  }
});

// ../../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js
var require_side_channel = __commonJS({
  "../../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js"(exports2, module2) {
    "use strict";
    var $TypeError = require_type();
    var inspect = require_object_inspect();
    var getSideChannelList = require_side_channel_list();
    var getSideChannelMap = require_side_channel_map();
    var getSideChannelWeakMap = require_side_channel_weakmap();
    var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
    module2.exports = function getSideChannel() {
      var $channelData;
      var channel = {
        assert: function(key) {
          if (!channel.has(key)) {
            throw new $TypeError("Side channel does not contain " + inspect(key));
          }
        },
        "delete": function(key) {
          return !!$channelData && $channelData["delete"](key);
        },
        get: function(key) {
          return $channelData && $channelData.get(key);
        },
        has: function(key) {
          return !!$channelData && $channelData.has(key);
        },
        set: function(key, value) {
          if (!$channelData) {
            $channelData = makeChannel();
          }
          $channelData.set(key, value);
        }
      };
      return channel;
    };
  }
});

// ../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/formats.js
var require_formats = __commonJS({
  "../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/formats.js"(exports2, module2) {
    "use strict";
    var replace = String.prototype.replace;
    var percentTwenties = /%20/g;
    var Format = {
      RFC1738: "RFC1738",
      RFC3986: "RFC3986"
    };
    module2.exports = {
      "default": Format.RFC3986,
      formatters: {
        RFC1738: function(value) {
          return replace.call(value, percentTwenties, "+");
        },
        RFC3986: function(value) {
          return String(value);
        }
      },
      RFC1738: Format.RFC1738,
      RFC3986: Format.RFC3986
    };
  }
});

// ../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/utils.js
var require_utils = __commonJS({
  "../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/utils.js"(exports2, module2) {
    "use strict";
    var formats = require_formats();
    var getSideChannel = require_side_channel();
    var has = Object.prototype.hasOwnProperty;
    var isArray = Array.isArray;
    var overflowChannel = getSideChannel();
    var markOverflow = function markOverflow2(obj, maxIndex) {
      overflowChannel.set(obj, maxIndex);
      return obj;
    };
    var isOverflow = function isOverflow2(obj) {
      return overflowChannel.has(obj);
    };
    var getMaxIndex = function getMaxIndex2(obj) {
      return overflowChannel.get(obj);
    };
    var setMaxIndex = function setMaxIndex2(obj, maxIndex) {
      overflowChannel.set(obj, maxIndex);
    };
    var hexTable = function() {
      var array = [];
      for (var i3 = 0; i3 < 256; ++i3) {
        array[array.length] = "%" + ((i3 < 16 ? "0" : "") + i3.toString(16)).toUpperCase();
      }
      return array;
    }();
    var compactQueue = function compactQueue2(queue) {
      while (queue.length > 1) {
        var item = queue.pop();
        var obj = item.obj[item.prop];
        if (isArray(obj)) {
          var compacted = [];
          for (var j3 = 0; j3 < obj.length; ++j3) {
            if (typeof obj[j3] !== "undefined") {
              compacted[compacted.length] = obj[j3];
            }
          }
          item.obj[item.prop] = compacted;
        }
      }
    };
    var arrayToObject = function arrayToObject2(source, options) {
      var obj = options && options.plainObjects ? { __proto__: null } : {};
      for (var i3 = 0; i3 < source.length; ++i3) {
        if (typeof source[i3] !== "undefined") {
          obj[i3] = source[i3];
        }
      }
      return obj;
    };
    var merge = function merge2(target, source, options) {
      if (!source) {
        return target;
      }
      if (typeof source !== "object" && typeof source !== "function") {
        if (isArray(target)) {
          var nextIndex = target.length;
          if (options && typeof options.arrayLimit === "number" && nextIndex > options.arrayLimit) {
            return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
          }
          target[nextIndex] = source;
        } else if (target && typeof target === "object") {
          if (isOverflow(target)) {
            var newIndex = getMaxIndex(target) + 1;
            target[newIndex] = source;
            setMaxIndex(target, newIndex);
          } else if (options && options.strictMerge) {
            return [target, source];
          } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
            target[source] = true;
          }
        } else {
          return [target, source];
        }
        return target;
      }
      if (!target || typeof target !== "object") {
        if (isOverflow(source)) {
          var sourceKeys = Object.keys(source);
          var result = options && options.plainObjects ? { __proto__: null, 0: target } : { 0: target };
          for (var m = 0; m < sourceKeys.length; m++) {
            var oldKey = parseInt(sourceKeys[m], 10);
            result[oldKey + 1] = source[sourceKeys[m]];
          }
          return markOverflow(result, getMaxIndex(source) + 1);
        }
        var combined = [target].concat(source);
        if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) {
          return markOverflow(arrayToObject(combined, options), combined.length - 1);
        }
        return combined;
      }
      var mergeTarget = target;
      if (isArray(target) && !isArray(source)) {
        mergeTarget = arrayToObject(target, options);
      }
      if (isArray(target) && isArray(source)) {
        source.forEach(function(item, i3) {
          if (has.call(target, i3)) {
            var targetItem = target[i3];
            if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
              target[i3] = merge2(targetItem, item, options);
            } else {
              target[target.length] = item;
            }
          } else {
            target[i3] = item;
          }
        });
        return target;
      }
      return Object.keys(source).reduce(function(acc, key) {
        var value = source[key];
        if (has.call(acc, key)) {
          acc[key] = merge2(acc[key], value, options);
        } else {
          acc[key] = value;
        }
        if (isOverflow(source) && !isOverflow(acc)) {
          markOverflow(acc, getMaxIndex(source));
        }
        if (isOverflow(acc)) {
          var keyNum = parseInt(key, 10);
          if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
            setMaxIndex(acc, keyNum);
          }
        }
        return acc;
      }, mergeTarget);
    };
    var assign2 = function assignSingleSource(target, source) {
      return Object.keys(source).reduce(function(acc, key) {
        acc[key] = source[key];
        return acc;
      }, target);
    };
    var decode = function(str, defaultDecoder, charset) {
      var strWithoutPlus = str.replace(/\+/g, " ");
      if (charset === "iso-8859-1") {
        return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
      }
      try {
        return decodeURIComponent(strWithoutPlus);
      } catch (e3) {
        return strWithoutPlus;
      }
    };
    var limit = 1024;
    var encode = function encode2(str, defaultEncoder, charset, kind, format2) {
      if (str.length === 0) {
        return str;
      }
      var string = str;
      if (typeof str === "symbol") {
        string = Symbol.prototype.toString.call(str);
      } else if (typeof str !== "string") {
        string = String(str);
      }
      if (charset === "iso-8859-1") {
        return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
          return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
        });
      }
      var out = "";
      for (var j3 = 0; j3 < string.length; j3 += limit) {
        var segment = string.length >= limit ? string.slice(j3, j3 + limit) : string;
        var arr = [];
        for (var i3 = 0; i3 < segment.length; ++i3) {
          var c3 = segment.charCodeAt(i3);
          if (c3 === 45 || c3 === 46 || c3 === 95 || c3 === 126 || c3 >= 48 && c3 <= 57 || c3 >= 65 && c3 <= 90 || c3 >= 97 && c3 <= 122 || format2 === formats.RFC1738 && (c3 === 40 || c3 === 41)) {
            arr[arr.length] = segment.charAt(i3);
            continue;
          }
          if (c3 < 128) {
            arr[arr.length] = hexTable[c3];
            continue;
          }
          if (c3 < 2048) {
            arr[arr.length] = hexTable[192 | c3 >> 6] + hexTable[128 | c3 & 63];
            continue;
          }
          if (c3 < 55296 || c3 >= 57344) {
            arr[arr.length] = hexTable[224 | c3 >> 12] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63];
            continue;
          }
          i3 += 1;
          c3 = 65536 + ((c3 & 1023) << 10 | segment.charCodeAt(i3) & 1023);
          arr[arr.length] = hexTable[240 | c3 >> 18] + hexTable[128 | c3 >> 12 & 63] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63];
        }
        out += arr.join("");
      }
      return out;
    };
    var compact = function compact2(value) {
      var queue = [{ obj: { o: value }, prop: "o" }];
      var refs = [];
      for (var i3 = 0; i3 < queue.length; ++i3) {
        var item = queue[i3];
        var obj = item.obj[item.prop];
        var keys = Object.keys(obj);
        for (var j3 = 0; j3 < keys.length; ++j3) {
          var key = keys[j3];
          var val = obj[key];
          if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
            queue[queue.length] = { obj, prop: key };
            refs[refs.length] = val;
          }
        }
      }
      compactQueue(queue);
      return value;
    };
    var isRegExp = function isRegExp2(obj) {
      return Object.prototype.toString.call(obj) === "[object RegExp]";
    };
    var isBuffer = function isBuffer2(obj) {
      if (!obj || typeof obj !== "object") {
        return false;
      }
      return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
    };
    var combine = function combine2(a, b3, arrayLimit, plainObjects) {
      if (isOverflow(a)) {
        var newIndex = getMaxIndex(a) + 1;
        a[newIndex] = b3;
        setMaxIndex(a, newIndex);
        return a;
      }
      var result = [].concat(a, b3);
      if (result.length > arrayLimit) {
        return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
      }
      return result;
    };
    var maybeMap = function maybeMap2(val, fn) {
      if (isArray(val)) {
        var mapped = [];
        for (var i3 = 0; i3 < val.length; i3 += 1) {
          mapped[mapped.length] = fn(val[i3]);
        }
        return mapped;
      }
      return fn(val);
    };
    module2.exports = {
      arrayToObject,
      assign: assign2,
      combine,
      compact,
      decode,
      encode,
      isBuffer,
      isOverflow,
      isRegExp,
      markOverflow,
      maybeMap,
      merge
    };
  }
});

// ../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/stringify.js
var require_stringify = __commonJS({
  "../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/stringify.js"(exports2, module2) {
    "use strict";
    var getSideChannel = require_side_channel();
    var utils = require_utils();
    var formats = require_formats();
    var has = Object.prototype.hasOwnProperty;
    var arrayPrefixGenerators = {
      brackets: function brackets(prefix) {
        return prefix + "[]";
      },
      comma: "comma",
      indices: function indices(prefix, key) {
        return prefix + "[" + key + "]";
      },
      repeat: function repeat(prefix) {
        return prefix;
      }
    };
    var isArray = Array.isArray;
    var push = Array.prototype.push;
    var pushToArray = function(arr, valueOrArray) {
      push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
    };
    var toISO = Date.prototype.toISOString;
    var defaultFormat = formats["default"];
    var defaults = {
      addQueryPrefix: false,
      allowDots: false,
      allowEmptyArrays: false,
      arrayFormat: "indices",
      charset: "utf-8",
      charsetSentinel: false,
      commaRoundTrip: false,
      delimiter: "&",
      encode: true,
      encodeDotInKeys: false,
      encoder: utils.encode,
      encodeValuesOnly: false,
      filter: void 0,
      format: defaultFormat,
      formatter: formats.formatters[defaultFormat],
      // deprecated
      indices: false,
      serializeDate: function serializeDate(date) {
        return toISO.call(date);
      },
      skipNulls: false,
      strictNullHandling: false
    };
    var isNonNullishPrimitive = function isNonNullishPrimitive2(v3) {
      return typeof v3 === "string" || typeof v3 === "number" || typeof v3 === "boolean" || typeof v3 === "symbol" || typeof v3 === "bigint";
    };
    var sentinel = {};
    var stringify3 = function stringify4(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format2, formatter, encodeValuesOnly, charset, sideChannel) {
      var obj = object;
      var tmpSc = sideChannel;
      var step = 0;
      var findFlag = false;
      while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
        var pos = tmpSc.get(object);
        step += 1;
        if (typeof pos !== "undefined") {
          if (pos === step) {
            throw new RangeError("Cyclic object value");
          } else {
            findFlag = true;
          }
        }
        if (typeof tmpSc.get(sentinel) === "undefined") {
          step = 0;
        }
      }
      if (typeof filter === "function") {
        obj = filter(prefix, obj);
      } else if (obj instanceof Date) {
        obj = serializeDate(obj);
      } else if (generateArrayPrefix === "comma" && isArray(obj)) {
        obj = utils.maybeMap(obj, function(value2) {
          if (value2 instanceof Date) {
            return serializeDate(value2);
          }
          return value2;
        });
      }
      if (obj === null) {
        if (strictNullHandling) {
          return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format2) : prefix;
        }
        obj = "";
      }
      if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
        if (encoder) {
          var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format2);
          return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format2))];
        }
        return [formatter(prefix) + "=" + formatter(String(obj))];
      }
      var values = [];
      if (typeof obj === "undefined") {
        return values;
      }
      var objKeys;
      if (generateArrayPrefix === "comma" && isArray(obj)) {
        if (encodeValuesOnly && encoder) {
          obj = utils.maybeMap(obj, encoder);
        }
        objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
      } else if (isArray(filter)) {
        objKeys = filter;
      } else {
        var keys = Object.keys(obj);
        objKeys = sort ? keys.sort(sort) : keys;
      }
      var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
      var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
      if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
        return adjustedPrefix + "[]";
      }
      for (var j3 = 0; j3 < objKeys.length; ++j3) {
        var key = objKeys[j3];
        var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
        if (skipNulls && value === null) {
          continue;
        }
        var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
        var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
        sideChannel.set(object, step);
        var valueSideChannel = getSideChannel();
        valueSideChannel.set(sentinel, sideChannel);
        pushToArray(values, stringify4(
          value,
          keyPrefix,
          generateArrayPrefix,
          commaRoundTrip,
          allowEmptyArrays,
          strictNullHandling,
          skipNulls,
          encodeDotInKeys,
          generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder,
          filter,
          sort,
          allowDots,
          serializeDate,
          format2,
          formatter,
          encodeValuesOnly,
          charset,
          valueSideChannel
        ));
      }
      return values;
    };
    var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
      if (!opts) {
        return defaults;
      }
      if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
      }
      if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
        throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
      }
      if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
        throw new TypeError("Encoder has to be a function.");
      }
      var charset = opts.charset || defaults.charset;
      if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
      }
      var format2 = formats["default"];
      if (typeof opts.format !== "undefined") {
        if (!has.call(formats.formatters, opts.format)) {
          throw new TypeError("Unknown format option provided.");
        }
        format2 = opts.format;
      }
      var formatter = formats.formatters[format2];
      var filter = defaults.filter;
      if (typeof opts.filter === "function" || isArray(opts.filter)) {
        filter = opts.filter;
      }
      var arrayFormat;
      if (opts.arrayFormat in arrayPrefixGenerators) {
        arrayFormat = opts.arrayFormat;
      } else if ("indices" in opts) {
        arrayFormat = opts.indices ? "indices" : "repeat";
      } else {
        arrayFormat = defaults.arrayFormat;
      }
      if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
        throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
      }
      var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
      return {
        addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
        allowDots,
        allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
        arrayFormat,
        charset,
        charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
        commaRoundTrip: !!opts.commaRoundTrip,
        delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
        encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
        encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
        encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
        encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
        filter,
        format: format2,
        formatter,
        serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
        skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
        sort: typeof opts.sort === "function" ? opts.sort : null,
        strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
      };
    };
    module2.exports = function(object, opts) {
      var obj = object;
      var options = normalizeStringifyOptions(opts);
      var objKeys;
      var filter;
      if (typeof options.filter === "function") {
        filter = options.filter;
        obj = filter("", obj);
      } else if (isArray(options.filter)) {
        filter = options.filter;
        objKeys = filter;
      }
      var keys = [];
      if (typeof obj !== "object" || obj === null) {
        return "";
      }
      var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
      var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
      if (!objKeys) {
        objKeys = Object.keys(obj);
      }
      if (options.sort) {
        objKeys.sort(options.sort);
      }
      var sideChannel = getSideChannel();
      for (var i3 = 0; i3 < objKeys.length; ++i3) {
        var key = objKeys[i3];
        var value = obj[key];
        if (options.skipNulls && value === null) {
          continue;
        }
        pushToArray(keys, stringify3(
          value,
          key,
          generateArrayPrefix,
          commaRoundTrip,
          options.allowEmptyArrays,
          options.strictNullHandling,
          options.skipNulls,
          options.encodeDotInKeys,
          options.encode ? options.encoder : null,
          options.filter,
          options.sort,
          options.allowDots,
          options.serializeDate,
          options.format,
          options.formatter,
          options.encodeValuesOnly,
          options.charset,
          sideChannel
        ));
      }
      var joined = keys.join(options.delimiter);
      var prefix = options.addQueryPrefix === true ? "?" : "";
      if (options.charsetSentinel) {
        if (options.charset === "iso-8859-1") {
          prefix += "utf8=%26%2310003%3B&";
        } else {
          prefix += "utf8=%E2%9C%93&";
        }
      }
      return joined.length > 0 ? prefix + joined : "";
    };
  }
});

// ../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/parse.js
var require_parse = __commonJS({
  "../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/parse.js"(exports2, module2) {
    "use strict";
    var utils = require_utils();
    var has = Object.prototype.hasOwnProperty;
    var isArray = Array.isArray;
    var defaults = {
      allowDots: false,
      allowEmptyArrays: false,
      allowPrototypes: false,
      allowSparse: false,
      arrayLimit: 20,
      charset: "utf-8",
      charsetSentinel: false,
      comma: false,
      decodeDotInKeys: false,
      decoder: utils.decode,
      delimiter: "&",
      depth: 5,
      duplicates: "combine",
      ignoreQueryPrefix: false,
      interpretNumericEntities: false,
      parameterLimit: 1e3,
      parseArrays: true,
      plainObjects: false,
      strictDepth: false,
      strictMerge: true,
      strictNullHandling: false,
      throwOnLimitExceeded: false
    };
    var interpretNumericEntities = function(str) {
      return str.replace(/&#(\d+);/g, function($0, numberStr) {
        return String.fromCharCode(parseInt(numberStr, 10));
      });
    };
    var parseArrayValue = function(val, options, currentArrayLength) {
      if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
        return val.split(",");
      }
      if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
        throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
      }
      return val;
    };
    var isoSentinel = "utf8=%26%2310003%3B";
    var charsetSentinel = "utf8=%E2%9C%93";
    var parseValues = function parseQueryStringValues(str, options) {
      var obj = { __proto__: null };
      var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
      cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
      var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
      var parts = cleanStr.split(
        options.delimiter,
        options.throwOnLimitExceeded ? limit + 1 : limit
      );
      if (options.throwOnLimitExceeded && parts.length > limit) {
        throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
      }
      var skipIndex = -1;
      var i3;
      var charset = options.charset;
      if (options.charsetSentinel) {
        for (i3 = 0; i3 < parts.length; ++i3) {
          if (parts[i3].indexOf("utf8=") === 0) {
            if (parts[i3] === charsetSentinel) {
              charset = "utf-8";
            } else if (parts[i3] === isoSentinel) {
              charset = "iso-8859-1";
            }
            skipIndex = i3;
            i3 = parts.length;
          }
        }
      }
      for (i3 = 0; i3 < parts.length; ++i3) {
        if (i3 === skipIndex) {
          continue;
        }
        var part = parts[i3];
        var bracketEqualsPos = part.indexOf("]=");
        var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
        var key;
        var val;
        if (pos === -1) {
          key = options.decoder(part, defaults.decoder, charset, "key");
          val = options.strictNullHandling ? null : "";
        } else {
          key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
          if (key !== null) {
            val = utils.maybeMap(
              parseArrayValue(
                part.slice(pos + 1),
                options,
                isArray(obj[key]) ? obj[key].length : 0
              ),
              function(encodedVal) {
                return options.decoder(encodedVal, defaults.decoder, charset, "value");
              }
            );
          }
        }
        if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
          val = interpretNumericEntities(String(val));
        }
        if (part.indexOf("[]=") > -1) {
          val = isArray(val) ? [val] : val;
        }
        if (options.comma && isArray(val) && val.length > options.arrayLimit) {
          if (options.throwOnLimitExceeded) {
            throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
          }
          val = utils.combine([], val, options.arrayLimit, options.plainObjects);
        }
        if (key !== null) {
          var existing = has.call(obj, key);
          if (existing && (options.duplicates === "combine" || part.indexOf("[]=") > -1)) {
            obj[key] = utils.combine(
              obj[key],
              val,
              options.arrayLimit,
              options.plainObjects
            );
          } else if (!existing || options.duplicates === "last") {
            obj[key] = val;
          }
        }
      }
      return obj;
    };
    var parseObject = function(chain, val, options, valuesParsed) {
      var currentArrayLength = 0;
      if (chain.length > 0 && chain[chain.length - 1] === "[]") {
        var parentKey = chain.slice(0, -1).join("");
        currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
      }
      var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
      for (var i3 = chain.length - 1; i3 >= 0; --i3) {
        var obj;
        var root = chain[i3];
        if (root === "[]" && options.parseArrays) {
          if (utils.isOverflow(leaf)) {
            obj = leaf;
          } else {
            obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine(
              [],
              leaf,
              options.arrayLimit,
              options.plainObjects
            );
          }
        } else {
          obj = options.plainObjects ? { __proto__: null } : {};
          var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
          var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
          var index = parseInt(decodedRoot, 10);
          var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
          if (!options.parseArrays && decodedRoot === "") {
            obj = { 0: leaf };
          } else if (isValidArrayIndex && index < options.arrayLimit) {
            obj = [];
            obj[index] = leaf;
          } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
            throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
          } else if (isValidArrayIndex) {
            obj[index] = leaf;
            utils.markOverflow(obj, index);
          } else if (decodedRoot !== "__proto__") {
            obj[decodedRoot] = leaf;
          }
        }
        leaf = obj;
      }
      return leaf;
    };
    var splitKeyIntoSegments = function splitKeyIntoSegments2(givenKey, options) {
      var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
      if (options.depth <= 0) {
        if (!options.plainObjects && has.call(Object.prototype, key)) {
          if (!options.allowPrototypes) {
            return;
          }
        }
        return [key];
      }
      var brackets = /(\[[^[\]]*])/;
      var child = /(\[[^[\]]*])/g;
      var segment = brackets.exec(key);
      var parent = segment ? key.slice(0, segment.index) : key;
      var keys = [];
      if (parent) {
        if (!options.plainObjects && has.call(Object.prototype, parent)) {
          if (!options.allowPrototypes) {
            return;
          }
        }
        keys[keys.length] = parent;
      }
      var i3 = 0;
      while ((segment = child.exec(key)) !== null && i3 < options.depth) {
        i3 += 1;
        var segmentContent = segment[1].slice(1, -1);
        if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
          if (!options.allowPrototypes) {
            return;
          }
        }
        keys[keys.length] = segment[1];
      }
      if (segment) {
        if (options.strictDepth === true) {
          throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
        }
        keys[keys.length] = "[" + key.slice(segment.index) + "]";
      }
      return keys;
    };
    var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
      if (!givenKey) {
        return;
      }
      var keys = splitKeyIntoSegments(givenKey, options);
      if (!keys) {
        return;
      }
      return parseObject(keys, val, options, valuesParsed);
    };
    var normalizeParseOptions = function normalizeParseOptions2(opts) {
      if (!opts) {
        return defaults;
      }
      if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
        throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
      }
      if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
        throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
      }
      if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
        throw new TypeError("Decoder has to be a function.");
      }
      if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
        throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
      }
      if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
        throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
      }
      var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
      var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
      if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
        throw new TypeError("The duplicates option must be either combine, first, or last");
      }
      var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
      return {
        allowDots,
        allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
        allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
        allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
        arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
        charset,
        charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
        comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
        decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
        decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
        delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
        // eslint-disable-next-line no-implicit-coercion, no-extra-parens
        depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
        duplicates,
        ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
        interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
        parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
        parseArrays: opts.parseArrays !== false,
        plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
        strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
        strictMerge: typeof opts.strictMerge === "boolean" ? !!opts.strictMerge : defaults.strictMerge,
        strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
        throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
      };
    };
    module2.exports = function(str, opts) {
      var options = normalizeParseOptions(opts);
      if (str === "" || str === null || typeof str === "undefined") {
        return options.plainObjects ? { __proto__: null } : {};
      }
      var tempObj = typeof str === "string" ? parseValues(str, options) : str;
      var obj = options.plainObjects ? { __proto__: null } : {};
      var keys = Object.keys(tempObj);
      for (var i3 = 0; i3 < keys.length; ++i3) {
        var key = keys[i3];
        var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
        obj = utils.merge(obj, newObj, options);
      }
      if (options.allowSparse === true) {
        return obj;
      }
      return utils.compact(obj);
    };
  }
});

// ../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/index.js
var require_lib = __commonJS({
  "../../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/index.js"(exports2, module2) {
    "use strict";
    var stringify3 = require_stringify();
    var parse2 = require_parse();
    var formats = require_formats();
    module2.exports = {
      formats,
      parse: parse2,
      stringify: stringify3
    };
  }
});

// ../../../node_modules/.pnpm/lodash.identity@3.0.0/node_modules/lodash.identity/index.js
var require_lodash = __commonJS({
  "../../../node_modules/.pnpm/lodash.identity@3.0.0/node_modules/lodash.identity/index.js"(exports2, module2) {
    function identity(value) {
      return value;
    }
    module2.exports = identity;
  }
});

// ../../../node_modules/.pnpm/lodash.pickby@4.6.0/node_modules/lodash.pickby/index.js
var require_lodash2 = __commonJS({
  "../../../node_modules/.pnpm/lodash.pickby@4.6.0/node_modules/lodash.pickby/index.js"(exports2, module2) {
    var LARGE_ARRAY_SIZE = 200;
    var FUNC_ERROR_TEXT = "Expected a function";
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    var UNORDERED_COMPARE_FLAG = 1;
    var PARTIAL_COMPARE_FLAG = 2;
    var INFINITY = 1 / 0;
    var MAX_SAFE_INTEGER = 9007199254740991;
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var funcTag = "[object Function]";
    var genTag = "[object GeneratorFunction]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var objectTag = "[object Object]";
    var promiseTag = "[object Promise]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var symbolTag = "[object Symbol]";
    var weakMapTag = "[object WeakMap]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var float32Tag = "[object Float32Array]";
    var float64Tag = "[object Float64Array]";
    var int8Tag = "[object Int8Array]";
    var int16Tag = "[object Int16Array]";
    var int32Tag = "[object Int32Array]";
    var uint8Tag = "[object Uint8Array]";
    var uint8ClampedTag = "[object Uint8ClampedArray]";
    var uint16Tag = "[object Uint16Array]";
    var uint32Tag = "[object Uint32Array]";
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
    var reIsPlainProp = /^\w*$/;
    var reLeadingDot = /^\./;
    var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reEscapeChar = /\\(\\)?/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
    var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var freeProcess = moduleExports && freeGlobal.process;
    var nodeUtil = function() {
      try {
        return freeProcess && freeProcess.binding("util");
      } catch (e3) {
      }
    }();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    function arrayPush(array, values) {
      var index = -1, length = values.length, offset = array.length;
      while (++index < length) {
        array[offset + index] = values[index];
      }
      return array;
    }
    function arraySome(array, predicate) {
      var index = -1, length = array ? array.length : 0;
      while (++index < length) {
        if (predicate(array[index], index, array)) {
          return true;
        }
      }
      return false;
    }
    function baseProperty(key) {
      return function(object) {
        return object == null ? void 0 : object[key];
      };
    }
    function baseTimes(n3, iteratee) {
      var index = -1, result = Array(n3);
      while (++index < n3) {
        result[index] = iteratee(index);
      }
      return result;
    }
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    function getValue(object, key) {
      return object == null ? void 0 : object[key];
    }
    function isHostObject(value) {
      var result = false;
      if (value != null && typeof value.toString != "function") {
        try {
          result = !!(value + "");
        } catch (e3) {
        }
      }
      return result;
    }
    function mapToArray(map) {
      var index = -1, result = Array(map.size);
      map.forEach(function(value, key) {
        result[++index] = [key, value];
      });
      return result;
    }
    function overArg(func, transform) {
      return function(arg) {
        return func(transform(arg));
      };
    }
    function setToArray(set) {
      var index = -1, result = Array(set.size);
      set.forEach(function(value) {
        result[++index] = value;
      });
      return result;
    }
    var arrayProto = Array.prototype;
    var funcProto = Function.prototype;
    var objectProto = Object.prototype;
    var coreJsData = root["__core-js_shared__"];
    var maskSrcKey = function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid ? "Symbol(src)_1." + uid : "";
    }();
    var funcToString = funcProto.toString;
    var hasOwnProperty = objectProto.hasOwnProperty;
    var objectToString = objectProto.toString;
    var reIsNative = RegExp(
      "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    var Symbol2 = root.Symbol;
    var Uint8Array2 = root.Uint8Array;
    var getPrototype = overArg(Object.getPrototypeOf, Object);
    var propertyIsEnumerable = objectProto.propertyIsEnumerable;
    var splice = arrayProto.splice;
    var nativeGetSymbols = Object.getOwnPropertySymbols;
    var nativeKeys = overArg(Object.keys, Object);
    var DataView2 = getNative(root, "DataView");
    var Map2 = getNative(root, "Map");
    var Promise2 = getNative(root, "Promise");
    var Set2 = getNative(root, "Set");
    var WeakMap2 = getNative(root, "WeakMap");
    var nativeCreate = getNative(Object, "create");
    var dataViewCtorString = toSource(DataView2);
    var mapCtorString = toSource(Map2);
    var promiseCtorString = toSource(Promise2);
    var setCtorString = toSource(Set2);
    var weakMapCtorString = toSource(WeakMap2);
    var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
    var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
    var symbolToString = symbolProto ? symbolProto.toString : void 0;
    function Hash(entries) {
      var index = -1, length = entries ? entries.length : 0;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
    }
    function hashDelete(key) {
      return this.has(key) && delete this.__data__[key];
    }
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? void 0 : result;
      }
      return hasOwnProperty.call(data, key) ? data[key] : void 0;
    }
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
    }
    function hashSet(key, value) {
      var data = this.__data__;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
      return this;
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    function ListCache(entries) {
      var index = -1, length = entries ? entries.length : 0;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function listCacheClear() {
      this.__data__ = [];
    }
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      return true;
    }
    function listCacheGet(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    function listCacheSet(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    function MapCache(entries) {
      var index = -1, length = entries ? entries.length : 0;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function mapCacheClear() {
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map2 || ListCache)(),
        "string": new Hash()
      };
    }
    function mapCacheDelete(key) {
      return getMapData(this, key)["delete"](key);
    }
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    function mapCacheSet(key, value) {
      getMapData(this, key).set(key, value);
      return this;
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    function SetCache(values) {
      var index = -1, length = values ? values.length : 0;
      this.__data__ = new MapCache();
      while (++index < length) {
        this.add(values[index]);
      }
    }
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }
    function setCacheHas(value) {
      return this.__data__.has(value);
    }
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    function Stack(entries) {
      this.__data__ = new ListCache(entries);
    }
    function stackClear() {
      this.__data__ = new ListCache();
    }
    function stackDelete(key) {
      return this.__data__["delete"](key);
    }
    function stackGet(key) {
      return this.__data__.get(key);
    }
    function stackHas(key) {
      return this.__data__.has(key);
    }
    function stackSet(key, value) {
      var cache = this.__data__;
      if (cache instanceof ListCache) {
        var pairs = cache.__data__;
        if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
          pairs.push([key, value]);
          return this;
        }
        cache = this.__data__ = new MapCache(pairs);
      }
      cache.set(key, value);
      return this;
    }
    Stack.prototype.clear = stackClear;
    Stack.prototype["delete"] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    function arrayLikeKeys(value, inherited) {
      var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
      var length = result.length, skipIndexes = !!length;
      for (var key in value) {
        if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq2(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    function baseGet(object, path2) {
      path2 = isKey(path2, object) ? [path2] : castPath(path2);
      var index = 0, length = path2.length;
      while (object != null && index < length) {
        object = object[toKey(path2[index++])];
      }
      return index && index == length ? object : void 0;
    }
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    function baseGetTag(value) {
      return objectToString.call(value);
    }
    function baseHasIn(object, key) {
      return object != null && key in Object(object);
    }
    function baseIsEqual(value, other, customizer, bitmask, stack) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
    }
    function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
      var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag;
      if (!objIsArr) {
        objTag = getTag(object);
        objTag = objTag == argsTag ? objectTag : objTag;
      }
      if (!othIsArr) {
        othTag = getTag(other);
        othTag = othTag == argsTag ? objectTag : othTag;
      }
      var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
      if (isSameTag && !objIsObj) {
        stack || (stack = new Stack());
        return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
      }
      if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
        var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
          stack || (stack = new Stack());
          return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack || (stack = new Stack());
      return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
    }
    function baseIsMatch(object, source, matchData, customizer) {
      var index = matchData.length, length = index, noCustomizer = !customizer;
      if (object == null) {
        return !length;
      }
      object = Object(object);
      while (index--) {
        var data = matchData[index];
        if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
          return false;
        }
      }
      while (++index < length) {
        data = matchData[index];
        var key = data[0], objValue = object[key], srcValue = data[1];
        if (noCustomizer && data[2]) {
          if (objValue === void 0 && !(key in object)) {
            return false;
          }
        } else {
          var stack = new Stack();
          if (customizer) {
            var result = customizer(objValue, srcValue, key, object, source, stack);
          }
          if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
            return false;
          }
        }
      }
      return true;
    }
    function baseIsNative(value) {
      if (!isObject(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
    }
    function baseIteratee(value) {
      if (typeof value == "function") {
        return value;
      }
      if (value == null) {
        return identity;
      }
      if (typeof value == "object") {
        return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
      }
      return property(value);
    }
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty.call(object, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    function baseKeysIn(object) {
      if (!isObject(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object), result = [];
      for (var key in object) {
        if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object) {
        return object === source || baseIsMatch(object, source, matchData);
      };
    }
    function baseMatchesProperty(path2, srcValue) {
      if (isKey(path2) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path2), srcValue);
      }
      return function(object) {
        var objValue = get(object, path2);
        return objValue === void 0 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
      };
    }
    function basePickBy(object, props, predicate) {
      var index = -1, length = props.length, result = {};
      while (++index < length) {
        var key = props[index], value = object[key];
        if (predicate(value, key)) {
          result[key] = value;
        }
      }
      return result;
    }
    function basePropertyDeep(path2) {
      return function(object) {
        return baseGet(object, path2);
      };
    }
    function baseToString(value) {
      if (typeof value == "string") {
        return value;
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : "";
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY ? "-0" : result;
    }
    function castPath(value) {
      return isArray(value) ? value : stringToPath(value);
    }
    function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
      var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var stacked = stack.get(array);
      if (stacked && stack.get(other)) {
        return stacked == other;
      }
      var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : void 0;
      stack.set(array, other);
      stack.set(other, array);
      while (++index < arrLength) {
        var arrValue = array[index], othValue = other[index];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen) {
          if (!arraySome(other, function(othValue2, othIndex) {
            if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) {
              return seen.add(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
          result = false;
          break;
        }
      }
      stack["delete"](array);
      stack["delete"](other);
      return result;
    }
    function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
      switch (tag) {
        case dataViewTag:
          if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;
        case arrayBufferTag:
          if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
            return false;
          }
          return true;
        case boolTag:
        case dateTag:
        case numberTag:
          return eq2(+object, +other);
        case errorTag:
          return object.name == other.name && object.message == other.message;
        case regexpTag:
        case stringTag:
          return object == other + "";
        case mapTag:
          var convert = mapToArray;
        case setTag:
          var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
          convert || (convert = setToArray);
          if (object.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= UNORDERED_COMPARE_FLAG;
          stack.set(object, other);
          var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
          stack["delete"](object);
          return result;
        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }
    function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
      var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
          return false;
        }
      }
      var stacked = stack.get(object);
      if (stacked && stack.get(other)) {
        return stacked == other;
      }
      var result = true;
      stack.set(object, other);
      stack.set(other, object);
      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack["delete"](object);
      stack["delete"](other);
      return result;
    }
    function getAllKeysIn(object) {
      return baseGetAllKeys(object, keysIn, getSymbolsIn);
    }
    function getMapData(map, key) {
      var data = map.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    function getMatchData(object) {
      var result = keys(object), length = result.length;
      while (length--) {
        var key = result[length], value = object[key];
        result[length] = [key, value, isStrictComparable(value)];
      }
      return result;
    }
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
    var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
      var result = [];
      while (object) {
        arrayPush(result, getSymbols(object));
        object = getPrototype(object);
      }
      return result;
    };
    var getTag = baseGetTag;
    if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
      getTag = function(value) {
        var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString:
              return dataViewTag;
            case mapCtorString:
              return mapTag;
            case promiseCtorString:
              return promiseTag;
            case setCtorString:
              return setTag;
            case weakMapCtorString:
              return weakMapTag;
          }
        }
        return result;
      };
    }
    function hasPath(object, path2, hasFunc) {
      path2 = isKey(path2, object) ? [path2] : castPath(path2);
      var result, index = -1, length = path2.length;
      while (++index < length) {
        var key = toKey(path2[index]);
        if (!(result = object != null && hasFunc(object, key))) {
          break;
        }
        object = object[key];
      }
      if (result) {
        return result;
      }
      var length = object ? object.length : 0;
      return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
    }
    function isIndex(value, length) {
      length = length == null ? MAX_SAFE_INTEGER : length;
      return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    function isKey(value, object) {
      if (isArray(value)) {
        return false;
      }
      var type = typeof value;
      if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
    }
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
      return value === proto;
    }
    function isStrictComparable(value) {
      return value === value && !isObject(value);
    }
    function matchesStrictComparable(key, srcValue) {
      return function(object) {
        if (object == null) {
          return false;
        }
        return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
      };
    }
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }
    var stringToPath = memoize(function(string) {
      string = toString(string);
      var result = [];
      if (reLeadingDot.test(string)) {
        result.push("");
      }
      string.replace(rePropName, function(match, number, quote, string2) {
        result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match);
      });
      return result;
    });
    function toKey(value) {
      if (typeof value == "string" || isSymbol(value)) {
        return value;
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY ? "-0" : result;
    }
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e3) {
        }
        try {
          return func + "";
        } catch (e3) {
        }
      }
      return "";
    }
    function memoize(func, resolver) {
      if (typeof func != "function" || resolver && typeof resolver != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var memoized = function() {
        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
        if (cache.has(key)) {
          return cache.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache.set(key, result);
        return result;
      };
      memoized.cache = new (memoize.Cache || MapCache)();
      return memoized;
    }
    memoize.Cache = MapCache;
    function eq2(value, other) {
      return value === other || value !== value && other !== other;
    }
    function isArguments(value) {
      return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
    }
    var isArray = Array.isArray;
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction(value);
    }
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike(value);
    }
    function isFunction(value) {
      var tag = isObject(value) ? objectToString.call(value) : "";
      return tag == funcTag || tag == genTag;
    }
    function isLength(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }
    function isObject(value) {
      var type = typeof value;
      return !!value && (type == "object" || type == "function");
    }
    function isObjectLike(value) {
      return !!value && typeof value == "object";
    }
    function isSymbol(value) {
      return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
    }
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    function toString(value) {
      return value == null ? "" : baseToString(value);
    }
    function get(object, path2, defaultValue) {
      var result = object == null ? void 0 : baseGet(object, path2);
      return result === void 0 ? defaultValue : result;
    }
    function hasIn(object, path2) {
      return object != null && hasPath(object, path2, baseHasIn);
    }
    function keys(object) {
      return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }
    function pickBy(object, predicate) {
      return object == null ? {} : basePickBy(object, getAllKeysIn(object), baseIteratee(predicate));
    }
    function identity(value) {
      return value;
    }
    function property(path2) {
      return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2);
    }
    function stubArray() {
      return [];
    }
    module2.exports = pickBy;
  }
});

// ../../../node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js
var require_lodash3 = __commonJS({
  "../../../node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js"(exports2, module2) {
    var LARGE_ARRAY_SIZE = 200;
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    var HOT_COUNT = 800;
    var HOT_SPAN = 16;
    var MAX_SAFE_INTEGER = 9007199254740991;
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var asyncTag = "[object AsyncFunction]";
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var funcTag = "[object Function]";
    var genTag = "[object GeneratorFunction]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var nullTag = "[object Null]";
    var objectTag = "[object Object]";
    var proxyTag = "[object Proxy]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var undefinedTag = "[object Undefined]";
    var weakMapTag = "[object WeakMap]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var float32Tag = "[object Float32Array]";
    var float64Tag = "[object Float64Array]";
    var int8Tag = "[object Int8Array]";
    var int16Tag = "[object Int16Array]";
    var int32Tag = "[object Int32Array]";
    var uint8Tag = "[object Uint8Array]";
    var uint8ClampedTag = "[object Uint8ClampedArray]";
    var uint16Tag = "[object Uint16Array]";
    var uint32Tag = "[object Uint32Array]";
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
    var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var freeProcess = moduleExports && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types = freeModule && freeModule.require && freeModule.require("util").types;
        if (types) {
          return types;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e3) {
      }
    }();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    function apply(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    function baseTimes(n3, iteratee) {
      var index = -1, result = Array(n3);
      while (++index < n3) {
        result[index] = iteratee(index);
      }
      return result;
    }
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    function getValue(object, key) {
      return object == null ? void 0 : object[key];
    }
    function overArg(func, transform) {
      return function(arg) {
        return func(transform(arg));
      };
    }
    var arrayProto = Array.prototype;
    var funcProto = Function.prototype;
    var objectProto = Object.prototype;
    var coreJsData = root["__core-js_shared__"];
    var funcToString = funcProto.toString;
    var hasOwnProperty = objectProto.hasOwnProperty;
    var maskSrcKey = function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid ? "Symbol(src)_1." + uid : "";
    }();
    var nativeObjectToString = objectProto.toString;
    var objectCtorString = funcToString.call(Object);
    var reIsNative = RegExp(
      "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    var Buffer2 = moduleExports ? root.Buffer : void 0;
    var Symbol2 = root.Symbol;
    var Uint8Array2 = root.Uint8Array;
    var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
    var getPrototype = overArg(Object.getPrototypeOf, Object);
    var objectCreate = Object.create;
    var propertyIsEnumerable = objectProto.propertyIsEnumerable;
    var splice = arrayProto.splice;
    var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
    var defineProperty = function() {
      try {
        var func = getNative(Object, "defineProperty");
        func({}, "", {});
        return func;
      } catch (e3) {
      }
    }();
    var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
    var nativeMax = Math.max;
    var nativeNow = Date.now;
    var Map2 = getNative(root, "Map");
    var nativeCreate = getNative(Object, "create");
    var baseCreate = /* @__PURE__ */ function() {
      function object() {
      }
      return function(proto) {
        if (!isObject(proto)) {
          return {};
        }
        if (objectCreate) {
          return objectCreate(proto);
        }
        object.prototype = proto;
        var result = new object();
        object.prototype = void 0;
        return result;
      };
    }();
    function Hash(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? void 0 : result;
      }
      return hasOwnProperty.call(data, key) ? data[key] : void 0;
    }
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
    }
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
      return this;
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    function ListCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }
    function listCacheGet(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    function listCacheSet(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    function MapCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map2 || ListCache)(),
        "string": new Hash()
      };
    }
    function mapCacheDelete(key) {
      var result = getMapData(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    function mapCacheSet(key, value) {
      var data = getMapData(this, key), size = data.size;
      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }
    function stackClear() {
      this.__data__ = new ListCache();
      this.size = 0;
    }
    function stackDelete(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    function stackGet(key) {
      return this.__data__.get(key);
    }
    function stackHas(key) {
      return this.__data__.has(key);
    }
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    Stack.prototype.clear = stackClear;
    Stack.prototype["delete"] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    function assignMergeValue(object, key, value) {
      if (value !== void 0 && !eq2(object[key], value) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function assignValue(object, key, value) {
      var objValue = object[key];
      if (!(hasOwnProperty.call(object, key) && eq2(objValue, value)) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq2(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    function baseAssignValue(object, key, value) {
      if (key == "__proto__" && defineProperty) {
        defineProperty(object, key, {
          "configurable": true,
          "enumerable": true,
          "value": value,
          "writable": true
        });
      } else {
        object[key] = value;
      }
    }
    var baseFor = createBaseFor();
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag;
    }
    function baseIsNative(value) {
      if (!isObject(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    function baseKeysIn(object) {
      if (!isObject(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object), result = [];
      for (var key in object) {
        if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }
    function baseMerge(object, source, srcIndex, customizer, stack) {
      if (object === source) {
        return;
      }
      baseFor(source, function(srcValue, key) {
        stack || (stack = new Stack());
        if (isObject(srcValue)) {
          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
        } else {
          var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
          if (newValue === void 0) {
            newValue = srcValue;
          }
          assignMergeValue(object, key, newValue);
        }
      }, keysIn);
    }
    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
      var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
      if (stacked) {
        assignMergeValue(object, key, stacked);
        return;
      }
      var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
      var isCommon = newValue === void 0;
      if (isCommon) {
        var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
        newValue = srcValue;
        if (isArr || isBuff || isTyped) {
          if (isArray(objValue)) {
            newValue = objValue;
          } else if (isArrayLikeObject(objValue)) {
            newValue = copyArray(objValue);
          } else if (isBuff) {
            isCommon = false;
            newValue = cloneBuffer(srcValue, true);
          } else if (isTyped) {
            isCommon = false;
            newValue = cloneTypedArray(srcValue, true);
          } else {
            newValue = [];
          }
        } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
          newValue = objValue;
          if (isArguments(objValue)) {
            newValue = toPlainObject(objValue);
          } else if (!isObject(objValue) || isFunction(objValue)) {
            newValue = initCloneObject(srcValue);
          }
        } else {
          isCommon = false;
        }
      }
      if (isCommon) {
        stack.set(srcValue, newValue);
        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
        stack["delete"](srcValue);
      }
      assignMergeValue(object, key, newValue);
    }
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity), func + "");
    }
    var baseSetToString = !defineProperty ? identity : function(func, string) {
      return defineProperty(func, "toString", {
        "configurable": true,
        "enumerable": false,
        "value": constant(string),
        "writable": true
      });
    };
    function cloneBuffer(buffer, isDeep) {
      if (isDeep) {
        return buffer.slice();
      }
      var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
      buffer.copy(result);
      return result;
    }
    function cloneArrayBuffer(arrayBuffer) {
      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
      new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
      return result;
    }
    function cloneTypedArray(typedArray, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }
    function copyArray(source, array) {
      var index = -1, length = source.length;
      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }
    function copyObject(source, props, object, customizer) {
      var isNew = !object;
      object || (object = {});
      var index = -1, length = props.length;
      while (++index < length) {
        var key = props[index];
        var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
        if (newValue === void 0) {
          newValue = source[key];
        }
        if (isNew) {
          baseAssignValue(object, key, newValue);
        } else {
          assignValue(object, key, newValue);
        }
      }
      return object;
    }
    function createAssigner(assigner) {
      return baseRest(function(object, sources) {
        var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
        customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? void 0 : customizer;
          length = 1;
        }
        object = Object(object);
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, index, customizer);
          }
        }
        return object;
      });
    }
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
        while (length--) {
          var key = props[fromRight ? length : ++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }
    function getMapData(map, key) {
      var data = map.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
      try {
        value[symToStringTag] = void 0;
        var unmasked = true;
      } catch (e3) {
      }
      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }
    function initCloneObject(object) {
      return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
    }
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER : length;
      return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    function isIterateeCall(value, index, object) {
      if (!isObject(object)) {
        return false;
      }
      var type = typeof index;
      if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
        return eq2(object[index], value);
      }
      return false;
    }
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
      return value === proto;
    }
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }
    function overRest(func, start, transform) {
      start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
      return function() {
        var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
        while (++index < length) {
          array[index] = args[start + index];
        }
        index = -1;
        var otherArgs = Array(start + 1);
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = transform(array);
        return apply(func, this, otherArgs);
      };
    }
    function safeGet(object, key) {
      if (key === "constructor" && typeof object[key] === "function") {
        return;
      }
      if (key == "__proto__") {
        return;
      }
      return object[key];
    }
    var setToString = shortOut(baseSetToString);
    function shortOut(func) {
      var count = 0, lastCalled = 0;
      return function() {
        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
        lastCalled = stamp;
        if (remaining > 0) {
          if (++count >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count = 0;
        }
        return func.apply(void 0, arguments);
      };
    }
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e3) {
        }
        try {
          return func + "";
        } catch (e3) {
        }
      }
      return "";
    }
    function eq2(value, other) {
      return value === other || value !== value && other !== other;
    }
    var isArguments = baseIsArguments(/* @__PURE__ */ function() {
      return arguments;
    }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
    };
    var isArray = Array.isArray;
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction(value);
    }
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike(value);
    }
    var isBuffer = nativeIsBuffer || stubFalse;
    function isFunction(value) {
      if (!isObject(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    function isLength(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }
    function isObject(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    function isPlainObject(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
      return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
    }
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    function toPlainObject(value) {
      return copyObject(value, keysIn(value));
    }
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }
    var merge = createAssigner(function(object, source, srcIndex) {
      baseMerge(object, source, srcIndex);
    });
    function constant(value) {
      return function() {
        return value;
      };
    }
    function identity(value) {
      return value;
    }
    function stubFalse() {
      return false;
    }
    module2.exports = merge;
  }
});

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/index.js
var require_ws = __commonJS({
  "../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/index.js"(exports2, module2) {
    "use strict";
    var WebSocket3 = require_websocket();
    WebSocket3.createWebSocketStream = require_stream();
    WebSocket3.Server = require_websocket_server();
    WebSocket3.Receiver = require_receiver();
    WebSocket3.Sender = require_sender();
    WebSocket3.WebSocket = WebSocket3;
    WebSocket3.WebSocketServer = WebSocket3.Server;
    module2.exports = WebSocket3;
  }
});

// ../../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js
var require_aspromise = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js"(exports2, module2) {
    "use strict";
    module2.exports = asPromise;
    function asPromise(fn, ctx) {
      var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
      while (index < arguments.length)
        params[offset++] = arguments[index++];
      return new Promise(function executor(resolve4, reject) {
        params[offset] = function callback(err) {
          if (pending) {
            pending = false;
            if (err)
              reject(err);
            else {
              var params2 = new Array(arguments.length - 1), offset2 = 0;
              while (offset2 < params2.length)
                params2[offset2++] = arguments[offset2];
              resolve4.apply(null, params2);
            }
          }
        };
        try {
          fn.apply(ctx || null, params);
        } catch (err) {
          if (pending) {
            pending = false;
            reject(err);
          }
        }
      });
    }
  }
});

// ../../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js
var require_base64 = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js"(exports2) {
    "use strict";
    var base64 = exports2;
    base64.length = function length(string) {
      var p = string.length;
      if (!p)
        return 0;
      var n3 = 0;
      while (--p % 4 > 1 && string.charAt(p) === "=")
        ++n3;
      return Math.ceil(string.length * 3) / 4 - n3;
    };
    var b64 = new Array(64);
    var s64 = new Array(123);
    for (i3 = 0; i3 < 64; )
      s64[b64[i3] = i3 < 26 ? i3 + 65 : i3 < 52 ? i3 + 71 : i3 < 62 ? i3 - 4 : i3 - 59 | 43] = i3++;
    var i3;
    base64.encode = function encode(buffer, start, end) {
      var parts = null, chunk = [];
      var i5 = 0, j3 = 0, t;
      while (start < end) {
        var b3 = buffer[start++];
        switch (j3) {
          case 0:
            chunk[i5++] = b64[b3 >> 2];
            t = (b3 & 3) << 4;
            j3 = 1;
            break;
          case 1:
            chunk[i5++] = b64[t | b3 >> 4];
            t = (b3 & 15) << 2;
            j3 = 2;
            break;
          case 2:
            chunk[i5++] = b64[t | b3 >> 6];
            chunk[i5++] = b64[b3 & 63];
            j3 = 0;
            break;
        }
        if (i5 > 8191) {
          (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
          i5 = 0;
        }
      }
      if (j3) {
        chunk[i5++] = b64[t];
        chunk[i5++] = 61;
        if (j3 === 1)
          chunk[i5++] = 61;
      }
      if (parts) {
        if (i5)
          parts.push(String.fromCharCode.apply(String, chunk.slice(0, i5)));
        return parts.join("");
      }
      return String.fromCharCode.apply(String, chunk.slice(0, i5));
    };
    var invalidEncoding = "invalid encoding";
    base64.decode = function decode(string, buffer, offset) {
      var start = offset;
      var j3 = 0, t;
      for (var i5 = 0; i5 < string.length; ) {
        var c3 = string.charCodeAt(i5++);
        if (c3 === 61 && j3 > 1)
          break;
        if ((c3 = s64[c3]) === void 0)
          throw Error(invalidEncoding);
        switch (j3) {
          case 0:
            t = c3;
            j3 = 1;
            break;
          case 1:
            buffer[offset++] = t << 2 | (c3 & 48) >> 4;
            t = c3;
            j3 = 2;
            break;
          case 2:
            buffer[offset++] = (t & 15) << 4 | (c3 & 60) >> 2;
            t = c3;
            j3 = 3;
            break;
          case 3:
            buffer[offset++] = (t & 3) << 6 | c3;
            j3 = 0;
            break;
        }
      }
      if (j3 === 1)
        throw Error(invalidEncoding);
      return offset - start;
    };
    base64.test = function test(string) {
      return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
    };
  }
});

// ../../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js
var require_eventemitter = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js"(exports2, module2) {
    "use strict";
    module2.exports = EventEmitter;
    function EventEmitter() {
      this._listeners = {};
    }
    EventEmitter.prototype.on = function on(evt, fn, ctx) {
      (this._listeners[evt] || (this._listeners[evt] = [])).push({
        fn,
        ctx: ctx || this
      });
      return this;
    };
    EventEmitter.prototype.off = function off(evt, fn) {
      if (evt === void 0)
        this._listeners = {};
      else {
        if (fn === void 0)
          this._listeners[evt] = [];
        else {
          var listeners = this._listeners[evt];
          for (var i3 = 0; i3 < listeners.length; )
            if (listeners[i3].fn === fn)
              listeners.splice(i3, 1);
            else
              ++i3;
        }
      }
      return this;
    };
    EventEmitter.prototype.emit = function emit(evt) {
      var listeners = this._listeners[evt];
      if (listeners) {
        var args = [], i3 = 1;
        for (; i3 < arguments.length; )
          args.push(arguments[i3++]);
        for (i3 = 0; i3 < listeners.length; )
          listeners[i3].fn.apply(listeners[i3++].ctx, args);
      }
      return this;
    };
  }
});

// ../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js
var require_float = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports2, module2) {
    "use strict";
    module2.exports = factory(factory);
    function factory(exports3) {
      if (typeof Float32Array !== "undefined") (function() {
        var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128;
        function writeFloat_f32_cpy(val, buf, pos) {
          f32[0] = val;
          buf[pos] = f8b[0];
          buf[pos + 1] = f8b[1];
          buf[pos + 2] = f8b[2];
          buf[pos + 3] = f8b[3];
        }
        function writeFloat_f32_rev(val, buf, pos) {
          f32[0] = val;
          buf[pos] = f8b[3];
          buf[pos + 1] = f8b[2];
          buf[pos + 2] = f8b[1];
          buf[pos + 3] = f8b[0];
        }
        exports3.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
        exports3.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
        function readFloat_f32_cpy(buf, pos) {
          f8b[0] = buf[pos];
          f8b[1] = buf[pos + 1];
          f8b[2] = buf[pos + 2];
          f8b[3] = buf[pos + 3];
          return f32[0];
        }
        function readFloat_f32_rev(buf, pos) {
          f8b[3] = buf[pos];
          f8b[2] = buf[pos + 1];
          f8b[1] = buf[pos + 2];
          f8b[0] = buf[pos + 3];
          return f32[0];
        }
        exports3.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
        exports3.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;
      })();
      else (function() {
        function writeFloat_ieee754(writeUint, val, buf, pos) {
          var sign = val < 0 ? 1 : 0;
          if (sign)
            val = -val;
          if (val === 0)
            writeUint(1 / val > 0 ? (
              /* positive */
              0
            ) : (
              /* negative 0 */
              2147483648
            ), buf, pos);
          else if (isNaN(val))
            writeUint(2143289344, buf, pos);
          else if (val > 34028234663852886e22)
            writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);
          else if (val < 11754943508222875e-54)
            writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos);
          else {
            var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
            writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);
          }
        }
        exports3.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
        exports3.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
        function readFloat_ieee754(readUint, buf, pos) {
          var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607;
          return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);
        }
        exports3.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
        exports3.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
      })();
      if (typeof Float64Array !== "undefined") (function() {
        var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128;
        function writeDouble_f64_cpy(val, buf, pos) {
          f64[0] = val;
          buf[pos] = f8b[0];
          buf[pos + 1] = f8b[1];
          buf[pos + 2] = f8b[2];
          buf[pos + 3] = f8b[3];
          buf[pos + 4] = f8b[4];
          buf[pos + 5] = f8b[5];
          buf[pos + 6] = f8b[6];
          buf[pos + 7] = f8b[7];
        }
        function writeDouble_f64_rev(val, buf, pos) {
          f64[0] = val;
          buf[pos] = f8b[7];
          buf[pos + 1] = f8b[6];
          buf[pos + 2] = f8b[5];
          buf[pos + 3] = f8b[4];
          buf[pos + 4] = f8b[3];
          buf[pos + 5] = f8b[2];
          buf[pos + 6] = f8b[1];
          buf[pos + 7] = f8b[0];
        }
        exports3.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
        exports3.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
        function readDouble_f64_cpy(buf, pos) {
          f8b[0] = buf[pos];
          f8b[1] = buf[pos + 1];
          f8b[2] = buf[pos + 2];
          f8b[3] = buf[pos + 3];
          f8b[4] = buf[pos + 4];
          f8b[5] = buf[pos + 5];
          f8b[6] = buf[pos + 6];
          f8b[7] = buf[pos + 7];
          return f64[0];
        }
        function readDouble_f64_rev(buf, pos) {
          f8b[7] = buf[pos];
          f8b[6] = buf[pos + 1];
          f8b[5] = buf[pos + 2];
          f8b[4] = buf[pos + 3];
          f8b[3] = buf[pos + 4];
          f8b[2] = buf[pos + 5];
          f8b[1] = buf[pos + 6];
          f8b[0] = buf[pos + 7];
          return f64[0];
        }
        exports3.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
        exports3.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;
      })();
      else (function() {
        function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {
          var sign = val < 0 ? 1 : 0;
          if (sign)
            val = -val;
          if (val === 0) {
            writeUint(0, buf, pos + off0);
            writeUint(1 / val > 0 ? (
              /* positive */
              0
            ) : (
              /* negative 0 */
              2147483648
            ), buf, pos + off1);
          } else if (isNaN(val)) {
            writeUint(0, buf, pos + off0);
            writeUint(2146959360, buf, pos + off1);
          } else if (val > 17976931348623157e292) {
            writeUint(0, buf, pos + off0);
            writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);
          } else {
            var mantissa;
            if (val < 22250738585072014e-324) {
              mantissa = val / 5e-324;
              writeUint(mantissa >>> 0, buf, pos + off0);
              writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);
            } else {
              var exponent = Math.floor(Math.log(val) / Math.LN2);
              if (exponent === 1024)
                exponent = 1023;
              mantissa = val * Math.pow(2, -exponent);
              writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);
              writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);
            }
          }
        }
        exports3.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
        exports3.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
        function readDouble_ieee754(readUint, off0, off1, buf, pos) {
          var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1);
          var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo;
          return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
        }
        exports3.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);
        exports3.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
      })();
      return exports3;
    }
    function writeUintLE(val, buf, pos) {
      buf[pos] = val & 255;
      buf[pos + 1] = val >>> 8 & 255;
      buf[pos + 2] = val >>> 16 & 255;
      buf[pos + 3] = val >>> 24;
    }
    function writeUintBE(val, buf, pos) {
      buf[pos] = val >>> 24;
      buf[pos + 1] = val >>> 16 & 255;
      buf[pos + 2] = val >>> 8 & 255;
      buf[pos + 3] = val & 255;
    }
    function readUintLE(buf, pos) {
      return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0;
    }
    function readUintBE(buf, pos) {
      return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
    }
  }
});

// ../../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js
var require_inquire = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js"(exports, module) {
    "use strict";
    module.exports = inquire;
    function inquire(moduleName) {
      try {
        var mod = eval("quire".replace(/^/, "re"))(moduleName);
        if (mod && (mod.length || Object.keys(mod).length))
          return mod;
      } catch (e3) {
      }
      return null;
    }
  }
});

// ../../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js
var require_utf8 = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js"(exports2) {
    "use strict";
    var utf8 = exports2;
    utf8.length = function utf8_length(string) {
      var len = 0, c3 = 0;
      for (var i3 = 0; i3 < string.length; ++i3) {
        c3 = string.charCodeAt(i3);
        if (c3 < 128)
          len += 1;
        else if (c3 < 2048)
          len += 2;
        else if ((c3 & 64512) === 55296 && (string.charCodeAt(i3 + 1) & 64512) === 56320) {
          ++i3;
          len += 4;
        } else
          len += 3;
      }
      return len;
    };
    utf8.read = function utf8_read(buffer, start, end) {
      var len = end - start;
      if (len < 1)
        return "";
      var parts = null, chunk = [], i3 = 0, t;
      while (start < end) {
        t = buffer[start++];
        if (t < 128)
          chunk[i3++] = t;
        else if (t > 191 && t < 224)
          chunk[i3++] = (t & 31) << 6 | buffer[start++] & 63;
        else if (t > 239 && t < 365) {
          t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 65536;
          chunk[i3++] = 55296 + (t >> 10);
          chunk[i3++] = 56320 + (t & 1023);
        } else
          chunk[i3++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
        if (i3 > 8191) {
          (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
          i3 = 0;
        }
      }
      if (parts) {
        if (i3)
          parts.push(String.fromCharCode.apply(String, chunk.slice(0, i3)));
        return parts.join("");
      }
      return String.fromCharCode.apply(String, chunk.slice(0, i3));
    };
    utf8.write = function utf8_write(string, buffer, offset) {
      var start = offset, c1, c22;
      for (var i3 = 0; i3 < string.length; ++i3) {
        c1 = string.charCodeAt(i3);
        if (c1 < 128) {
          buffer[offset++] = c1;
        } else if (c1 < 2048) {
          buffer[offset++] = c1 >> 6 | 192;
          buffer[offset++] = c1 & 63 | 128;
        } else if ((c1 & 64512) === 55296 && ((c22 = string.charCodeAt(i3 + 1)) & 64512) === 56320) {
          c1 = 65536 + ((c1 & 1023) << 10) + (c22 & 1023);
          ++i3;
          buffer[offset++] = c1 >> 18 | 240;
          buffer[offset++] = c1 >> 12 & 63 | 128;
          buffer[offset++] = c1 >> 6 & 63 | 128;
          buffer[offset++] = c1 & 63 | 128;
        } else {
          buffer[offset++] = c1 >> 12 | 224;
          buffer[offset++] = c1 >> 6 & 63 | 128;
          buffer[offset++] = c1 & 63 | 128;
        }
      }
      return offset - start;
    };
  }
});

// ../../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js
var require_pool = __commonJS({
  "../../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js"(exports2, module2) {
    "use strict";
    module2.exports = pool;
    function pool(alloc, slice, size) {
      var SIZE = size || 8192;
      var MAX = SIZE >>> 1;
      var slab = null;
      var offset = SIZE;
      return function pool_alloc(size2) {
        if (size2 < 1 || size2 > MAX)
          return alloc(size2);
        if (offset + size2 > SIZE) {
          slab = alloc(SIZE);
          offset = 0;
        }
        var buf = slice.call(slab, offset, offset += size2);
        if (offset & 7)
          offset = (offset | 7) + 1;
        return buf;
      };
    }
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/util/longbits.js
var require_longbits = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/util/longbits.js"(exports2, module2) {
    "use strict";
    module2.exports = LongBits;
    var util = require_minimal();
    function LongBits(lo, hi) {
      this.lo = lo >>> 0;
      this.hi = hi >>> 0;
    }
    var zero = LongBits.zero = new LongBits(0, 0);
    zero.toNumber = function() {
      return 0;
    };
    zero.zzEncode = zero.zzDecode = function() {
      return this;
    };
    zero.length = function() {
      return 1;
    };
    var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";
    LongBits.fromNumber = function fromNumber(value) {
      if (value === 0)
        return zero;
      var sign = value < 0;
      if (sign)
        value = -value;
      var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0;
      if (sign) {
        hi = ~hi >>> 0;
        lo = ~lo >>> 0;
        if (++lo > 4294967295) {
          lo = 0;
          if (++hi > 4294967295)
            hi = 0;
        }
      }
      return new LongBits(lo, hi);
    };
    LongBits.from = function from(value) {
      if (typeof value === "number")
        return LongBits.fromNumber(value);
      if (util.isString(value)) {
        if (util.Long)
          value = util.Long.fromString(value);
        else
          return LongBits.fromNumber(parseInt(value, 10));
      }
      return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;
    };
    LongBits.prototype.toNumber = function toNumber(unsigned) {
      if (!unsigned && this.hi >>> 31) {
        var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0;
        if (!lo)
          hi = hi + 1 >>> 0;
        return -(lo + hi * 4294967296);
      }
      return this.lo + this.hi * 4294967296;
    };
    LongBits.prototype.toLong = function toLong(unsigned) {
      return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
    };
    var charCodeAt = String.prototype.charCodeAt;
    LongBits.fromHash = function fromHash(hash) {
      if (hash === zeroHash)
        return zero;
      return new LongBits(
        (charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0,
        (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0
      );
    };
    LongBits.prototype.toHash = function toHash() {
      return String.fromCharCode(
        this.lo & 255,
        this.lo >>> 8 & 255,
        this.lo >>> 16 & 255,
        this.lo >>> 24,
        this.hi & 255,
        this.hi >>> 8 & 255,
        this.hi >>> 16 & 255,
        this.hi >>> 24
      );
    };
    LongBits.prototype.zzEncode = function zzEncode() {
      var mask = this.hi >> 31;
      this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;
      this.lo = (this.lo << 1 ^ mask) >>> 0;
      return this;
    };
    LongBits.prototype.zzDecode = function zzDecode() {
      var mask = -(this.lo & 1);
      this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;
      this.hi = (this.hi >>> 1 ^ mask) >>> 0;
      return this;
    };
    LongBits.prototype.length = function length() {
      var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
      return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
    };
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/util/minimal.js
var require_minimal = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/util/minimal.js"(exports2) {
    "use strict";
    var util = exports2;
    util.asPromise = require_aspromise();
    util.base64 = require_base64();
    util.EventEmitter = require_eventemitter();
    util.float = require_float();
    util.inquire = require_inquire();
    util.utf8 = require_utf8();
    util.pool = require_pool();
    util.LongBits = require_longbits();
    util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node);
    util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports2;
    util.emptyArray = Object.freeze ? Object.freeze([]) : (
      /* istanbul ignore next */
      []
    );
    util.emptyObject = Object.freeze ? Object.freeze({}) : (
      /* istanbul ignore next */
      {}
    );
    util.isInteger = Number.isInteger || /* istanbul ignore next */
    function isInteger(value) {
      return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
    };
    util.isString = function isString(value) {
      return typeof value === "string" || value instanceof String;
    };
    util.isObject = function isObject(value) {
      return value && typeof value === "object";
    };
    util.isset = /**
     * Checks if a property on a message is considered to be present.
     * @param {Object} obj Plain object or message instance
     * @param {string} prop Property name
     * @returns {boolean} `true` if considered to be present, otherwise `false`
     */
    util.isSet = function isSet(obj, prop) {
      var value = obj[prop];
      if (value != null && obj.hasOwnProperty(prop))
        return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
      return false;
    };
    util.Buffer = function() {
      try {
        var Buffer2 = util.inquire("buffer").Buffer;
        return Buffer2.prototype.utf8Write ? Buffer2 : (
          /* istanbul ignore next */
          null
        );
      } catch (e3) {
        return null;
      }
    }();
    util._Buffer_from = null;
    util._Buffer_allocUnsafe = null;
    util.newBuffer = function newBuffer(sizeOrArray) {
      return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray);
    };
    util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
    util.Long = /* istanbul ignore next */
    util.global.dcodeIO && /* istanbul ignore next */
    util.global.dcodeIO.Long || /* istanbul ignore next */
    util.global.Long || util.inquire("long");
    util.key2Re = /^true|false|0|1$/;
    util.key32Re = /^-?(?:0|[1-9][0-9]*)$/;
    util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;
    util.longToHash = function longToHash(value) {
      return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash;
    };
    util.longFromHash = function longFromHash(hash, unsigned) {
      var bits = util.LongBits.fromHash(hash);
      if (util.Long)
        return util.Long.fromBits(bits.lo, bits.hi, unsigned);
      return bits.toNumber(Boolean(unsigned));
    };
    function merge(dst, src, ifNotSet) {
      for (var keys = Object.keys(src), i3 = 0; i3 < keys.length; ++i3)
        if (dst[keys[i3]] === void 0 || !ifNotSet)
          dst[keys[i3]] = src[keys[i3]];
      return dst;
    }
    util.merge = merge;
    util.lcFirst = function lcFirst(str) {
      return str.charAt(0).toLowerCase() + str.substring(1);
    };
    function newError(name) {
      function CustomError(message, properties) {
        if (!(this instanceof CustomError))
          return new CustomError(message, properties);
        Object.defineProperty(this, "message", { get: function() {
          return message;
        } });
        if (Error.captureStackTrace)
          Error.captureStackTrace(this, CustomError);
        else
          Object.defineProperty(this, "stack", { value: new Error().stack || "" });
        if (properties)
          merge(this, properties);
      }
      CustomError.prototype = Object.create(Error.prototype, {
        constructor: {
          value: CustomError,
          writable: true,
          enumerable: false,
          configurable: true
        },
        name: {
          get: function get() {
            return name;
          },
          set: void 0,
          enumerable: false,
          // configurable: false would accurately preserve the behavior of
          // the original, but I'm guessing that was not intentional.
          // For an actual error subclass, this property would
          // be configurable.
          configurable: true
        },
        toString: {
          value: function value() {
            return this.name + ": " + this.message;
          },
          writable: true,
          enumerable: false,
          configurable: true
        }
      });
      return CustomError;
    }
    util.newError = newError;
    util.ProtocolError = newError("ProtocolError");
    util.oneOfGetter = function getOneOf(fieldNames) {
      var fieldMap = {};
      for (var i3 = 0; i3 < fieldNames.length; ++i3)
        fieldMap[fieldNames[i3]] = 1;
      return function() {
        for (var keys = Object.keys(this), i5 = keys.length - 1; i5 > -1; --i5)
          if (fieldMap[keys[i5]] === 1 && this[keys[i5]] !== void 0 && this[keys[i5]] !== null)
            return keys[i5];
      };
    };
    util.oneOfSetter = function setOneOf(fieldNames) {
      return function(name) {
        for (var i3 = 0; i3 < fieldNames.length; ++i3)
          if (fieldNames[i3] !== name)
            delete this[fieldNames[i3]];
      };
    };
    util.toJSONOptions = {
      longs: String,
      enums: String,
      bytes: String,
      json: true
    };
    util._configure = function() {
      var Buffer2 = util.Buffer;
      if (!Buffer2) {
        util._Buffer_from = util._Buffer_allocUnsafe = null;
        return;
      }
      util._Buffer_from = Buffer2.from !== Uint8Array.from && Buffer2.from || /* istanbul ignore next */
      function Buffer_from(value, encoding) {
        return new Buffer2(value, encoding);
      };
      util._Buffer_allocUnsafe = Buffer2.allocUnsafe || /* istanbul ignore next */
      function Buffer_allocUnsafe(size) {
        return new Buffer2(size);
      };
    };
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer.js
var require_writer = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer.js"(exports2, module2) {
    "use strict";
    module2.exports = Writer;
    var util = require_minimal();
    var BufferWriter;
    var LongBits = util.LongBits;
    var base64 = util.base64;
    var utf8 = util.utf8;
    function Op(fn, len, val) {
      this.fn = fn;
      this.len = len;
      this.next = void 0;
      this.val = val;
    }
    function noop() {
    }
    function State(writer) {
      this.head = writer.head;
      this.tail = writer.tail;
      this.len = writer.len;
      this.next = writer.states;
    }
    function Writer() {
      this.len = 0;
      this.head = new Op(noop, 0, 0);
      this.tail = this.head;
      this.states = null;
    }
    var create = function create2() {
      return util.Buffer ? function create_buffer_setup() {
        return (Writer.create = function create_buffer() {
          return new BufferWriter();
        })();
      } : function create_array() {
        return new Writer();
      };
    };
    Writer.create = create();
    Writer.alloc = function alloc(size) {
      return new util.Array(size);
    };
    if (util.Array !== Array)
      Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);
    Writer.prototype._push = function push(fn, len, val) {
      this.tail = this.tail.next = new Op(fn, len, val);
      this.len += len;
      return this;
    };
    function writeByte(val, buf, pos) {
      buf[pos] = val & 255;
    }
    function writeVarint32(val, buf, pos) {
      while (val > 127) {
        buf[pos++] = val & 127 | 128;
        val >>>= 7;
      }
      buf[pos] = val;
    }
    function VarintOp(len, val) {
      this.len = len;
      this.next = void 0;
      this.val = val;
    }
    VarintOp.prototype = Object.create(Op.prototype);
    VarintOp.prototype.fn = writeVarint32;
    Writer.prototype.uint32 = function write_uint32(value) {
      this.len += (this.tail = this.tail.next = new VarintOp(
        (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5,
        value
      )).len;
      return this;
    };
    Writer.prototype.int32 = function write_int32(value) {
      return value < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value);
    };
    Writer.prototype.sint32 = function write_sint32(value) {
      return this.uint32((value << 1 ^ value >> 31) >>> 0);
    };
    function writeVarint64(val, buf, pos) {
      while (val.hi) {
        buf[pos++] = val.lo & 127 | 128;
        val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
        val.hi >>>= 7;
      }
      while (val.lo > 127) {
        buf[pos++] = val.lo & 127 | 128;
        val.lo = val.lo >>> 7;
      }
      buf[pos++] = val.lo;
    }
    Writer.prototype.uint64 = function write_uint64(value) {
      var bits = LongBits.from(value);
      return this._push(writeVarint64, bits.length(), bits);
    };
    Writer.prototype.int64 = Writer.prototype.uint64;
    Writer.prototype.sint64 = function write_sint64(value) {
      var bits = LongBits.from(value).zzEncode();
      return this._push(writeVarint64, bits.length(), bits);
    };
    Writer.prototype.bool = function write_bool(value) {
      return this._push(writeByte, 1, value ? 1 : 0);
    };
    function writeFixed32(val, buf, pos) {
      buf[pos] = val & 255;
      buf[pos + 1] = val >>> 8 & 255;
      buf[pos + 2] = val >>> 16 & 255;
      buf[pos + 3] = val >>> 24;
    }
    Writer.prototype.fixed32 = function write_fixed32(value) {
      return this._push(writeFixed32, 4, value >>> 0);
    };
    Writer.prototype.sfixed32 = Writer.prototype.fixed32;
    Writer.prototype.fixed64 = function write_fixed64(value) {
      var bits = LongBits.from(value);
      return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);
    };
    Writer.prototype.sfixed64 = Writer.prototype.fixed64;
    Writer.prototype.float = function write_float(value) {
      return this._push(util.float.writeFloatLE, 4, value);
    };
    Writer.prototype.double = function write_double(value) {
      return this._push(util.float.writeDoubleLE, 8, value);
    };
    var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) {
      buf.set(val, pos);
    } : function writeBytes_for(val, buf, pos) {
      for (var i3 = 0; i3 < val.length; ++i3)
        buf[pos + i3] = val[i3];
    };
    Writer.prototype.bytes = function write_bytes(value) {
      var len = value.length >>> 0;
      if (!len)
        return this._push(writeByte, 1, 0);
      if (util.isString(value)) {
        var buf = Writer.alloc(len = base64.length(value));
        base64.decode(value, buf, 0);
        value = buf;
      }
      return this.uint32(len)._push(writeBytes, len, value);
    };
    Writer.prototype.string = function write_string(value) {
      var len = utf8.length(value);
      return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0);
    };
    Writer.prototype.fork = function fork() {
      this.states = new State(this);
      this.head = this.tail = new Op(noop, 0, 0);
      this.len = 0;
      return this;
    };
    Writer.prototype.reset = function reset() {
      if (this.states) {
        this.head = this.states.head;
        this.tail = this.states.tail;
        this.len = this.states.len;
        this.states = this.states.next;
      } else {
        this.head = this.tail = new Op(noop, 0, 0);
        this.len = 0;
      }
      return this;
    };
    Writer.prototype.ldelim = function ldelim() {
      var head = this.head, tail = this.tail, len = this.len;
      this.reset().uint32(len);
      if (len) {
        this.tail.next = head.next;
        this.tail = tail;
        this.len += len;
      }
      return this;
    };
    Writer.prototype.finish = function finish() {
      var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0;
      while (head) {
        head.fn(head.val, buf, pos);
        pos += head.len;
        head = head.next;
      }
      return buf;
    };
    Writer._configure = function(BufferWriter_) {
      BufferWriter = BufferWriter_;
      Writer.create = create();
      BufferWriter._configure();
    };
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer_buffer.js
var require_writer_buffer = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer_buffer.js"(exports2, module2) {
    "use strict";
    module2.exports = BufferWriter;
    var Writer = require_writer();
    (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
    var util = require_minimal();
    function BufferWriter() {
      Writer.call(this);
    }
    BufferWriter._configure = function() {
      BufferWriter.alloc = util._Buffer_allocUnsafe;
      BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) {
        buf.set(val, pos);
      } : function writeBytesBuffer_copy(val, buf, pos) {
        if (val.copy)
          val.copy(buf, pos, 0, val.length);
        else for (var i3 = 0; i3 < val.length; )
          buf[pos++] = val[i3++];
      };
    };
    BufferWriter.prototype.bytes = function write_bytes_buffer(value) {
      if (util.isString(value))
        value = util._Buffer_from(value, "base64");
      var len = value.length >>> 0;
      this.uint32(len);
      if (len)
        this._push(BufferWriter.writeBytesBuffer, len, value);
      return this;
    };
    function writeStringBuffer(val, buf, pos) {
      if (val.length < 40)
        util.utf8.write(val, buf, pos);
      else if (buf.utf8Write)
        buf.utf8Write(val, pos);
      else
        buf.write(val, pos);
    }
    BufferWriter.prototype.string = function write_string_buffer(value) {
      var len = util.Buffer.byteLength(value);
      this.uint32(len);
      if (len)
        this._push(writeStringBuffer, len, value);
      return this;
    };
    BufferWriter._configure();
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/reader.js
var require_reader = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/reader.js"(exports2, module2) {
    "use strict";
    module2.exports = Reader;
    var util = require_minimal();
    var BufferReader;
    var LongBits = util.LongBits;
    var utf8 = util.utf8;
    function indexOutOfRange(reader, writeLength) {
      return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
    }
    function Reader(buffer) {
      this.buf = buffer;
      this.pos = 0;
      this.len = buffer.length;
    }
    var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) {
      if (buffer instanceof Uint8Array || Array.isArray(buffer))
        return new Reader(buffer);
      throw Error("illegal buffer");
    } : function create_array2(buffer) {
      if (Array.isArray(buffer))
        return new Reader(buffer);
      throw Error("illegal buffer");
    };
    var create = function create2() {
      return util.Buffer ? function create_buffer_setup(buffer) {
        return (Reader.create = function create_buffer(buffer2) {
          return util.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2);
        })(buffer);
      } : create_array;
    };
    Reader.create = create();
    Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */
    util.Array.prototype.slice;
    Reader.prototype.uint32 = /* @__PURE__ */ function read_uint32_setup() {
      var value = 4294967295;
      return function read_uint32() {
        value = (this.buf[this.pos] & 127) >>> 0;
        if (this.buf[this.pos++] < 128) return value;
        value = (value | (this.buf[this.pos] & 127) << 7) >>> 0;
        if (this.buf[this.pos++] < 128) return value;
        value = (value | (this.buf[this.pos] & 127) << 14) >>> 0;
        if (this.buf[this.pos++] < 128) return value;
        value = (value | (this.buf[this.pos] & 127) << 21) >>> 0;
        if (this.buf[this.pos++] < 128) return value;
        value = (value | (this.buf[this.pos] & 15) << 28) >>> 0;
        if (this.buf[this.pos++] < 128) return value;
        if ((this.pos += 5) > this.len) {
          this.pos = this.len;
          throw indexOutOfRange(this, 10);
        }
        return value;
      };
    }();
    Reader.prototype.int32 = function read_int32() {
      return this.uint32() | 0;
    };
    Reader.prototype.sint32 = function read_sint32() {
      var value = this.uint32();
      return value >>> 1 ^ -(value & 1) | 0;
    };
    function readLongVarint() {
      var bits = new LongBits(0, 0);
      var i3 = 0;
      if (this.len - this.pos > 4) {
        for (; i3 < 4; ++i3) {
          bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i3 * 7) >>> 0;
          if (this.buf[this.pos++] < 128)
            return bits;
        }
        bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;
        bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;
        if (this.buf[this.pos++] < 128)
          return bits;
        i3 = 0;
      } else {
        for (; i3 < 3; ++i3) {
          if (this.pos >= this.len)
            throw indexOutOfRange(this);
          bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i3 * 7) >>> 0;
          if (this.buf[this.pos++] < 128)
            return bits;
        }
        bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i3 * 7) >>> 0;
        return bits;
      }
      if (this.len - this.pos > 4) {
        for (; i3 < 5; ++i3) {
          bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i3 * 7 + 3) >>> 0;
          if (this.buf[this.pos++] < 128)
            return bits;
        }
      } else {
        for (; i3 < 5; ++i3) {
          if (this.pos >= this.len)
            throw indexOutOfRange(this);
          bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i3 * 7 + 3) >>> 0;
          if (this.buf[this.pos++] < 128)
            return bits;
        }
      }
      throw Error("invalid varint encoding");
    }
    Reader.prototype.bool = function read_bool() {
      return this.uint32() !== 0;
    };
    function readFixed32_end(buf, end) {
      return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0;
    }
    Reader.prototype.fixed32 = function read_fixed32() {
      if (this.pos + 4 > this.len)
        throw indexOutOfRange(this, 4);
      return readFixed32_end(this.buf, this.pos += 4);
    };
    Reader.prototype.sfixed32 = function read_sfixed32() {
      if (this.pos + 4 > this.len)
        throw indexOutOfRange(this, 4);
      return readFixed32_end(this.buf, this.pos += 4) | 0;
    };
    function readFixed64() {
      if (this.pos + 8 > this.len)
        throw indexOutOfRange(this, 8);
      return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));
    }
    Reader.prototype.float = function read_float() {
      if (this.pos + 4 > this.len)
        throw indexOutOfRange(this, 4);
      var value = util.float.readFloatLE(this.buf, this.pos);
      this.pos += 4;
      return value;
    };
    Reader.prototype.double = function read_double() {
      if (this.pos + 8 > this.len)
        throw indexOutOfRange(this, 4);
      var value = util.float.readDoubleLE(this.buf, this.pos);
      this.pos += 8;
      return value;
    };
    Reader.prototype.bytes = function read_bytes() {
      var length = this.uint32(), start = this.pos, end = this.pos + length;
      if (end > this.len)
        throw indexOutOfRange(this, length);
      this.pos += length;
      if (Array.isArray(this.buf))
        return this.buf.slice(start, end);
      if (start === end) {
        var nativeBuffer = util.Buffer;
        return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0);
      }
      return this._slice.call(this.buf, start, end);
    };
    Reader.prototype.string = function read_string() {
      var bytes = this.bytes();
      return utf8.read(bytes, 0, bytes.length);
    };
    Reader.prototype.skip = function skip(length) {
      if (typeof length === "number") {
        if (this.pos + length > this.len)
          throw indexOutOfRange(this, length);
        this.pos += length;
      } else {
        do {
          if (this.pos >= this.len)
            throw indexOutOfRange(this);
        } while (this.buf[this.pos++] & 128);
      }
      return this;
    };
    Reader.prototype.skipType = function(wireType) {
      switch (wireType) {
        case 0:
          this.skip();
          break;
        case 1:
          this.skip(8);
          break;
        case 2:
          this.skip(this.uint32());
          break;
        case 3:
          while ((wireType = this.uint32() & 7) !== 4) {
            this.skipType(wireType);
          }
          break;
        case 5:
          this.skip(4);
          break;
        /* istanbul ignore next */
        default:
          throw Error("invalid wire type " + wireType + " at offset " + this.pos);
      }
      return this;
    };
    Reader._configure = function(BufferReader_) {
      BufferReader = BufferReader_;
      Reader.create = create();
      BufferReader._configure();
      var fn = util.Long ? "toLong" : (
        /* istanbul ignore next */
        "toNumber"
      );
      util.merge(Reader.prototype, {
        int64: function read_int64() {
          return readLongVarint.call(this)[fn](false);
        },
        uint64: function read_uint64() {
          return readLongVarint.call(this)[fn](true);
        },
        sint64: function read_sint64() {
          return readLongVarint.call(this).zzDecode()[fn](false);
        },
        fixed64: function read_fixed64() {
          return readFixed64.call(this)[fn](true);
        },
        sfixed64: function read_sfixed64() {
          return readFixed64.call(this)[fn](false);
        }
      });
    };
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/reader_buffer.js
var require_reader_buffer = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/reader_buffer.js"(exports2, module2) {
    "use strict";
    module2.exports = BufferReader;
    var Reader = require_reader();
    (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
    var util = require_minimal();
    function BufferReader(buffer) {
      Reader.call(this, buffer);
    }
    BufferReader._configure = function() {
      if (util.Buffer)
        BufferReader.prototype._slice = util.Buffer.prototype.slice;
    };
    BufferReader.prototype.string = function read_string_buffer() {
      var len = this.uint32();
      return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len));
    };
    BufferReader._configure();
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/rpc/service.js
var require_service = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/rpc/service.js"(exports2, module2) {
    "use strict";
    module2.exports = Service;
    var util = require_minimal();
    (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
    function Service(rpcImpl, requestDelimited, responseDelimited) {
      if (typeof rpcImpl !== "function")
        throw TypeError("rpcImpl must be a function");
      util.EventEmitter.call(this);
      this.rpcImpl = rpcImpl;
      this.requestDelimited = Boolean(requestDelimited);
      this.responseDelimited = Boolean(responseDelimited);
    }
    Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {
      if (!request)
        throw TypeError("request must be specified");
      var self2 = this;
      if (!callback)
        return util.asPromise(rpcCall, self2, method, requestCtor, responseCtor, request);
      if (!self2.rpcImpl) {
        setTimeout(function() {
          callback(Error("already ended"));
        }, 0);
        return void 0;
      }
      try {
        return self2.rpcImpl(
          method,
          requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(),
          function rpcCallback(err, response) {
            if (err) {
              self2.emit("error", err, method);
              return callback(err);
            }
            if (response === null) {
              self2.end(
                /* endedByRPC */
                true
              );
              return void 0;
            }
            if (!(response instanceof responseCtor)) {
              try {
                response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response);
              } catch (err2) {
                self2.emit("error", err2, method);
                return callback(err2);
              }
            }
            self2.emit("data", response, method);
            return callback(null, response);
          }
        );
      } catch (err) {
        self2.emit("error", err, method);
        setTimeout(function() {
          callback(err);
        }, 0);
        return void 0;
      }
    };
    Service.prototype.end = function end(endedByRPC) {
      if (this.rpcImpl) {
        if (!endedByRPC)
          this.rpcImpl(null, null, null);
        this.rpcImpl = null;
        this.emit("end").off();
      }
      return this;
    };
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/rpc.js
var require_rpc = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/rpc.js"(exports2) {
    "use strict";
    var rpc = exports2;
    rpc.Service = require_service();
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/roots.js
var require_roots = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/roots.js"(exports2, module2) {
    "use strict";
    module2.exports = {};
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/index-minimal.js
var require_index_minimal = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/index-minimal.js"(exports2) {
    "use strict";
    var protobuf = exports2;
    protobuf.build = "minimal";
    protobuf.Writer = require_writer();
    protobuf.BufferWriter = require_writer_buffer();
    protobuf.Reader = require_reader();
    protobuf.BufferReader = require_reader_buffer();
    protobuf.util = require_minimal();
    protobuf.rpc = require_rpc();
    protobuf.roots = require_roots();
    protobuf.configure = configure;
    function configure() {
      protobuf.util._configure();
      protobuf.Writer._configure(protobuf.BufferWriter);
      protobuf.Reader._configure(protobuf.BufferReader);
    }
    configure();
  }
});

// ../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/minimal.js
var require_minimal2 = __commonJS({
  "../../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/minimal.js"(exports2, module2) {
    "use strict";
    module2.exports = require_index_minimal();
  }
});

// ../../../node_modules/.pnpm/@larksuiteoapi+node-sdk@1.59.0/node_modules/@larksuiteoapi/node-sdk/lib/index.js
var require_lib2 = __commonJS({
  "../../../node_modules/.pnpm/@larksuiteoapi+node-sdk@1.59.0/node_modules/@larksuiteoapi/node-sdk/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var axios = require_axios();
    var crypto = require("crypto");
    var qs = require_lib();
    var identity = require_lodash();
    var pickBy = require_lodash2();
    var fs2 = require("fs");
    var merge = require_lodash3();
    var qs$1 = require("querystring");
    var WebSocket3 = require_ws();
    function _interopDefaultLegacy(e3) {
      return e3 && typeof e3 === "object" && "default" in e3 ? e3 : { "default": e3 };
    }
    var axios__default = /* @__PURE__ */ _interopDefaultLegacy(axios);
    var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto);
    var identity__default = /* @__PURE__ */ _interopDefaultLegacy(identity);
    var pickBy__default = /* @__PURE__ */ _interopDefaultLegacy(pickBy);
    var fs__default = /* @__PURE__ */ _interopDefaultLegacy(fs2);
    var merge__default = /* @__PURE__ */ _interopDefaultLegacy(merge);
    var qs__default = /* @__PURE__ */ _interopDefaultLegacy(qs$1);
    var WebSocket__default = /* @__PURE__ */ _interopDefaultLegacy(WebSocket3);
    function __rest(s, e3) {
      var t = {};
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e3.indexOf(p) < 0)
        t[p] = s[p];
      if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i3 = 0, p = Object.getOwnPropertySymbols(s); i3 < p.length; i3++) {
          if (e3.indexOf(p[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i3]))
            t[p[i3]] = s[p[i3]];
        }
      return t;
    }
    function __awaiter(thisArg, _arguments, P3, generator) {
      function adopt(value) {
        return value instanceof P3 ? value : new P3(function(resolve4) {
          resolve4(value);
        });
      }
      return new (P3 || (P3 = Promise))(function(resolve4, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e3) {
            reject(e3);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e3) {
            reject(e3);
          }
        }
        function step(result) {
          result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    }
    function __values(o) {
      var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i3 = 0;
      if (m) return m.call(o);
      if (o && typeof o.length === "number") return {
        next: function() {
          if (o && i3 >= o.length) o = void 0;
          return { value: o && o[i3++], done: !o };
        }
      };
      throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }
    function __await(v3) {
      return this instanceof __await ? (this.v = v3, this) : new __await(v3);
    }
    function __asyncGenerator(thisArg, _arguments, generator) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var g3 = generator.apply(thisArg, _arguments || []), i3, q = [];
      return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
        return this;
      }, i3;
      function verb(n3) {
        if (g3[n3]) i3[n3] = function(v3) {
          return new Promise(function(a, b3) {
            q.push([n3, v3, a, b3]) > 1 || resume(n3, v3);
          });
        };
      }
      function resume(n3, v3) {
        try {
          step(g3[n3](v3));
        } catch (e3) {
          settle(q[0][3], e3);
        }
      }
      function step(r3) {
        r3.value instanceof __await ? Promise.resolve(r3.value.v).then(fulfill, reject) : settle(q[0][2], r3);
      }
      function fulfill(value) {
        resume("next", value);
      }
      function reject(value) {
        resume("throw", value);
      }
      function settle(f, v3) {
        if (f(v3), q.shift(), q.length) resume(q[0][0], q[0][1]);
      }
    }
    function __asyncValues(o) {
      if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
      var m = o[Symbol.asyncIterator], i3;
      return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
        return this;
      }, i3);
      function verb(n3) {
        i3[n3] = o[n3] && function(v3) {
          return new Promise(function(resolve4, reject) {
            v3 = o[n3](v3), settle(resolve4, reject, v3.done, v3.value);
          });
        };
      }
      function settle(resolve4, reject, d3, v3) {
        Promise.resolve(v3).then(function(v5) {
          resolve4({ value: v5, done: d3 });
        }, reject);
      }
    }
    var defaultHttpInstance = axios__default["default"].create();
    defaultHttpInstance.interceptors.request.use((req) => {
      if (req.headers) {
        req.headers["User-Agent"] = "oapi-node-sdk/1.0.0";
      }
      return req;
    }, void 0, { synchronous: true });
    defaultHttpInstance.interceptors.response.use((resp) => {
      if (resp.config["$return_headers"]) {
        return {
          data: resp.data,
          headers: resp.headers
        };
      }
      return resp.data;
    });
    exports2.AppType = void 0;
    (function(AppType) {
      AppType[AppType["SelfBuild"] = 0] = "SelfBuild";
      AppType[AppType["ISV"] = 1] = "ISV";
    })(exports2.AppType || (exports2.AppType = {}));
    exports2.Domain = void 0;
    (function(Domain) {
      Domain[Domain["Feishu"] = 0] = "Feishu";
      Domain[Domain["Lark"] = 1] = "Lark";
    })(exports2.Domain || (exports2.Domain = {}));
    exports2.LoggerLevel = void 0;
    (function(LoggerLevel) {
      LoggerLevel[LoggerLevel["fatal"] = 0] = "fatal";
      LoggerLevel[LoggerLevel["error"] = 1] = "error";
      LoggerLevel[LoggerLevel["warn"] = 2] = "warn";
      LoggerLevel[LoggerLevel["info"] = 3] = "info";
      LoggerLevel[LoggerLevel["debug"] = 4] = "debug";
      LoggerLevel[LoggerLevel["trace"] = 5] = "trace";
    })(exports2.LoggerLevel || (exports2.LoggerLevel = {}));
    var CEventType = Symbol("event-type");
    var CTenantKey = Symbol("tenant-key");
    var CAppTicket = Symbol("app-ticket");
    var CTenantAccessToken = Symbol("tenant-access-token");
    var CWithHelpdeskAuthorization = Symbol("with-helpdesk-authorization");
    var CWithUserAccessToken = Symbol("with-user-access-token");
    var CUserAccessToken = Symbol("user-access-token");
    var CAilySessionRecord = Symbol("aily-session-record");
    var string2Base64 = (content) => Buffer.from(content).toString("base64");
    var DefaultCache = class {
      constructor() {
        this.values = /* @__PURE__ */ new Map();
      }
      // When there is a namespace, splice the namespace and key to form a new key
      getCacheKey(key, namespace) {
        if (namespace) {
          return `${namespace}/${key.toString()}`;
        }
        return key;
      }
      get(key, options) {
        return __awaiter(this, void 0, void 0, function* () {
          const cacheKey = this.getCacheKey(key, options === null || options === void 0 ? void 0 : options.namespace);
          const data = this.values.get(cacheKey);
          if (data) {
            const { value, expiredTime } = data;
            if (!expiredTime || expiredTime - (/* @__PURE__ */ new Date()).getTime() > 0) {
              return value;
            }
          }
          return void 0;
        });
      }
      set(key, value, expiredTime, options) {
        return __awaiter(this, void 0, void 0, function* () {
          const cacheKey = this.getCacheKey(key, options === null || options === void 0 ? void 0 : options.namespace);
          this.values.set(cacheKey, {
            value,
            expiredTime
          });
          return true;
        });
      }
    };
    var internalCache = new DefaultCache();
    var AESCipher = class {
      constructor(key) {
        const hash = crypto__default["default"].createHash("sha256");
        hash.update(key);
        this.key = hash.digest();
      }
      decrypt(encrypt) {
        const encryptBuffer = Buffer.from(encrypt, "base64");
        const decipher = crypto__default["default"].createDecipheriv("aes-256-cbc", this.key, encryptBuffer.slice(0, 16));
        let decrypted = decipher.update(encryptBuffer.slice(16).toString("hex"), "hex", "utf8");
        decrypted += decipher.final("utf8");
        return decrypted;
      }
    };
    var formatDomain = (domain) => {
      switch (domain) {
        case exports2.Domain.Feishu:
          return "https://open.feishu.cn";
        case exports2.Domain.Lark:
          return "https://open.larksuite.com";
        default:
          return domain;
      }
    };
    var fillApiPath = (apiPath, pathSupplement = {}) => apiPath.replace(/:([^/]+)/g, (_, $1) => {
      if (pathSupplement[$1] !== void 0) {
        return pathSupplement[$1];
      }
      throw new Error(`request miss ${$1} path argument`);
    });
    var assert = (predication, callback) => __awaiter(void 0, void 0, void 0, function* () {
      const isInvoke = typeof predication === "function" ? predication() : predication;
      if (isInvoke) {
        yield callback();
      }
    });
    var formatUrl = (url) => url ? url.replace(/^\//, "") : "";
    var pick = (obj, keys = []) => {
      const result = {};
      if (!obj) {
        return result;
      }
      keys.forEach((key) => {
        if (Object.prototype.hasOwnProperty.call(obj, key)) {
          result[key] = obj[key];
        }
      });
      return result;
    };
    var formatErrors = (e3) => {
      var _a;
      if (e3 instanceof axios.AxiosError) {
        const { message, response, request, config } = pick(e3, [
          "message",
          "response",
          "request",
          "config"
        ]);
        const filteredErrorInfo = {
          message,
          config: pick(config, ["data", "url", "params", "method"]),
          request: pick(request, ["protocol", "host", "path", "method"]),
          response: pick(response, ["data", "status", "statusText"])
        };
        const errors = [filteredErrorInfo];
        const specificError = (_a = e3 === null || e3 === void 0 ? void 0 : e3.response) === null || _a === void 0 ? void 0 : _a.data;
        if (specificError) {
          errors.push(Object.assign(Object.assign({}, specificError), specificError.error ? specificError.error : {}));
        }
        return errors;
      }
      return [e3];
    };
    var Client$16 = class {
      constructor() {
        this.acs = {
          /**
           * access_record.access_photo
           */
          accessRecordAccessPhoto: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=access_record.access_photo&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get document }
             *
             * 下载开门时的人脸识别图片
             *
             * 用户在门禁考勤机上成功开门或打卡后，智能门禁应用都会生成一条门禁记录，对于使用人脸识别方式进行开门的识别记录，还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 门禁记录
           */
          accessRecord: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=access_record&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list document }
             *
             * 获取门禁记录列表
             *
             * 用户在门禁考勤机上成功开门或打卡后，智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 门禁设备
           */
          device: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=device&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list document }
             *
             * 获取门禁设备列表
             *
             * 使用该接口获取租户内所有门禁设备。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/devices`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * rule_external
           */
          ruleExternal: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=acs&resource=rule_external&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=acs&resource=rule_external&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=device_bind&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=device_bind&project=acs&resource=rule_external&version=v1 document }
             */
            deviceBind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=acs&resource=rule_external&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user.face
           */
          userFace: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user.face&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get document }
             *
             * 下载人脸图片
             *
             * 对于已经录入人脸图片的用户，可以使用该接口下载用户人脸图片。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id/face`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user.face&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update document }
             *
             * 上传人脸图片
             *
             * 用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id/face`, path2),
                method: "PUT",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          /**
           * 用户管理
           */
          user: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get document }
             *
             * 获取单个用户信息
             *
             * 该接口用于获取智能门禁中单个用户的信息。
             *
             * 只能获取已加入智能门禁权限组的用户
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list document }
             *
             * 获取用户列表
             *
             * 使用该接口获取智能门禁中所有用户信息。
             *
             * 只能获取已加入智能门禁权限组的用户。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/users`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch document }
             *
             * 修改用户部分信息
             *
             * 飞书智能门禁在人脸识别成功后会有韦根信号输出，输出用户的卡号。;对于使用韦根协议的门禁系统，企业可使用该接口录入用户卡号。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * visitor
           */
          visitor: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=visitor&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=acs&resource=visitor&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/visitors`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=acs&resource=visitor&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=acs&resource=visitor&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * access_record.access_photo
             */
            accessRecordAccessPhoto: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=access_record.access_photo&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record-access_photo/get document }
               *
               * 下载开门时的人脸识别图片
               *
               * 用户在门禁考勤机上成功开门或打卡后，智能门禁应用都会生成一条门禁记录，对于使用人脸识别方式进行开门的识别记录，还会有抓拍图。;;可以用该接口下载开门时的人脸识别照片。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 门禁记录
             */
            accessRecord: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=access_record&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/list document }
               *
               * 获取门禁记录列表
               *
               * 用户在门禁考勤机上成功开门或打卡后，智能门禁应用都会生成一条门禁记录。;;该接口返回满足查询参数的识别记录。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/access_records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 门禁设备
             */
            device: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=device&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/device/list document }
               *
               * 获取门禁设备列表
               *
               * 使用该接口获取租户内所有门禁设备。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/devices`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * rule_external
             */
            ruleExternal: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=acs&resource=rule_external&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=acs&resource=rule_external&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=device_bind&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=device_bind&project=acs&resource=rule_external&version=v1 document }
               */
              deviceBind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=rule_external&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=acs&resource=rule_external&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/rule_external`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user.face
             */
            userFace: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user.face&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/get document }
               *
               * 下载人脸图片
               *
               * 对于已经录入人脸图片的用户，可以使用该接口下载用户人脸图片。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id/face`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user.face&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user-face/update document }
               *
               * 上传人脸图片
               *
               * 用户需要录入人脸图片才可以使用门禁考勤机。使用该 API 上传门禁用户的人脸图片。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id/face`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * 用户管理
             */
            user: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/get document }
               *
               * 获取单个用户信息
               *
               * 该接口用于获取智能门禁中单个用户的信息。
               *
               * 只能获取已加入智能门禁权限组的用户
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/acs/v1/users`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/list document }
               *
               * 获取用户列表
               *
               * 使用该接口获取智能门禁中所有用户信息。
               *
               * 只能获取已加入智能门禁权限组的用户。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=user&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/user/patch document }
               *
               * 修改用户部分信息
               *
               * 飞书智能门禁在人脸识别成功后会有韦根信号输出，输出用户的卡号。;对于使用韦根协议的门禁系统，企业可使用该接口录入用户卡号。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/users/:user_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * visitor
             */
            visitor: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=visitor&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=acs&resource=visitor&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/visitors`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=acs&resource=visitor&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=acs&resource=visitor&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$15 = class extends Client$16 {
      constructor() {
        super(...arguments);
        this.admin = {
          /**
           * 部门维度的数据报表
           */
          adminDeptStat: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=admin_dept_stat&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list document }
             *
             * 获取部门维度的用户活跃和功能使用数据
             *
             * 该接口用于获取部门维度的用户活跃和功能使用数据，即IM（即时通讯）、日历、云文档、音视频会议功能的使用数据。
             *
             * - 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出（UTC+8）
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/admin_dept_stats`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户维度的数据报表
           */
          adminUserStat: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=admin_user_stat&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list document }
             *
             * 获取用户维度的用户活跃和功能使用数据
             *
             * 用于获取用户维度的用户活跃和功能使用数据，即IM（即时通讯）、日历、云文档、音视频会议功能的使用数据。
             *
             * - 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出（UTC+8）
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/admin_user_stats`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 行为审计日志（灰度租户可见）
           */
          auditInfo: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/audit_infos`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=audit_info&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/audit_data_get document }
             *
             * 用户行为日志搜索
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/audit_infos`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 勋章
           */
          badge: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create document }
             *
             * 创建勋章
             *
             * 使用该接口可以创建一枚完整的勋章信息，一个租户下最多可创建1000枚勋章。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get document }
             *
             * 获取勋章详情
             *
             * 可以通过该接口查询勋章的详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list document }
             *
             * 获取勋章列表
             *
             * 可以通过该接口列出租户下所有的勋章，勋章的排列顺序是按照创建时间倒序排列。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update document }
             *
             * 修改勋章信息
             *
             * 通过该接口可以修改勋章的信息
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 勋章授予名单
           */
          badgeGrant: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create document }
             *
             * 创建勋章的授予名单
             *
             * 通过该接口可以为特定勋章创建一份授予名单，一枚勋章下最多可创建1000份授予名单。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete document }
             *
             * 删除授予名单
             *
             * 通过该接口可以删除特定授予名单的信息
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get document }
             *
             * 获取授予名单的信息
             *
             * 通过该接口可以获取特定授予名单的信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list document }
             *
             * 获取勋章的授予名单列表
             *
             * 通过该接口可以获取特定勋章下的授予名单列表，授予名单的排列顺序按照创建时间倒序排列。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update document }
             *
             * 修改授予名单
             *
             * 通过该接口可以修改特定授予名单的相关信息
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 勋章图片
           */
          badgeImage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge_image&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create document }
             *
             * 上传勋章图片
             *
             * 通过该接口可以上传勋章详情图、挂饰图的文件，获取对应的文件key
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/badge_images`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          /**
           * 登录密码管理
           */
          password: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=admin&resource=password&apiName=reset&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset document }
             *
             * 重置密码
             *
             * 重置用户的企业邮箱密码，仅当用户的邮箱和企业邮箱(别名)一致时生效，可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁：当用户的登录凭证与飞书企业邮箱一致时，目前飞书登录流程要求用户输入验证码，由于飞书邮箱无单独的帐号体系，则未登录时无法收取邮箱验证码，即陷入死锁
             */
            reset: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/admin/v1/password/reset`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 部门维度的数据报表
             */
            adminDeptStat: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=admin_dept_stat&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list document }
               *
               * 获取部门维度的用户活跃和功能使用数据
               *
               * 该接口用于获取部门维度的用户活跃和功能使用数据，即IM（即时通讯）、日历、云文档、音视频会议功能的使用数据。
               *
               * - 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出（UTC+8）
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/admin_dept_stats`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户维度的数据报表
             */
            adminUserStat: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=admin_user_stat&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list document }
               *
               * 获取用户维度的用户活跃和功能使用数据
               *
               * 用于获取用户维度的用户活跃和功能使用数据，即IM（即时通讯）、日历、云文档、音视频会议功能的使用数据。
               *
               * - 只有企业自建应用才有权限调用此接口;;- 当天的数据会在第二天的早上九点半产出（UTC+8）
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/admin_user_stats`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 行为审计日志（灰度租户可见）
             */
            auditInfo: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/admin/v1/audit_infos`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=audit_info&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/audit_data_get document }
               *
               * 用户行为日志搜索
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/audit_infos`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 勋章
             */
            badge: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create document }
               *
               * 创建勋章
               *
               * 使用该接口可以创建一枚完整的勋章信息，一个租户下最多可创建1000枚勋章。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get document }
               *
               * 获取勋章详情
               *
               * 可以通过该接口查询勋章的详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list document }
               *
               * 获取勋章列表
               *
               * 可以通过该接口列出租户下所有的勋章，勋章的排列顺序是按照创建时间倒序排列。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update document }
               *
               * 修改勋章信息
               *
               * 通过该接口可以修改勋章的信息
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 勋章授予名单
             */
            badgeGrant: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create document }
               *
               * 创建勋章的授予名单
               *
               * 通过该接口可以为特定勋章创建一份授予名单，一枚勋章下最多可创建1000份授予名单。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete document }
               *
               * 删除授予名单
               *
               * 通过该接口可以删除特定授予名单的信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get document }
               *
               * 获取授予名单的信息
               *
               * 通过该接口可以获取特定授予名单的信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list document }
               *
               * 获取勋章的授予名单列表
               *
               * 通过该接口可以获取特定勋章下的授予名单列表，授予名单的排列顺序按照创建时间倒序排列。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge.grant&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update document }
               *
               * 修改授予名单
               *
               * 通过该接口可以修改特定授予名单的相关信息
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 勋章图片
             */
            badgeImage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=badge_image&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create document }
               *
               * 上传勋章图片
               *
               * 通过该接口可以上传勋章详情图、挂饰图的文件，获取对应的文件key
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/badge_images`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * 登录密码管理
             */
            password: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=admin&resource=password&apiName=reset&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset document }
               *
               * 重置密码
               *
               * 重置用户的企业邮箱密码，仅当用户的邮箱和企业邮箱(别名)一致时生效，可用于处理飞书企业邮箱登录死锁的问题。;;邮箱死锁：当用户的登录凭证与飞书企业邮箱一致时，目前飞书登录流程要求用户输入验证码，由于飞书邮箱无单独的帐号体系，则未登录时无法收取邮箱验证码，即陷入死锁
               */
              reset: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/admin/v1/password/reset`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$14 = class extends Client$15 {
      constructor() {
        super(...arguments);
        this.aily = {
          v1: {
            /**
             * aily_session.aily_message
             */
            ailySessionAilyMessage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.aily_message&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=aily_session.aily_message&version=v1 document }
               *
               * 该 API 用于向某个飞书智能伙伴应用发送一条消息（Message）。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.aily_message&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=aily_session.aily_message&version=v1 document }
               *
               * 该 API 用于获取某个飞书智能伙伴应用的消息（Message）的详细信息；包括消息的内容、发送人等。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.aily_message&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=aily&resource=aily_session.aily_message&version=v1 document }
               *
               * 该 API 用于批量获取飞书智能伙伴应用的消息（Message）的详细信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * aily_session
             */
            ailySession: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=aily_session&version=v1 document }
               *
               * 该 API 用于创建与某个飞书智能伙伴应用的一次会话（Session）。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=aily&resource=aily_session&version=v1 document }
               *
               * 该 API 用于销毁与某个飞书智能伙伴应用的一次会话（Session），当会话销毁后、无法继续在会话中创建 / 拉取消息。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=aily_session&version=v1 document }
               *
               * 该 API 用于获取与某个飞书智能伙伴应用的一次会话（Session）的详细信息，包括会话的状态、渠道信息、创建时间等。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=aily&resource=aily_session&version=v1 document }
               *
               * 该 API 用于更新与某个飞书智能伙伴应用的一次会话（Session）。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * aily_session.run
             */
            ailySessionRun: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.run&apiName=cancel&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=cancel&project=aily&resource=aily_session.run&version=v1 document }
               *
               * 该 API 用于取消指定的运行（Run）。
               */
              cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.run&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=aily_session.run&version=v1 document }
               *
               * 该 API 用于启动一次运行（Run）。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.run&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=aily_session.run&version=v1 document }
               *
               * 该 API 用于获取运行（Run）的详细信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=aily_session.run&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=aily&resource=aily_session.run&version=v1 document }
               *
               * 该 API 用于批量获取运行（Run）的详细信息。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app.data_asset
             */
            appDataAsset: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=app.data_asset&version=v1 document }
               *
               * 创建数据知识
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=aily&resource=app.data_asset&version=v1 document }
               *
               * 删除数据知识
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=app.data_asset&version=v1 document }
               *
               * 获取数据知识
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=aily&resource=app.data_asset&version=v1 document }
               *
               * 获取数据与知识列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=upload_file&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload_file&project=aily&resource=app.data_asset&version=v1 document }
               *
               * 上传数据知识文件
               */
              uploadFile: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * app.data_asset_tag
             */
            appDataAssetTag: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset_tag&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=aily&resource=app.data_asset_tag&version=v1 document }
               *
               * 获取数据与知识分类列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app.knowledge
             */
            appKnowledge: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.knowledge&apiName=ask&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=ask&project=aily&resource=app.knowledge&version=v1 document }
               *
               * 执行一次数据知识问答
               */
              ask: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app.skill
             */
            appSkill: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.skill&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=app.skill&version=v1 document }
               *
               * 该 API 用于获取某个飞书智能伙伴应用的技能（Skill）的详细信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.skill&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=aily&resource=app.skill&version=v1 document }
               *
               * 该 API 用于批量获取飞书智能伙伴应用的技能（Skill）的详细信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.skill&apiName=start&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=start&project=aily&resource=app.skill&version=v1 document }
               *
               * 该 API 用于执行飞书智能伙伴应用的技能（Skill）获取输出
               */
              start: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$13 = class extends Client$14 {
      constructor() {
        super(...arguments);
        this.apaas = {
          v1: {
            /**
             * app
             */
            app: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/apaas/v1/apps`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=app&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=apaas&resource=app&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/apps`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.audit_log
             */
            applicationAuditLog: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.audit_log&apiName=audit_log_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=audit_log_list&project=apaas&resource=application.audit_log&version=v1 document }
               *
               * 获取审计日志列表
               */
              auditLogList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.audit_log&apiName=data_change_log_detail&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=data_change_log_detail&project=apaas&resource=application.audit_log&version=v1 document }
               *
               * 获取数据变更日志详情
               */
              dataChangeLogDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.audit_log&apiName=data_change_logs_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=data_change_logs_list&project=apaas&resource=application.audit_log&version=v1 document }
               *
               * 获取数据变更日志列表
               */
              dataChangeLogsList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.audit_log&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=apaas&resource=application.audit_log&version=v1 document }
               *
               * 获取审计日志详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.environment_variable
             */
            applicationEnvironmentVariable: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.environment_variable&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=apaas&resource=application.environment_variable&version=v1 document }
               *
               * 查询环境变量详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.environment_variable&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=apaas&resource=application.environment_variable&version=v1 document }
               *
               * 查询环境变量列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.flow
             */
            applicationFlow: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.flow&apiName=execute&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=execute&project=apaas&resource=application.flow&version=v1 document }
               *
               * 流程执行接口
               */
              execute: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.function
             */
            applicationFunction: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.function&apiName=invoke&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=invoke&project=apaas&resource=application.function&version=v1 document }
               *
               * 执行函数
               */
              invoke: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.object
             */
            applicationObject: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object&apiName=oql_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=oql_query&project=apaas&resource=application.object&version=v1 document }
               *
               * 执行 OQL
               */
              oqlQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=apaas&resource=application.object&version=v1 document }
               *
               * 搜索记录
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.object.record
             */
            applicationObjectRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 记录批量创建
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 记录批量删除
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 批量查询对象记录
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 记录批量更新
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 创建记录
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 删除记录
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 更新记录
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.object.record&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=apaas&resource=application.object.record&version=v1 document }
               *
               * 获取记录
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.record_permission.member
             */
            applicationRecordPermissionMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.record_permission.member&apiName=batch_create_authorization&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create_authorization&project=apaas&resource=application.record_permission.member&version=v1 document }
               */
              batchCreateAuthorization: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.record_permission.member&apiName=batch_remove_authorization&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_remove_authorization&project=apaas&resource=application.record_permission.member&version=v1 document }
               */
              batchRemoveAuthorization: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.role.member
             */
            applicationRoleMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.role.member&apiName=batch_create_authorization&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create_authorization&project=apaas&resource=application.role.member&version=v1 document }
               *
               * 批量添加角色成员用户和部门
               */
              batchCreateAuthorization: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.role.member&apiName=batch_remove_authorization&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_remove_authorization&project=apaas&resource=application.role.member&version=v1 document }
               *
               * 批量删除角色成员用户和部门
               */
              batchRemoveAuthorization: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=application.role.member&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=apaas&resource=application.role.member&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * approval_instance
             */
            approvalInstance: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=approval_instance&apiName=cancel&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=cancel&project=apaas&resource=approval_instance&version=v1 document }
               */
              cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * approval_task
             */
            approvalTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=approval_task&apiName=add_assignee&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_assignee&project=apaas&resource=approval_task&version=v1 document }
               */
              addAssignee: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=approval_task&apiName=agree&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=agree&project=apaas&resource=approval_task&version=v1 document }
               */
              agree: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=approval_task&apiName=reject&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reject&project=apaas&resource=approval_task&version=v1 document }
               */
              reject: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=approval_task&apiName=transfer&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer&project=apaas&resource=approval_task&version=v1 document }
               */
              transfer: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * seat_activity
             */
            seatActivity: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/apaas/v1/seat_activities`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=seat_activity&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=apaas&resource=seat_activity&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/seat_activities`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * seat_assignment
             */
            seatAssignment: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/apaas/v1/seat_assignments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=seat_assignment&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=apaas&resource=seat_assignment&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/seat_assignments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_task
             */
            userTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=cc&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=cc&project=apaas&resource=user_task&version=v1 document }
               */
              cc: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=chat_group&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=chat_group&project=apaas&resource=user_task&version=v1 document }
               */
              chatGroup: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=expediting&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=expediting&project=apaas&resource=user_task&version=v1 document }
               */
              expediting: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=apaas&resource=user_task&version=v1 document }
               *
               * 获取任务列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_task/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=rollback&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=rollback&project=apaas&resource=user_task&version=v1 document }
               */
              rollback: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=user_task&apiName=rollback_points&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=rollback_points&project=apaas&resource=user_task&version=v1 document }
               */
              rollbackPoints: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workspace
             */
            workspace: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace&apiName=sql_commands&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=sql_commands&project=apaas&resource=workspace&version=v1 document }
               *
               * 执行 SQL
               */
              sqlCommands: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workspace.table
             */
            workspaceTable: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.table&apiName=records_batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=records_batch_update&project=apaas&resource=workspace.table&version=v1 document }
               *
               * 批量更新数据表中的记录
               */
              recordsBatchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.table&apiName=records_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=records_delete&project=apaas&resource=workspace.table&version=v1 document }
               *
               * 删除数据表中的记录
               */
              recordsDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.table&apiName=records_get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=records_get&project=apaas&resource=workspace.table&version=v1 document }
               *
               * 查询数据表数据记录
               */
              recordsGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.table&apiName=records_patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=records_patch&project=apaas&resource=workspace.table&version=v1 document }
               *
               * 按条件更新数据表中的记录
               */
              recordsPatch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.table&apiName=records_post&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=records_post&project=apaas&resource=workspace.table&version=v1 document }
               *
               * 向数据表中添加或更新记录
               */
              recordsPost: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workspace.view
             */
            workspaceView: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=apaas&resource=workspace.view&apiName=views_get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=views_get&project=apaas&resource=workspace.view&version=v1 document }
               */
              viewsGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$12 = class extends Client$13 {
      constructor() {
        super(...arguments);
        this.application = {
          /**
           * 应用红点
           */
          appBadge: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=app_badge&apiName=set&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set document }
             *
             * 更新应用红点
             *
             * 更新应用红点信息，用于工作台场景
             */
            set: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/app_badge/set`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 我的常用推荐规则
           */
          appRecommendRule: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/app_recommend_rules`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=app_recommend_rule&apiName=list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list document }
             *
             * 获取当前设置的推荐规则列表
             *
             * 获取当前设置的推荐规则列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/app_recommend_rules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 应用使用情况
           */
          applicationAppUsage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=department_overview&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview document }
             *
             * 获取多部门应用使用概览（灰度租户可见）
             *
             * 查看应用在某一天/某一周/某一个月的使用数据，可以根据部门做多层子部门的筛选
             *
             * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括：应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时，可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用，只返回指标：应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计，使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分
             */
            departmentOverview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=message_push_overview&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/message_push_overview document }
             *
             * 获取消息推送概览（灰度租户可见）
             *
             * 目标：查看应用在某一天/某一周/某一个月的机器人消息推送数据，可以根据部门做筛选
             *
             * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出两天前的数据。;3. 已经支持的指标包括：消息推送给用户的次数、消息触达的人数、消息1小时阅读量、消息12小时阅读量;4. 按照部门查看数据时，会展示当前部门以及其子部门的整体使用情况;5. 调用频控为100次/分
             */
            messagePushOverview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=overview&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview document }
             *
             * 获取应用使用概览
             *
             * 查看应用在某一天/某一周/某一个月的使用数据，可以查看租户整体对应用的使用情况，也可以分部门查看。
             *
             * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括：应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计，使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时，会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分
             */
            overview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 事件
           */
          applicationAppVersion: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=contacts_range_suggest&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 document }
             *
             * 获取应用版本通讯录权限范围建议
             */
            contactsRangeSuggest: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=get&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get document }
             *
             * 获取应用版本信息
             *
             * 根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list document }
             *
             * 获取应用版本列表
             *
             * 根据 app_id 获取对应应用版本列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=patch&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch document }
             *
             * 更新应用审核状态
             *
             * 通过接口来更新应用版本的审核结果：通过后应用可以直接上架；拒绝后则开发者可以看到拒绝理由，并在修改后再次申请发布。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * application.collaborators
           */
          applicationCollaborators: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.collaborators&apiName=get&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=application&resource=application.collaborators&version=v6 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.collaborators&apiName=update&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.collaborators&version=v6 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * application.contacts_range
           */
          applicationContactsRange: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.contacts_range&apiName=patch&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 应用管理
           */
          application: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=contacts_range_configuration&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 document }
             */
            contactsRangeConfiguration: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=get&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get document }
             *
             * 获取应用信息
             *
             * 根据app_id获取应用的基础信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/list document }
             *
             * 获取企业安装的应用
             *
             * 该接口用于查询企业安装的应用列表，只能被企业自建应用调用。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=patch&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch document }
             *
             * 更新应用分组信息
             *
             * 更新应用的分组信息（分组会影响应用在工作台中的分类情况，请谨慎更新）
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            underauditlistWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/underauditlist`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=underauditlist&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist document }
             *
             * 查看待审核的应用列表
             *
             * 查看本企业下所有待审核的自建应用列表
             */
            underauditlist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/underauditlist`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 应用反馈
           */
          applicationFeedback: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.feedback&apiName=list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list document }
             *
             * 获取应用反馈列表
             *
             * 查询应用的反馈数据
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.feedback&apiName=patch&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch document }
             *
             * 更新应用反馈
             *
             * 更新应用的反馈数据
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * application.management
           */
          applicationManagement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.management&apiName=update&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.management&version=v6 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/management`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * application.owner
           */
          applicationOwner: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.owner&apiName=update&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.owner&version=v6 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 事件
           */
          applicationVisibility: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.visibility&apiName=check_white_black_list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 document }
             */
            checkWhiteBlackList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.visibility&apiName=patch&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * scope
           */
          scope: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=scope&apiName=apply&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=apply&project=application&resource=scope&version=v6 document }
             */
            apply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/scopes/apply`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=application&resource=scope&apiName=list&version=v6 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=application&resource=scope&version=v6 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/application/v6/scopes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v6: {
            /**
             * 应用红点
             */
            appBadge: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=app_badge&apiName=set&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_badge/set document }
               *
               * 更新应用红点
               *
               * 更新应用红点信息，用于工作台场景
               */
              set: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/app_badge/set`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 我的常用推荐规则
             */
            appRecommendRule: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/application/v6/app_recommend_rules`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=app_recommend_rule&apiName=list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/app_recommend_rule/list document }
               *
               * 获取当前设置的推荐规则列表
               *
               * 获取当前设置的推荐规则列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/app_recommend_rules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 应用使用情况
             */
            applicationAppUsage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=department_overview&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/department_overview document }
               *
               * 获取多部门应用使用概览（灰度租户可见）
               *
               * 查看应用在某一天/某一周/某一个月的使用数据，可以根据部门做多层子部门的筛选
               *
               * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括：应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 按照部门查看数据时，可以分别展示当前部门以及其子部门的使用情况;5. 如果查询的部门在查询日期没有使用过应用，只返回指标：应用的活跃用户数指标;6. 数据从飞书4.10版本开始统计，使用飞书版本4.10及以下版本的用户数据不会被统计到;7. 调用频控为100次/分
               */
              departmentOverview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=message_push_overview&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/message_push_overview document }
               *
               * 获取消息推送概览（灰度租户可见）
               *
               * 目标：查看应用在某一天/某一周/某一个月的机器人消息推送数据，可以根据部门做筛选
               *
               * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出两天前的数据。;3. 已经支持的指标包括：消息推送给用户的次数、消息触达的人数、消息1小时阅读量、消息12小时阅读量;4. 按照部门查看数据时，会展示当前部门以及其子部门的整体使用情况;5. 调用频控为100次/分
               */
              messagePushOverview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_usage&apiName=overview&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_usage/overview document }
               *
               * 获取应用使用概览
               *
               * 查看应用在某一天/某一周/某一个月的使用数据，可以查看租户整体对应用的使用情况，也可以分部门查看。
               *
               * 1. 仅支持企业版/旗舰版租户使用;2. 一般每天早上10点产出前一天的数据;3. 已经支持的指标包括：应用的活跃用户数、累计用户数、新增用户数、访问页面数、打开次数;4. 数据从飞书4.10版本开始统计，使用飞书版本4.10及以下版本的用户数据不会被统计到;5. 按照部门查看数据时，会展示当前部门以及其子部门的整体使用情况;6. 调用频控为100次/分
               */
              overview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 事件
             */
            applicationAppVersion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=contacts_range_suggest&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_suggest&project=application&resource=application.app_version&version=v6 document }
               *
               * 获取应用版本通讯录权限范围建议
               */
              contactsRangeSuggest: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=get&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/get document }
               *
               * 获取应用版本信息
               *
               * 根据应用 ID 和应用版本 ID 来获取同租户下的应用版本的信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/list document }
               *
               * 获取应用版本列表
               *
               * 根据 app_id 获取对应应用版本列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.app_version&apiName=patch&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-app_version/patch document }
               *
               * 更新应用审核状态
               *
               * 通过接口来更新应用版本的审核结果：通过后应用可以直接上架；拒绝后则开发者可以看到拒绝理由，并在修改后再次申请发布。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.collaborators
             */
            applicationCollaborators: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.collaborators&apiName=get&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=application&resource=application.collaborators&version=v6 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.collaborators&apiName=update&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.collaborators&version=v6 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.contacts_range
             */
            applicationContactsRange: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.contacts_range&apiName=patch&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 应用管理
             */
            application: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=contacts_range_configuration&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=contacts_range_configuration&project=application&resource=application&version=v6 document }
               */
              contactsRangeConfiguration: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=get&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/get document }
               *
               * 获取应用信息
               *
               * 根据app_id获取应用的基础信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/application/v6/applications`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/list document }
               *
               * 获取企业安装的应用
               *
               * 该接口用于查询企业安装的应用列表，只能被企业自建应用调用。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=patch&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/patch document }
               *
               * 更新应用分组信息
               *
               * 更新应用的分组信息（分组会影响应用在工作台中的分类情况，请谨慎更新）
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              underauditlistWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/underauditlist`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application&apiName=underauditlist&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application/underauditlist document }
               *
               * 查看待审核的应用列表
               *
               * 查看本企业下所有待审核的自建应用列表
               */
              underauditlist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/underauditlist`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 应用反馈
             */
            applicationFeedback: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.feedback&apiName=list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/list document }
               *
               * 获取应用反馈列表
               *
               * 查询应用的反馈数据
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.feedback&apiName=patch&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/application-feedback/patch document }
               *
               * 更新应用反馈
               *
               * 更新应用的反馈数据
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.management
             */
            applicationManagement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.management&apiName=update&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.management&version=v6 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/management`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.owner
             */
            applicationOwner: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.owner&apiName=update&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=application&resource=application.owner&version=v6 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 事件
             */
            applicationVisibility: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.visibility&apiName=check_white_black_list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=check_white_black_list&project=application&resource=application.visibility&version=v6 document }
               */
              checkWhiteBlackList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=application.visibility&apiName=patch&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * scope
             */
            scope: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=scope&apiName=apply&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=apply&project=application&resource=scope&version=v6 document }
               */
              apply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/scopes/apply`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=application&resource=scope&apiName=list&version=v6 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=application&resource=scope&version=v6 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/application/v6/scopes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$11 = class extends Client$12 {
      constructor() {
        super(...arguments);
        this.approval = {
          /**
           * 事件
           */
          approval: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create document }
             *
             * 创建审批定义
             *
             * 用于通过接口创建简单的审批定义，可以灵活指定定义的基础信息、表单和流程等。创建成功后，不支持从审批管理后台删除该定义。不推荐企业自建应用使用，如有需要尽量联系管理员在审批管理后台创建定义。
             *
             * 接口谨慎调用，创建后的审批定义无法停用/删除
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get document }
             *
             * 查看审批定义
             *
             * 根据 Approval Code 获取某个审批定义的详情，用于构造创建审批实例的请求。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=subscribe&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe document }
             *
             * 订阅审批事件
             *
             * 应用订阅 approval_code 后，该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次，无需重复订阅。;;当应用不希望再收到审批事件时，可以使用取消订阅接口进行取消，取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的，多个应用可以同时订阅同一个 approval_code，每个应用都能收到审批事件。
             */
            subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=unsubscribe&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe document }
             *
             * 取消订阅审批事件
             *
             * 取消订阅 approval_code 后，无法再收到该审批定义对应实例的事件通知
             */
            unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 三方审批定义
           */
          externalApproval: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_approval&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create document }
             *
             * 三方审批定义创建
             *
             * 审批定义是审批的描述，包括审批名称、图标、描述等基础信息。创建好审批定义，用户就可以在审批应用的发起页中看到审批，如果用户点击发起，则会跳转到配置的发起三方系统地址去发起审批。;;另外，审批定义还配置了审批操作时的回调地址：审批人在待审批列表中进行【同意】【拒绝】操作时，审批中心会调用回调地址通知三方系统。
             *
             * 注意，审批中心不负责审批流程的流转，只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_approvals`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_approval&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 三方审批实例
           */
          externalInstance: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_instance&apiName=check&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check document }
             *
             * 三方审批实例校验
             *
             * 校验三方审批实例数据，用于判断服务端数据是否为最新的。用户提交实例最新更新时间，如果服务端不存在该实例，或者服务端实例更新时间不是最新的，则返回对应实例 id。;;例如，用户可以每隔5分钟，将最近5分钟产生的实例使用该接口进行对比。
             */
            check: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_instances/check`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_instance&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create document }
             *
             * 三方审批实例同步
             *
             * 审批中心不负责审批的流转，审批的流转在三方系统，三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息，并且可以跳转回三方系统进行更详细的查看和操作，其中实例信息在【已发起】列表，任务信息在【待审批】和【已审批】列表，抄送信息在【抄送我】列表;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/9dff4434afbeb0ef69de7f36b9a6e995_z5iwmTzEgg.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/ca6e0e984a7a6d64e1b16a0bac4bf868_tfqjCiaJQM.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/529377e238df78d391bbd22e962ad195_T7eefLI1GA.png" alt="" style="zoom:17%;" />;:::;;对于审批任务，三方系统也可以配置审批任务的回调接口，这样审批人可以在审批中心中直接进行审批操作，审批中心会回调三方系统，三方系统收到回调后更新任务信息，并将新的任务信息同步回审批中心，形成闭环。;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/721c35428bc1187db3318c572f9979ad_je75QpElcg.png" alt=""  style="zoom:25%;" />;:::;<br>
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_instances`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 三方审批任务
           */
          externalTask: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_tasks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_task&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list document }
             *
             * 获取三方审批任务状态
             *
             * 该接口用于获取三方审批的状态。用户传入查询条件，接口返回满足条件的审批实例的状态。该接口支持多种参数的组合，包括如下组合：;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_tasks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 原生审批实例
           */
          instance: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=add_sign&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign document }
             */
            addSign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/add_sign`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=cancel&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel document }
             *
             * 审批实例撤回
             *
             * 对于状态为“审批中”的单个审批实例进行撤销操作，撤销后审批流程结束
             */
            cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/cancel`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=cc&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc document }
             *
             * 审批实例抄送
             *
             * 通过接口可以将当前审批实例抄送给其他人。
             */
            cc: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/cc`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create document }
             *
             * 创建审批实例
             *
             * 创建一个审批实例，调用方需对审批定义的表单有详细了解，将按照定义的表单结构，将表单 Value 通过接口传入
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get document }
             *
             * 获取单个审批实例详情
             *
             * 通过审批实例 Instance Code  获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=preview&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview document }
             */
            preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/preview`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/query`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=query&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query document }
             *
             * 查询实例列表
             *
             * 该接口通过不同条件查询审批系统中符合条件的审批实例列表。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=search_cc&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc document }
             *
             * 查询抄送列表
             *
             * 该接口通过不同条件查询审批系统中符合条件的审批抄送列表。
             */
            searchCc: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/search_cc`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=specified_rollback&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback document }
             *
             * 审批任务退回
             *
             * 从当前审批任务，退回到已审批的一个或多个任务节点。退回后，已审批节点重新生成审批任务
             */
            specifiedRollback: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 原生审批评论
           */
          instanceComment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create document }
             *
             * 创建评论
             *
             * 在某审批实例下创建、修改评论或评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete document }
             *
             * 删除评论
             *
             * 逻辑删除某审批实例下的一条评论或评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list document }
             *
             * 获取评论
             *
             * 根据 Instance Code 获取某个审批实例下的全部评论与评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=remove&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove document }
             *
             * 清空评论
             *
             * 删除某审批实例下的全部评论与评论回复。
             */
            remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 原生审批任务
           */
          task: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=approve&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve document }
             *
             * 审批任务同意
             *
             * 对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。
             */
            approve: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/approve`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/query`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=query&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query document }
             *
             * 用户角度列出任务
             *
             * 根据用户和任务分组查询任务列表
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=reject&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject document }
             *
             * 审批任务拒绝
             *
             * 对于单个审批任务进行拒绝操作。拒绝后审批流程结束。
             */
            reject: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/reject`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=resubmit&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit document }
             *
             * 审批任务重新提交
             *
             * 对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。
             */
            resubmit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/resubmit`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=search&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search document }
             *
             * 查询任务列表
             *
             * 该接口通过不同条件查询审批系统中符合条件的审批任务列表
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=transfer&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer document }
             *
             * 审批任务转交
             *
             * 对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。
             */
            transfer: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/transfer`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v4: {
            /**
             * 事件
             */
            approval: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create document }
               *
               * 创建审批定义
               *
               * 用于通过接口创建简单的审批定义，可以灵活指定定义的基础信息、表单和流程等。创建成功后，不支持从审批管理后台删除该定义。不推荐企业自建应用使用，如有需要尽量联系管理员在审批管理后台创建定义。
               *
               * 接口谨慎调用，创建后的审批定义无法停用/删除
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get document }
               *
               * 查看审批定义
               *
               * 根据 Approval Code 获取某个审批定义的详情，用于构造创建审批实例的请求。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=subscribe&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/subscribe document }
               *
               * 订阅审批事件
               *
               * 应用订阅 approval_code 后，该应用就可以收到该审批定义对应实例的事件通知。同一应用只需要订阅一次，无需重复订阅。;;当应用不希望再收到审批事件时，可以使用取消订阅接口进行取消，取消后将不再给应用推送消息。;;订阅和取消订阅都是应用维度的，多个应用可以同时订阅同一个 approval_code，每个应用都能收到审批事件。
               */
              subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=approval&apiName=unsubscribe&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/unsubscribe document }
               *
               * 取消订阅审批事件
               *
               * 取消订阅 approval_code 后，无法再收到该审批定义对应实例的事件通知
               */
              unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 三方审批定义
             */
            externalApproval: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_approval&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_approval/create document }
               *
               * 三方审批定义创建
               *
               * 审批定义是审批的描述，包括审批名称、图标、描述等基础信息。创建好审批定义，用户就可以在审批应用的发起页中看到审批，如果用户点击发起，则会跳转到配置的发起三方系统地址去发起审批。;;另外，审批定义还配置了审批操作时的回调地址：审批人在待审批列表中进行【同意】【拒绝】操作时，审批中心会调用回调地址通知三方系统。
               *
               * 注意，审批中心不负责审批流程的流转，只负责展示、操作、消息通知。因此审批定义创建时没有审批流程的信息。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_approvals`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_approval&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=approval&resource=external_approval&version=v4 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 三方审批实例
             */
            externalInstance: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_instance&apiName=check&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/check document }
               *
               * 三方审批实例校验
               *
               * 校验三方审批实例数据，用于判断服务端数据是否为最新的。用户提交实例最新更新时间，如果服务端不存在该实例，或者服务端实例更新时间不是最新的，则返回对应实例 id。;;例如，用户可以每隔5分钟，将最近5分钟产生的实例使用该接口进行对比。
               */
              check: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_instances/check`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_instance&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_instance/create document }
               *
               * 三方审批实例同步
               *
               * 审批中心不负责审批的流转，审批的流转在三方系统，三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息，并且可以跳转回三方系统进行更详细的查看和操作，其中实例信息在【已发起】列表，任务信息在【待审批】和【已审批】列表，抄送信息在【抄送我】列表;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/9dff4434afbeb0ef69de7f36b9a6e995_z5iwmTzEgg.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/ca6e0e984a7a6d64e1b16a0bac4bf868_tfqjCiaJQM.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/529377e238df78d391bbd22e962ad195_T7eefLI1GA.png" alt="" style="zoom:17%;" />;:::;;对于审批任务，三方系统也可以配置审批任务的回调接口，这样审批人可以在审批中心中直接进行审批操作，审批中心会回调三方系统，三方系统收到回调后更新任务信息，并将新的任务信息同步回审批中心，形成闭环。;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/721c35428bc1187db3318c572f9979ad_je75QpElcg.png" alt=""  style="zoom:25%;" />;:::;<br>
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_instances`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 三方审批任务
             */
            externalTask: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=external_task&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/external_task/list document }
               *
               * 获取三方审批任务状态
               *
               * 该接口用于获取三方审批的状态。用户传入查询条件，接口返回满足条件的审批实例的状态。该接口支持多种参数的组合，包括如下组合：;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/external_tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 原生审批实例
             */
            instance: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=add_sign&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-task-addsign document }
               */
              addSign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/add_sign`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=cancel&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cancel document }
               *
               * 审批实例撤回
               *
               * 对于状态为“审批中”的单个审批实例进行撤销操作，撤销后审批流程结束
               */
              cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/cancel`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=cc&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/cc document }
               *
               * 审批实例抄送
               *
               * 通过接口可以将当前审批实例抄送给其他人。
               */
              cc: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/cc`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create document }
               *
               * 创建审批实例
               *
               * 创建一个审批实例，调用方需对审批定义的表单有详细了解，将按照定义的表单结构，将表单 Value 通过接口传入
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get document }
               *
               * 获取单个审批实例详情
               *
               * 通过审批实例 Instance Code  获取审批实例详情。Instance Code 由 [批量获取审批实例](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) 接口获取。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=preview&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/ukTM5UjL5ETO14SOxkTN/approval-preview document }
               */
              preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/preview`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=query&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query document }
               *
               * 查询实例列表
               *
               * 该接口通过不同条件查询审批系统中符合条件的审批实例列表。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=search_cc&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/search_cc document }
               *
               * 查询抄送列表
               *
               * 该接口通过不同条件查询审批系统中符合条件的审批抄送列表。
               */
              searchCc: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/search_cc`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance&apiName=specified_rollback&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/specified_rollback document }
               *
               * 审批任务退回
               *
               * 从当前审批任务，退回到已审批的一个或多个任务节点。退回后，已审批节点重新生成审批任务
               */
              specifiedRollback: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 原生审批评论
             */
            instanceComment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/create document }
               *
               * 创建评论
               *
               * 在某审批实例下创建、修改评论或评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/delete document }
               *
               * 删除评论
               *
               * 逻辑删除某审批实例下的一条评论或评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/list document }
               *
               * 获取评论
               *
               * 根据 Instance Code 获取某个审批实例下的全部评论与评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=instance.comment&apiName=remove&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance-comment/remove document }
               *
               * 清空评论
               *
               * 删除某审批实例下的全部评论与评论回复。
               */
              remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 原生审批任务
             */
            task: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=approve&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/approve document }
               *
               * 审批任务同意
               *
               * 对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。
               */
              approve: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/approve`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/query`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=query&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/query document }
               *
               * 用户角度列出任务
               *
               * 根据用户和任务分组查询任务列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=reject&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/reject document }
               *
               * 审批任务拒绝
               *
               * 对于单个审批任务进行拒绝操作。拒绝后审批流程结束。
               */
              reject: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/reject`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=resubmit&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/resubmit document }
               *
               * 审批任务重新提交
               *
               * 对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。
               */
              resubmit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/resubmit`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=search&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/search document }
               *
               * 查询任务列表
               *
               * 该接口通过不同条件查询审批系统中符合条件的审批任务列表
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=approval&resource=task&apiName=transfer&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/task/transfer document }
               *
               * 审批任务转交
               *
               * 对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。
               */
              transfer: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/approval/v4/tasks/transfer`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$10 = class extends Client$11 {
      constructor() {
        super(...arguments);
        this.attendance = {
          /**
           * approval_info
           */
          approvalInfo: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=approval_info&apiName=process&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process document }
             *
             * 通知审批状态更新
             *
             * 对于只使用飞书考勤系统而未使用飞书审批系统的企业，可以通过该接口更新写入飞书考勤系统中的三方系统审批状态，例如请假、加班、外出、出差、补卡等审批，状态包括通过、不通过、撤销等。
             *
             * 发起状态的审批才可以被更新为通过、不通过，已经通过的审批才可以被更新为撤销。
             */
            process: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/approval_infos/process`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * archive_rule
           */
          archiveRule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=del_report&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=del_report&project=attendance&resource=archive_rule&version=v1 document }
             */
            delReport: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=attendance&resource=archive_rule&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=upload_report&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload_report&project=attendance&resource=archive_rule&version=v1 document }
             */
            uploadReport: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=user_stats_fields_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=user_stats_fields_query&project=attendance&resource=archive_rule&version=v1 document }
             */
            userStatsFieldsQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 文件
           */
          file: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=file&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download document }
             *
             * 下载文件
             *
             * 通过文件 ID 下载指定的文件。
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=file&apiName=upload&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload document }
             *
             * 上传文件
             *
             * 上传文件并获取文件 ID，可用于“修改用户设置”接口中的 face_key 参数。
             */
            upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/files/upload`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          /**
           * 考勤组管理
           */
          group: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create document }
             *
             * 创建或修改考勤组
             *
             * 考勤组，是对部门或者员工在某个特定场所及特定时间段内的出勤情况（包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等）的一种规则设定。;;通过设置考勤组，可以从部门、员工两个维度，来设定考勤方式、考勤时间、考勤地点等考勤规则。
             *
             * 出于安全考虑，目前通过该接口只允许修改自己创建的考勤组。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete document }
             *
             * 删除考勤组
             *
             * 通过班次 ID 删除班次。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get document }
             *
             * 获取考勤组详情
             *
             * 通过考勤组 ID 获取考勤组详情。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list document }
             *
             * 获取考勤组列表
             *
             * 翻页获取所有考勤组列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=list_user&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_user&project=attendance&resource=group&version=v1 document }
             */
            listUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search document }
             *
             * 按名称查询考勤组
             *
             * 按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序，且最大记录数为 10 条。
             *
             * 该接口依赖的数据和考勤组主数据间存在数据同步延时（正常数据同步 2 秒以内），因此在使用该接口时需注意评估数据延迟潜在风险。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * leave_accrual_record
           */
          leaveAccrualRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=leave_accrual_record&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * leave_employ_expire_record
           */
          leaveEmployExpireRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=leave_employ_expire_record&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 考勤班次
           */
          shift: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create document }
             *
             * 创建班次
             *
             * 班次是描述一次考勤任务时间规则的统称，比如一天打多少次卡，每次卡的上下班时间，晚到多长时间算迟到，晚到多长时间算缺卡等。
             *
             * - 创建一个考勤组前，必须先创建一个或者多个班次。;- 一个公司内的班次是共享的，你可以直接引用他人创建的班次，但是需要注意的是，若他人修改了班次，会影响到你的考勤组及其考勤结果。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete document }
             *
             * 删除班次
             *
             * 通过班次 ID 删除班次。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get document }
             *
             * 获取班次详情
             *
             * 通过班次 ID 获取班次详情。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list document }
             *
             * 获取班次列表
             *
             * 翻页获取所有班次列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query document }
             *
             * 按名称查询班次
             *
             * 通过班次的名称查询班次信息。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 假勤审批
           */
          userApproval: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_approval&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create document }
             *
             * 写入审批结果
             *
             * 由于部分企业使用的是自己的审批系统，而不是飞书审批系统，因此员工的请假、加班等数据无法流入到飞书考勤系统中，导致员工在请假时间段内依然收到打卡提醒，并且被记为缺卡。;;对于这些只使用飞书考勤系统，而未使用飞书审批系统的企业，可以通过考勤开放接口的形式，将三方审批结果数据回写到飞书考勤系统中。
             *
             * 目前支持写入加班、请假、出差和外出这四种审批结果，写入只会追加(insert)，不会覆盖(update)（开放接口导入的加班假期记录，在管理后台的假期加班里查不到，只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询）
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_approvals`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_approval&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query document }
             *
             * 获取审批通过数据
             *
             * 获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。
             *
             * 请假的假期时长字段，暂未开放提供，待后续提供。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_approvals/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 考勤排班
           */
          userDailyShift: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create document }
             *
             * 创建或修改班表
             *
             * 班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=batch_create_temp&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create_temp&project=attendance&resource=user_daily_shift&version=v1 document }
             */
            batchCreateTemp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query document }
             *
             * 查询班表信息
             *
             * 支持查询多个用户的排班情况，查询的时间跨度不能超过 30 天。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_flow
           */
          userFlow: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create document }
             *
             * 导入打卡流水记录
             *
             * 导入授权内员工的打卡流水记录。导入后，会根据员工所在的考勤组班次规则，计算最终的打卡状态与结果。
             *
             * 适用于考勤机数据导入等场景。
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=batch_del&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_del&project=attendance&resource=user_flow&version=v1 document }
             *
             * 批量删除流水
             */
            batchDel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get document }
             *
             * 获取打卡流水记录
             *
             * 通过打卡记录 ID 获取用户的打卡流水记录。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query document }
             *
             * 批量查询打卡流水记录
             *
             * 批量查询授权内员工的实际打卡流水记录。例如，企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡，但是该员工在这期间打了多次卡，该接口会把所有的打卡记录都返回。
             *
             * 如果只需获取打卡结果，而不需要详细的打卡数据，可使用“获取打卡结果”的接口。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户设置
           */
          userSetting: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_setting&apiName=modify&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify document }
             *
             * 修改用户设置
             *
             * 修改授权内员工的用户设置信息，包括人脸照片文件 ID。
             */
            modify: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_settings/modify`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_setting&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query document }
             *
             * 批量查询用户设置
             *
             * 批量查询授权内员工的用户设置信息，包括人脸照片文件 ID、人脸照片更新时间。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_settings/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 考勤统计
           */
          userStatsData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_data&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query document }
             *
             * 查询统计数据
             *
             * 查询日度统计或月度统计的统计数据。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_stats_field
           */
          userStatsField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_field&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query document }
             *
             * 查询统计表头
             *
             * 查询考勤统计支持的日度统计或月度统计的统计表头。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_stats_view
           */
          userStatsView: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_view&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query document }
             *
             * 查询统计设置
             *
             * 查询开发者定制的日度统计或月度统计的统计报表表头设置信息。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_view&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update document }
             *
             * 更新统计设置
             *
             * 更新开发者定制的日度统计或月度统计的统计报表表头设置信息。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 考勤记录
           */
          userTask: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query document }
             *
             * 获取打卡结果
             *
             * 获取企业内员工的实际打卡结果，包括上班打卡结果和下班打卡结果。
             *
             * - 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡，即使员工在这期间打了多次卡，该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据，如打卡位置等信息，可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_tasks/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 考勤补卡
           */
          userTaskRemedy: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create document }
             *
             * 通知补卡审批发起
             *
             * 对于只使用飞书考勤系统而未使用飞书审批系统的企业，可以通过该接口，将在三方审批系统中发起的补卡审批数据，写入到飞书考勤系统中，状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query document }
             *
             * 获取补卡记录
             *
             * 获取授权内员工的补卡记录。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=query_user_allowed_remedys&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys document }
             *
             * 获取用户可补卡时间
             *
             * 获取用户某天可以补的第几次上 / 下班卡的时间。
             */
            queryUserAllowedRemedys: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * approval_info
             */
            approvalInfo: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=approval_info&apiName=process&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process document }
               *
               * 通知审批状态更新
               *
               * 对于只使用飞书考勤系统而未使用飞书审批系统的企业，可以通过该接口更新写入飞书考勤系统中的三方系统审批状态，例如请假、加班、外出、出差、补卡等审批，状态包括通过、不通过、撤销等。
               *
               * 发起状态的审批才可以被更新为通过、不通过，已经通过的审批才可以被更新为撤销。
               */
              process: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/approval_infos/process`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * archive_rule
             */
            archiveRule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=del_report&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=del_report&project=attendance&resource=archive_rule&version=v1 document }
               */
              delReport: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=attendance&resource=archive_rule&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=upload_report&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload_report&project=attendance&resource=archive_rule&version=v1 document }
               */
              uploadReport: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=archive_rule&apiName=user_stats_fields_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=user_stats_fields_query&project=attendance&resource=archive_rule&version=v1 document }
               */
              userStatsFieldsQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 文件
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=file&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/download document }
               *
               * 下载文件
               *
               * 通过文件 ID 下载指定的文件。
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=file&apiName=upload&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/file/upload document }
               *
               * 上传文件
               *
               * 上传文件并获取文件 ID，可用于“修改用户设置”接口中的 face_key 参数。
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/files/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * 考勤组管理
             */
            group: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/create document }
               *
               * 创建或修改考勤组
               *
               * 考勤组，是对部门或者员工在某个特定场所及特定时间段内的出勤情况（包括上下班、迟到、早退、病假、婚假、丧假、公休、工作时间、加班情况等）的一种规则设定。;;通过设置考勤组，可以从部门、员工两个维度，来设定考勤方式、考勤时间、考勤地点等考勤规则。
               *
               * 出于安全考虑，目前通过该接口只允许修改自己创建的考勤组。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/delete document }
               *
               * 删除考勤组
               *
               * 通过班次 ID 删除班次。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/get document }
               *
               * 获取考勤组详情
               *
               * 通过考勤组 ID 获取考勤组详情。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/list document }
               *
               * 获取考勤组列表
               *
               * 翻页获取所有考勤组列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=list_user&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_user&project=attendance&resource=group&version=v1 document }
               */
              listUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=group&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/group/search document }
               *
               * 按名称查询考勤组
               *
               * 按考勤组名称查询考勤组摘要信息。查询条件支持名称精确匹配和模糊匹配两种方式。查询结果按考勤组修改时间 desc 排序，且最大记录数为 10 条。
               *
               * 该接口依赖的数据和考勤组主数据间存在数据同步延时（正常数据同步 2 秒以内），因此在使用该接口时需注意评估数据延迟潜在风险。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/groups/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * leave_accrual_record
             */
            leaveAccrualRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=leave_accrual_record&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=attendance&resource=leave_accrual_record&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * leave_employ_expire_record
             */
            leaveEmployExpireRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=leave_employ_expire_record&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=attendance&resource=leave_employ_expire_record&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 考勤班次
             */
            shift: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/create document }
               *
               * 创建班次
               *
               * 班次是描述一次考勤任务时间规则的统称，比如一天打多少次卡，每次卡的上下班时间，晚到多长时间算迟到，晚到多长时间算缺卡等。
               *
               * - 创建一个考勤组前，必须先创建一个或者多个班次。;- 一个公司内的班次是共享的，你可以直接引用他人创建的班次，但是需要注意的是，若他人修改了班次，会影响到你的考勤组及其考勤结果。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/delete document }
               *
               * 删除班次
               *
               * 通过班次 ID 删除班次。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/get document }
               *
               * 获取班次详情
               *
               * 通过班次 ID 获取班次详情。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/list document }
               *
               * 获取班次列表
               *
               * 翻页获取所有班次列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=shift&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/shift/query document }
               *
               * 按名称查询班次
               *
               * 通过班次的名称查询班次信息。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/shifts/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 假勤审批
             */
            userApproval: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_approval&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/create document }
               *
               * 写入审批结果
               *
               * 由于部分企业使用的是自己的审批系统，而不是飞书审批系统，因此员工的请假、加班等数据无法流入到飞书考勤系统中，导致员工在请假时间段内依然收到打卡提醒，并且被记为缺卡。;;对于这些只使用飞书考勤系统，而未使用飞书审批系统的企业，可以通过考勤开放接口的形式，将三方审批结果数据回写到飞书考勤系统中。
               *
               * 目前支持写入加班、请假、出差和外出这四种审批结果，写入只会追加(insert)，不会覆盖(update)（开放接口导入的加班假期记录，在管理后台的假期加班里查不到，只能通过[获取审批通过数据](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query)来查询）
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_approvals`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_approval&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_approval/query document }
               *
               * 获取审批通过数据
               *
               * 获取员工在某段时间内的请假、加班、外出和出差四种审批的通过数据。
               *
               * 请假的假期时长字段，暂未开放提供，待后续提供。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_approvals/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 考勤排班
             */
            userDailyShift: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/batch_create document }
               *
               * 创建或修改班表
               *
               * 班表是用来描述考勤组内人员每天按哪个班次进行上班。目前班表支持按一个整月对一位或多位人员进行排班。
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=batch_create_temp&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create_temp&project=attendance&resource=user_daily_shift&version=v1 document }
               */
              batchCreateTemp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_daily_shift&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_daily_shift/query document }
               *
               * 查询班表信息
               *
               * 支持查询多个用户的排班情况，查询的时间跨度不能超过 30 天。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_flow
             */
            userFlow: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/batch_create document }
               *
               * 导入打卡流水记录
               *
               * 导入授权内员工的打卡流水记录。导入后，会根据员工所在的考勤组班次规则，计算最终的打卡状态与结果。
               *
               * 适用于考勤机数据导入等场景。
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=batch_del&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_del&project=attendance&resource=user_flow&version=v1 document }
               *
               * 批量删除流水
               */
              batchDel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/get document }
               *
               * 获取打卡流水记录
               *
               * 通过打卡记录 ID 获取用户的打卡流水记录。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_flow&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_flow/query document }
               *
               * 批量查询打卡流水记录
               *
               * 批量查询授权内员工的实际打卡流水记录。例如，企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡，但是该员工在这期间打了多次卡，该接口会把所有的打卡记录都返回。
               *
               * 如果只需获取打卡结果，而不需要详细的打卡数据，可使用“获取打卡结果”的接口。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_flows/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户设置
             */
            userSetting: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_setting&apiName=modify&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/modify document }
               *
               * 修改用户设置
               *
               * 修改授权内员工的用户设置信息，包括人脸照片文件 ID。
               */
              modify: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_settings/modify`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_setting&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_setting/query document }
               *
               * 批量查询用户设置
               *
               * 批量查询授权内员工的用户设置信息，包括人脸照片文件 ID、人脸照片更新时间。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_settings/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 考勤统计
             */
            userStatsData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_data&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_data/query document }
               *
               * 查询统计数据
               *
               * 查询日度统计或月度统计的统计数据。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_stats_field
             */
            userStatsField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_field&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_field/query document }
               *
               * 查询统计表头
               *
               * 查询考勤统计支持的日度统计或月度统计的统计表头。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_stats_view
             */
            userStatsView: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_view&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/query document }
               *
               * 查询统计设置
               *
               * 查询开发者定制的日度统计或月度统计的统计报表表头设置信息。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_stats_view&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_stats_view/update document }
               *
               * 更新统计设置
               *
               * 更新开发者定制的日度统计或月度统计的统计报表表头设置信息。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 考勤记录
             */
            userTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task/query document }
               *
               * 获取打卡结果
               *
               * 获取企业内员工的实际打卡结果，包括上班打卡结果和下班打卡结果。
               *
               * - 如果企业给一个员工设定的班次是上午 9 点和下午 6 点各打一次上下班卡，即使员工在这期间打了多次卡，该接口也只会返回 1 条记录。;- 如果要获取打卡的详细数据，如打卡位置等信息，可使用“获取打卡流水记录”或“批量查询打卡流水记录”的接口。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_tasks/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 考勤补卡
             */
            userTaskRemedy: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/create document }
               *
               * 通知补卡审批发起
               *
               * 对于只使用飞书考勤系统而未使用飞书审批系统的企业，可以通过该接口，将在三方审批系统中发起的补卡审批数据，写入到飞书考勤系统中，状态为审批中。写入后可以由[通知审批状态更新](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/approval_info/process) 进行状态更新
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query document }
               *
               * 获取补卡记录
               *
               * 获取授权内员工的补卡记录。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=attendance&resource=user_task_remedy&apiName=query_user_allowed_remedys&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/attendance-v1/user_task_remedy/query_user_allowed_remedys document }
               *
               * 获取用户可补卡时间
               *
               * 获取用户某天可以补的第几次上 / 下班卡的时间。
               */
              queryUserAllowedRemedys: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$$ = class extends Client$10 {
      constructor() {
        super(...arguments);
        this.auth = {
          /**
           * app_access_token
           */
          appAccessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_access_token&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_access_token&apiName=internal&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 document }
             */
            internal: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_access_token/internal`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * app_ticket
           */
          appTicket: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_ticket&apiName=resend&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 document }
             */
            resend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_ticket/resend`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * tenant_access_token
           */
          tenantAccessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=auth&resource=tenant_access_token&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/auth/v3/tenant_access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=auth&resource=tenant_access_token&apiName=internal&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 document }
             */
            internal: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v3: {
            /**
             * app_access_token
             */
            appAccessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_access_token&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=app_access_token&version=v3 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_access_token&apiName=internal&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=app_access_token&version=v3 document }
               */
              internal: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_access_token/internal`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app_ticket
             */
            appTicket: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=auth&resource=app_ticket&apiName=resend&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resend&project=auth&resource=app_ticket&version=v3 document }
               */
              resend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/auth/v3/app_ticket/resend`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * tenant_access_token
             */
            tenantAccessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=auth&resource=tenant_access_token&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=auth&resource=tenant_access_token&version=v3 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/auth/v3/tenant_access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=auth&resource=tenant_access_token&apiName=internal&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=internal&project=auth&resource=tenant_access_token&version=v3 document }
               */
              internal: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$_ = class extends Client$$ {
      constructor() {
        super(...arguments);
        this.authen = {
          /**
           * access_token
           */
          accessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=authen&resource=access_token&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/authen/v1/access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * oidc.access_token
           */
          oidcAccessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.access_token&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * oidc.refresh_access_token
           */
          oidcRefreshAccessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.refresh_access_token&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * refresh_access_token
           */
          refreshAccessToken: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=authen&resource=refresh_access_token&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/authen/v1/refresh_access_token`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_info
           */
          userInfo: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=authen&resource=user_info&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/authen/v1/user_info`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * access_token
             */
            accessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=authen&resource=access_token&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/authen/v1/access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * oidc.access_token
             */
            oidcAccessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.access_token&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * oidc.refresh_access_token
             */
            oidcRefreshAccessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.refresh_access_token&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * refresh_access_token
             */
            refreshAccessToken: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=authen&resource=refresh_access_token&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/authen/v1/refresh_access_token`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_info
             */
            userInfo: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=authen&resource=user_info&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/authen/v1/user_info`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$Z = class extends Client$_ {
      constructor() {
        super(...arguments);
        this.aweme_ecosystem = {};
      }
    };
    var Client$Y = class extends Client$Z {
      constructor() {
        super(...arguments);
        this.baike = {
          /**
           * 分类
           */
          classification: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/classifications`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=classification&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list document }
             *
             * 获取百科分类
             *
             * 获取企业百科当前分类。;企业百科目前为二级分类体系，每个词条可添加多个二级分类，但每个一级分类下只能添加一个分类。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/classifications`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 草稿
           */
          draft: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=draft&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create document }
             *
             * 创建草稿
             *
             * 草稿并非百科词条，而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后，草稿将变为新的词条或覆盖已有词条。
             *
             * · 创建新的百科词条时，无需传入 entity_id 字段;· 更新已有百科词条时，请传入对应词条的 entity_id 或 outer_info
             *
             * 以用户身份创建草稿（即 Authorization 使用 user_access_token），对应用户将收到由企业百科 Bot 发送的审核结果；以应用身份创建草稿（即 Authorization 使用 tenant_access_toke），不会收到任何通知。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/drafts`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=draft&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update document }
             *
             * 更新草稿
             *
             * 根据 draft_id 更新草稿内容，已审批的草稿无法编辑
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 词条
           */
          entity: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create document }
             *
             * 创建免审词条
             *
             * 通过此接口创建的词条，不需要百科管理员审核可直接写入词库，请慎重使用【租户管理员请慎重审批】。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=extract&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract document }
             *
             * 提取潜在的百科词条
             *
             * 提取文本中可能成为百科词条的词语，且不会过滤已经成为百科词条的词语。同时，会返回推荐的别名。
             */
            extract: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/extract`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get document }
             *
             * 获取词条详情
             *
             * 通过词条 id 拉取对应的词条详情信息。
             *
             * 也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/:entity_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=highlight&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight document }
             *
             * 词条高亮
             *
             * 传入一句话，智能识别句中对应的词条，并返回词条位置和 entity_id，可在外部系统中快速实现百科词条智能高亮。
             */
            highlight: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/highlight`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list document }
             *
             * 获取词条列表
             *
             * 分页拉取词条列表数据，支持拉取租户内的全部词条。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=match&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match document }
             *
             * 精准搜索词条
             *
             * 将关键词与词条名、别名精准匹配，并返回对应的 词条 ID。
             */
            match: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/match`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search document }
             *
             * 模糊搜索词条
             *
             * 传入关键词，与词条名、别名、释义等信息进行模糊匹配，返回搜到的词条信息。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update document }
             *
             * 更新免审词条
             *
             * 通过此接口更新已有的词条，不需要百科管理员审核可直接写入词库，请慎重使用【租户管理员请慎重审批】。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/:entity_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 文件
           */
          file: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=file&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download document }
             *
             * 图片下载
             *
             * 通过 file_token 下载原图片
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/files/:file_token/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=baike&resource=file&apiName=upload&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload document }
             *
             * 图片上传
             *
             * 百科词条图片资源上传。
             */
            upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/baike/v1/files/upload`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          v1: {
            /**
             * 分类
             */
            classification: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/baike/v1/classifications`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=classification&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list document }
               *
               * 获取百科分类
               *
               * 获取企业百科当前分类。;企业百科目前为二级分类体系，每个词条可添加多个二级分类，但每个一级分类下只能添加一个分类。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/classifications`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 草稿
             */
            draft: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=draft&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create document }
               *
               * 创建草稿
               *
               * 草稿并非百科词条，而是指通过 API 发起创建新词条或更新现有词条的申请。百科管理员审核通过后，草稿将变为新的词条或覆盖已有词条。
               *
               * · 创建新的百科词条时，无需传入 entity_id 字段;· 更新已有百科词条时，请传入对应词条的 entity_id 或 outer_info
               *
               * 以用户身份创建草稿（即 Authorization 使用 user_access_token），对应用户将收到由企业百科 Bot 发送的审核结果；以应用身份创建草稿（即 Authorization 使用 tenant_access_toke），不会收到任何通知。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/drafts`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=draft&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update document }
               *
               * 更新草稿
               *
               * 根据 draft_id 更新草稿内容，已审批的草稿无法编辑
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 词条
             */
            entity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create document }
               *
               * 创建免审词条
               *
               * 通过此接口创建的词条，不需要百科管理员审核可直接写入词库，请慎重使用【租户管理员请慎重审批】。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=extract&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract document }
               *
               * 提取潜在的百科词条
               *
               * 提取文本中可能成为百科词条的词语，且不会过滤已经成为百科词条的词语。同时，会返回推荐的别名。
               */
              extract: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/extract`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get document }
               *
               * 获取词条详情
               *
               * 通过词条 id 拉取对应的词条详情信息。
               *
               * 也支持通过 provider 和 outer_id 返回对应实体的详情数据。此时路径中的 entity_id 为固定的 enterprise_0
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/:entity_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=highlight&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight document }
               *
               * 词条高亮
               *
               * 传入一句话，智能识别句中对应的词条，并返回词条位置和 entity_id，可在外部系统中快速实现百科词条智能高亮。
               */
              highlight: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/highlight`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list document }
               *
               * 获取词条列表
               *
               * 分页拉取词条列表数据，支持拉取租户内的全部词条。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=match&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match document }
               *
               * 精准搜索词条
               *
               * 将关键词与词条名、别名精准匹配，并返回对应的 词条 ID。
               */
              match: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/match`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search document }
               *
               * 模糊搜索词条
               *
               * 传入关键词，与词条名、别名、释义等信息进行模糊匹配，返回搜到的词条信息。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=entity&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update document }
               *
               * 更新免审词条
               *
               * 通过此接口更新已有的词条，不需要百科管理员审核可直接写入词库，请慎重使用【租户管理员请慎重审批】。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/entities/:entity_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 文件
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=file&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download document }
               *
               * 图片下载
               *
               * 通过 file_token 下载原图片
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/files/:file_token/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=baike&resource=file&apiName=upload&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload document }
               *
               * 图片上传
               *
               * 百科词条图片资源上传。
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/baike/v1/files/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            }
          }
        };
      }
    };
    var Client$X = class extends Client$Y {
      constructor() {
        super(...arguments);
        this.base = {
          v2: {
            /**
             * app.role
             */
            appRole: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=base&resource=app.role&version=v2 document }
               *
               * 新增自定义角色
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=base&resource=app.role&version=v2 document }
               *
               * 列出自定义角色
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=base&resource=app.role&version=v2 document }
               *
               * 更新自定义角色
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$W = class extends Client$X {
      constructor() {
        super(...arguments);
        this.bitable = {
          /**
           * 多维表格
           */
          app: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=copy&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 document }
             */
            copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get document }
             *
             * 获取多维表格元数据
             *
             * 获取指定多维表格的元数据信息，包括多维表格名称，多维表格版本号，多维表格是否开启高级权限等。
             *
             * 该接口支持调用频率上限为 20 QPS（Query Per Second，每秒请求率）
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update document }
             *
             * 更新多维表格元数据
             *
             * 通过 app_token 更新多维表格元数据
             *
             * 该接口支持调用频率上限为 10 QPS
             *
             * - 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作，先修改多维表格名字，后开关高级权限。可能存在部分成功的情况
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 仪表盘
           */
          appDashboard: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.dashboard&apiName=copy&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy document }
             *
             * 复制仪表盘
             *
             * 该接口用于根据现有仪表盘复制出新的仪表盘
             */
            copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.dashboard&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list document }
             *
             * 列出仪表盘
             *
             * 根据 app_token，获取多维表格下的所有仪表盘
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 自定义角色
           */
          appRole: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create document }
             *
             * 新增自定义角色
             *
             * 新增自定义角色
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete document }
             *
             * 删除自定义角色
             *
             * 删除自定义角色
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list document }
             *
             * 列出自定义角色
             *
             * 列出自定义角色
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update document }
             *
             * 更新自定义角色
             *
             * 更新自定义角色
             *
             * 更新自定义角色是全量更新，会完全覆盖旧的自定义角色设置
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 协作者
           */
          appRoleMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create document }
             *
             * 批量新增协作者
             *
             * 批量新增自定义角色的协作者
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete document }
             *
             * 批量删除协作者
             *
             * 批量删除自定义角色的协作者
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create document }
             *
             * 新增协作者
             *
             * 新增自定义角色的协作者
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete document }
             *
             * 删除协作者
             *
             * 删除自定义角色的协作者
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list document }
             *
             * 列出协作者
             *
             * 列出自定义角色的协作者
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 数据表
           */
          appTable: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create document }
             *
             * 新增多个数据表
             *
             * 新增多个数据表
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete document }
             *
             * 删除多个数据表
             *
             * 删除多个数据表
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create document }
             *
             * 新增数据表
             *
             * 新增一个数据表
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete document }
             *
             * 删除数据表
             *
             * 删除一个数据表
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list document }
             *
             * 列出数据表
             *
             * 根据  app_token，获取多维表格下的所有数据表
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 字段
           */
          appTableField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create document }
             *
             * 新增字段
             *
             * 该接口用于在数据表中新增一个字段
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete document }
             *
             * 删除字段
             *
             * 该接口用于在数据表中删除一个字段
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list document }
             *
             * 列出字段
             *
             * 根据 app_token 和 table_id，获取数据表的所有字段
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update document }
             *
             * 更新字段
             *
             * 该接口用于在数据表中更新一个字段
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 表单
           */
          appTableFormField: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form.field&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list document }
             *
             * 列出表单问题
             *
             * 列出表单的所有问题项
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form.field&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch document }
             *
             * 更新表单问题
             *
             * 该接口用于更新表单中的问题项
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 表单
           */
          appTableForm: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get document }
             *
             * 获取表单元数据
             *
             * 获取表单的所有元数据项
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch document }
             *
             * 更新表单元数据
             *
             * 该接口用于更新表单中的元数据项
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 记录
           */
          appTableRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create document }
             *
             * 新增多条记录
             *
             * 该接口用于在数据表中新增多条记录，单次调用最多新增 500 条记录。
             *
             * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete document }
             *
             * 删除多条记录
             *
             * 该接口用于删除数据表中现有的多条记录，单次调用中最多删除 500 条记录。
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=bitable&resource=app.table.record&version=v1 document }
             *
             * 批量获取多维表格记录
             */
            batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update document }
             *
             * 更新多条记录
             *
             * 该接口用于更新数据表中的多条记录，单次调用最多更新 500 条记录。
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create document }
             *
             * 新增记录
             *
             * 该接口用于在数据表中新增一条记录
             *
             * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete document }
             *
             * 删除记录
             *
             * 该接口用于删除数据表中的一条记录
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get document }
             *
             * 检索记录
             *
             * 该接口用于根据 record_id 的值检索现有记录
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list document }
             *
             * 列出记录
             *
             * 该接口用于列出数据表中的现有记录，单次最多列出 500 行记录，支持分页获取。
             *
             * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率），1000 QPM（Query Per Minute，每分钟请求率）
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=bitable&resource=app.table.record&version=v1 document }
             *
             * 查找多维表格记录
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update document }
             *
             * 更新记录
             *
             * 该接口用于更新数据表中的一条记录
             *
             * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 视图
           */
          appTableView: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create document }
             *
             * 新增视图
             *
             * 在数据表中新增一个视图
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete document }
             *
             * 删除视图
             *
             * 删除数据表中的视图
             *
             * 该接口支持调用频率上限为 10 QPS
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get document }
             *
             * 检索视图
             *
             * 该接口根据 view_id 检索现有视图
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list document }
             *
             * 列出视图
             *
             * 根据 app_token 和 table_id，获取数据表的所有视图
             *
             * 该接口支持调用频率上限为 20 QPS
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch document }
             *
             * 更新视图
             *
             * 该接口用于增量修改视图信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * app.workflow
           */
          appWorkflow: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.workflow&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=bitable&resource=app.workflow&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.workflow&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=bitable&resource=app.workflow&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 多维表格
             */
            app: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=copy&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=copy&project=bitable&resource=app&version=v1 document }
               */
              copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=bitable&resource=app&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/get document }
               *
               * 获取多维表格元数据
               *
               * 获取指定多维表格的元数据信息，包括多维表格名称，多维表格版本号，多维表格是否开启高级权限等。
               *
               * 该接口支持调用频率上限为 20 QPS（Query Per Second，每秒请求率）
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/update document }
               *
               * 更新多维表格元数据
               *
               * 通过 app_token 更新多维表格元数据
               *
               * 该接口支持调用频率上限为 10 QPS
               *
               * - 飞书文档、飞书表格、知识库中的多维表格不支持开启高级权限;- 此接口非原子操作，先修改多维表格名字，后开关高级权限。可能存在部分成功的情况
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 仪表盘
             */
            appDashboard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.dashboard&apiName=copy&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/copy document }
               *
               * 复制仪表盘
               *
               * 该接口用于根据现有仪表盘复制出新的仪表盘
               */
              copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.dashboard&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-dashboard/list document }
               *
               * 列出仪表盘
               *
               * 根据 app_token，获取多维表格下的所有仪表盘
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 自定义角色
             */
            appRole: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/create document }
               *
               * 新增自定义角色
               *
               * 新增自定义角色
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/delete document }
               *
               * 删除自定义角色
               *
               * 删除自定义角色
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/list document }
               *
               * 列出自定义角色
               *
               * 列出自定义角色
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role/update document }
               *
               * 更新自定义角色
               *
               * 更新自定义角色
               *
               * 更新自定义角色是全量更新，会完全覆盖旧的自定义角色设置
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 协作者
             */
            appRoleMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_create document }
               *
               * 批量新增协作者
               *
               * 批量新增自定义角色的协作者
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/batch_delete document }
               *
               * 批量删除协作者
               *
               * 批量删除自定义角色的协作者
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/create document }
               *
               * 新增协作者
               *
               * 新增自定义角色的协作者
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/delete document }
               *
               * 删除协作者
               *
               * 删除自定义角色的协作者
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.role.member&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-role-member/list document }
               *
               * 列出协作者
               *
               * 列出自定义角色的协作者
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 数据表
             */
            appTable: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_create document }
               *
               * 新增多个数据表
               *
               * 新增多个数据表
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/batch_delete document }
               *
               * 删除多个数据表
               *
               * 删除多个数据表
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/create document }
               *
               * 新增数据表
               *
               * 新增一个数据表
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/delete document }
               *
               * 删除数据表
               *
               * 删除一个数据表
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/list document }
               *
               * 列出数据表
               *
               * 根据  app_token，获取多维表格下的所有数据表
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 字段
             */
            appTableField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/create document }
               *
               * 新增字段
               *
               * 该接口用于在数据表中新增一个字段
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/delete document }
               *
               * 删除字段
               *
               * 该接口用于在数据表中删除一个字段
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/list document }
               *
               * 列出字段
               *
               * 根据 app_token 和 table_id，获取数据表的所有字段
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.field&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field/update document }
               *
               * 更新字段
               *
               * 该接口用于在数据表中更新一个字段
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 表单
             */
            appTableFormField: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form.field&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/list document }
               *
               * 列出表单问题
               *
               * 列出表单的所有问题项
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form.field&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form-field/patch document }
               *
               * 更新表单问题
               *
               * 该接口用于更新表单中的问题项
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 表单
             */
            appTableForm: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/get document }
               *
               * 获取表单元数据
               *
               * 获取表单的所有元数据项
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.form&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch document }
               *
               * 更新表单元数据
               *
               * 该接口用于更新表单中的元数据项
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 记录
             */
            appTableRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_create document }
               *
               * 新增多条记录
               *
               * 该接口用于在数据表中新增多条记录，单次调用最多新增 500 条记录。
               *
               * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_delete document }
               *
               * 删除多条记录
               *
               * 该接口用于删除数据表中现有的多条记录，单次调用中最多删除 500 条记录。
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=bitable&resource=app.table.record&version=v1 document }
               *
               * 批量获取多维表格记录
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/batch_update document }
               *
               * 更新多条记录
               *
               * 该接口用于更新数据表中的多条记录，单次调用最多更新 500 条记录。
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/create document }
               *
               * 新增记录
               *
               * 该接口用于在数据表中新增一条记录
               *
               * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/delete document }
               *
               * 删除记录
               *
               * 该接口用于删除数据表中的一条记录
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/get document }
               *
               * 检索记录
               *
               * 该接口用于根据 record_id 的值检索现有记录
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/list document }
               *
               * 列出记录
               *
               * 该接口用于列出数据表中的现有记录，单次最多列出 500 行记录，支持分页获取。
               *
               * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率），1000 QPM（Query Per Minute，每分钟请求率）
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=bitable&resource=app.table.record&version=v1 document }
               *
               * 查找多维表格记录
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.record&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/update document }
               *
               * 更新记录
               *
               * 该接口用于更新数据表中的一条记录
               *
               * 该接口支持调用频率上限为 10 QPS（Query Per Second，每秒请求率）
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 视图
             */
            appTableView: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/create document }
               *
               * 新增视图
               *
               * 在数据表中新增一个视图
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/delete document }
               *
               * 删除视图
               *
               * 删除数据表中的视图
               *
               * 该接口支持调用频率上限为 10 QPS
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/get document }
               *
               * 检索视图
               *
               * 该接口根据 view_id 检索现有视图
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/list document }
               *
               * 列出视图
               *
               * 根据 app_token 和 table_id，获取数据表的所有视图
               *
               * 该接口支持调用频率上限为 20 QPS
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table.view&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-view/patch document }
               *
               * 更新视图
               *
               * 该接口用于增量修改视图信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app.workflow
             */
            appWorkflow: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.workflow&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=bitable&resource=app.workflow&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.workflow&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=bitable&resource=app.workflow&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$V = class extends Client$W {
      constructor() {
        super(...arguments);
        this.block = {
          /**
           * 服务端 API
           */
          entity: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=block&resource=entity&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create document }
             *
             * 创建 BlockEntity
             *
             * 开发者可以通过该接口将部分或全部数据存放于 BlockEntity。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/block/v2/entities`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=block&resource=entity&apiName=update&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update document }
             *
             * 更新BlockEntity
             *
             * 开发者通过该接口可以更新存储在BlockEntity中的数据，并实时推送到端侧。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/block/v2/entities/:block_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 服务端 API
           */
          message: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=block&resource=message&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create document }
             *
             * Block协同数据推送
             *
             * 根据BlockID向指定用户列表推送协同数据。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/block/v2/message`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v2: {
            /**
             * 服务端 API
             */
            entity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=block&resource=entity&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/create document }
               *
               * 创建 BlockEntity
               *
               * 开发者可以通过该接口将部分或全部数据存放于 BlockEntity。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/block/v2/entities`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=block&resource=entity&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/entity/update document }
               *
               * 更新BlockEntity
               *
               * 开发者通过该接口可以更新存储在BlockEntity中的数据，并实时推送到端侧。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/block/v2/entities/:block_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 服务端 API
             */
            message: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=block&resource=message&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/block-v2/message/create document }
               *
               * Block协同数据推送
               *
               * 根据BlockID向指定用户列表推送协同数据。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/block/v2/message`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$U = class extends Client$V {
      constructor() {
        super(...arguments);
        this.board = {
          v1: {
            /**
             * whiteboard
             */
            whiteboard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard&apiName=download_as_image&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download_as_image&project=board&resource=whiteboard&version=v1 document }
               *
               * 下载画板为图片
               */
              downloadAsImage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard&apiName=theme&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=theme&project=board&resource=whiteboard&version=v1 document }
               *
               * 获取画板的主题
               */
              theme: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard&apiName=update_theme&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_theme&project=board&resource=whiteboard&version=v1 document }
               *
               * 更新画板主题
               */
              updateTheme: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * whiteboard.node
             */
            whiteboardNode: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard.node&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=board&resource=whiteboard.node&version=v1 document }
               *
               * 在画板中创建节点
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard.node&apiName=create_plantuml&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_plantuml&project=board&resource=whiteboard.node&version=v1 document }
               *
               * 创建 plant uml 图形
               */
              createPlantuml: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=board&resource=whiteboard.node&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=board&resource=whiteboard.node&version=v1 document }
               *
               * 列出画板内的节点数据
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$T = class extends Client$U {
      constructor() {
        super(...arguments);
        this.calendar = {
          /**
           * 日历访问控制
           */
          calendarAcl: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create document }
             *
             * 创建访问控制
             *
             * 该接口用于以当前身份（应用 / 用户）给日历添加访问控制权限，即日历成员。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete document }
             *
             * 删除访问控制
             *
             * 该接口用于以当前身份（应用 / 用户）删除日历的控制权限，即日历成员。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list document }
             *
             * 获取访问控制列表
             *
             * 该接口用于以当前身份（应用 / 用户）获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=subscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription document }
             *
             * 订阅日历访问控制变更事件;
             *
             * 该接口用于以用户身份订阅指定日历下的日历成员变更事件。
             *
             * 用户必须对日历有访问权限。
             */
            subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=unsubscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription document }
             *
             * 取消订阅日历访问控制变更事件
             *
             * 该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。
             *
             * 用户必须对日历有访问权限。
             */
            unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 日历管理
           */
          calendar: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create document }
             *
             * 创建共享日历
             *
             * 该接口用于为当前身份（应用 / 用户）创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete document }
             *
             * 删除共享日历
             *
             * 该接口用于以当前身份（应用 / 用户）删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历具有 owner 权限。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get document }
             *
             * 查询日历信息
             *
             * 该接口用于以当前身份（应用 / 用户）根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历有访问权限。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list document }
             *
             * 查询日历列表
             *
             * 该接口用于分页获得当前身份（应用 / 用户）的日历列表。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 调用时首先使用 page_token 分页拉取存量数据，之后使用 sync_token 增量同步变更数据。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=mget&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=calendar&resource=calendar&version=v4 document }
             */
            mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/mget`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=patch&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch document }
             *
             * 更新日历信息
             *
             * 该接口用于以当前身份（应用 / 用户）修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份对日历有 owner 权限时，可修改全局字段：summary, description, permission。;;当前身份对日历不具有 owner 权限时，仅可修改对自己生效的字段：color, summary_alias。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=primary&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary document }
             *
             * 查询主日历信息
             *
             * 获取当前身份的主日历信息。
             */
            primary: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/primary`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=primarys&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=primarys&project=calendar&resource=calendar&version=v4 document }
             */
            primarys: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/primarys`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=search&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search document }
             *
             * 搜索日历
             *
             * 该接口用于通过关键字查询公共日历或用户主日历。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=subscribe&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe document }
             *
             * 订阅日历
             *
             * 该接口用于以当前身份（应用 / 用户）订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * - 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。
             */
            subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=subscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription document }
             *
             * 订阅日历变更事件
             *
             * 该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。
             */
            subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/subscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=unsubscribe&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe document }
             *
             * 取消订阅日历
             *
             * 该接口用于以当前身份（应用 / 用户）取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 仅可操作已经被当前身份订阅的日历。
             */
            unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=unsubscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription document }
             *
             * 取消订阅日历变更事件
             *
             * 该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。
             */
            unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 日程参与人
           */
          calendarEventAttendee: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=batch_delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete document }
             *
             * 删除日程参与人
             *
             * 批量删除日程的参与人。
             *
             * - 当前身份需要有日历的 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create document }
             *
             * 创建日程参与人;
             *
             * 批量给日程添加参与人。
             *
             * - 当前身份需要有日历的 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者，或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后，会议室会进入异步的预约流程，请求结束不代表会议室预约成功，需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制（当前不支持用管理员身份给其他人的日程预约会议室）
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list document }
             *
             * 获取日程参与人列表
             *
             * 获取日程的参与人列表，若参与者列表中有群组，请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。
             *
             * - 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;;- 当前身份必须有权限查看日程的参与人列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 日程参与人群成员
           */
          calendarEventAttendeeChatMember: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee.chat_member&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list document }
             *
             * 获取日程参与群成员列表
             *
             * 获取日程的群参与人的群成员列表。
             *
             * - 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中，或有权限查看群成员列表。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 日程
           */
          calendarEvent: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create document }
             *
             * 创建日程
             *
             * 该接口用于以当前身份（应用 / 用户）在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete document }
             *
             * 删除日程
             *
             * 该接口用于以当前身份（应用 / 用户）删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get document }
             *
             * 获取日程
             *
             * 该接口用于以当前身份（应用 / 用户）获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。
             *
             * - 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀，来获取修改的重复性日程的哪一天日程的时间信息。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=instance_view&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=instance_view&project=calendar&resource=calendar.event&version=v4 document }
             */
            instanceView: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=instances&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=instances&project=calendar&resource=calendar.event&version=v4 document }
             */
            instances: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list document }
             *
             * 获取日程列表
             *
             * 该接口用于以当前身份（应用 / 用户）获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。
             *
             * - 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据，sync_token 增量同步变更数据；目前仅传anchor_time时，会返回page_token。;;- 为了确保调用方日程同步数据的一致性，在使用sync_token时，不能同时使用start_time和end_time，否则可能造成日程数据缺失。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=patch&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch document }
             *
             * 更新日程
             *
             * 该接口用于以当前身份（应用 / 用户）更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时，可修改所有可编辑字段。;;当前身份为日程参与者时，仅可编辑部分字段。（如：visibility, free_busy_status, color, reminders）
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=reply&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reply&project=calendar&resource=calendar.event&version=v4 document }
             */
            reply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=search&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search document }
             *
             * 搜索日程
             *
             * 该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。
             *
             * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=subscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription document }
             *
             * 订阅日程变更事件
             *
             * 该接口用于以用户身份订阅指定日历下的日程变更事件。
             *
             * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
             */
            subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=unsubscription&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription document }
             *
             * 取消订阅日程变更事件
             *
             * 该接口用于以用户身份取消订阅指定日历下的日程变更事件。
             *
             * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
             */
            unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * calendar.event.meeting_chat
           */
          calendarEventMeetingChat: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_chat&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_chat&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * calendar.event.meeting_minute
           */
          calendarEventMeetingMinute: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_minute&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_minute&version=v4 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * Exchange绑定
           */
          exchangeBinding: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create document }
             *
             * 创建Exchange绑定关系
             *
             * 本接口将Exchange账户绑定到飞书账户，进而支持Exchange日历的导入
             *
             * 操作用户需要是企业超级管理员
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete document }
             *
             * 解除Exchange绑定关系
             *
             * 本接口解除Exchange账户和飞书账户的绑定关系，Exchange账户解除绑定后才能绑定其他飞书账户
             *
             * 操作用户需要是企业超级管理员
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=get&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get document }
             *
             * 获取绑定状态
             *
             * 本接口获取Exchange账户的绑定状态，包括exchange日历是否同步完成。
             *
             * 操作用户需要是企业超级管理员
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * freebusy
           */
          freebusy: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=freebusy&apiName=batch&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=calendar&resource=freebusy&version=v4 document }
             */
            batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/freebusy/batch`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=freebusy&apiName=list&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list document }
             *
             * 查询主日历忙闲信息
             *
             * 查询用户主日历或会议室的忙闲信息。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/freebusy/list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 日历设置
           */
          setting: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=setting&apiName=generate_caldav_conf&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf document }
             *
             * 生成CalDAV配置
             *
             * 用于为当前用户生成一个CalDAV账号密码，用于将飞书日历信息同步到本地设备日历。
             */
            generateCaldavConf: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 请假
           */
          timeoffEvent: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=timeoff_event&apiName=create&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create document }
             *
             * 创建请假日程
             *
             * 为指定用户创建一个请假日程，可以是一个普通请假日程，也可以是一个全天日程。;创建请假日程后，会在相应时间内，在用户个人签名页展示请假信息。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/timeoff_events`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=timeoff_event&apiName=delete&version=v4 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete document }
             *
             * 删除请假日程
             *
             * 删除一个指定的请假日程，请假日程删除，用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v4: {
            /**
             * 日历访问控制
             */
            calendarAcl: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/create document }
               *
               * 创建访问控制
               *
               * 该接口用于以当前身份（应用 / 用户）给日历添加访问控制权限，即日历成员。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/delete document }
               *
               * 删除访问控制
               *
               * 该接口用于以当前身份（应用 / 用户）删除日历的控制权限，即日历成员。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/list document }
               *
               * 获取访问控制列表
               *
               * 该接口用于以当前身份（应用 / 用户）获取日历的控制权限列表。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份需要有日历的 owner 权限，并且日历的类型只能为 primary 或 shared。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=subscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/subscription document }
               *
               * 订阅日历访问控制变更事件;
               *
               * 该接口用于以用户身份订阅指定日历下的日历成员变更事件。
               *
               * 用户必须对日历有访问权限。
               */
              subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.acl&apiName=unsubscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-acl/unsubscription document }
               *
               * 取消订阅日历访问控制变更事件
               *
               * 该接口用于以用户身份取消订阅指定日历下的日历成员变更事件。
               *
               * 用户必须对日历有访问权限。
               */
              unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 日历管理
             */
            calendar: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/create document }
               *
               * 创建共享日历
               *
               * 该接口用于为当前身份（应用 / 用户）创建一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/delete document }
               *
               * 删除共享日历
               *
               * 该接口用于以当前身份（应用 / 用户）删除一个共享日历。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历具有 owner 权限。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get document }
               *
               * 查询日历信息
               *
               * 该接口用于以当前身份（应用 / 用户）根据日历 ID 获取日历信息。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历有访问权限。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/list document }
               *
               * 查询日历列表
               *
               * 该接口用于分页获得当前身份（应用 / 用户）的日历列表。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 调用时首先使用 page_token 分页拉取存量数据，之后使用 sync_token 增量同步变更数据。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=mget&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=calendar&resource=calendar&version=v4 document }
               */
              mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/mget`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=patch&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/patch document }
               *
               * 更新日历信息
               *
               * 该接口用于以当前身份（应用 / 用户）修改日历信息。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份对日历有 owner 权限时，可修改全局字段：summary, description, permission。;;当前身份对日历不具有 owner 权限时，仅可修改对自己生效的字段：color, summary_alias。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=primary&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/primary document }
               *
               * 查询主日历信息
               *
               * 获取当前身份的主日历信息。
               */
              primary: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/primary`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=primarys&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=primarys&project=calendar&resource=calendar&version=v4 document }
               */
              primarys: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/primarys`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=search&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/search document }
               *
               * 搜索日历
               *
               * 该接口用于通过关键字查询公共日历或用户主日历。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=subscribe&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscribe document }
               *
               * 订阅日历
               *
               * 该接口用于以当前身份（应用 / 用户）订阅某个日历。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * - 仅可订阅类型为 primary 或 shared 的公开日历。;- 可订阅日历数量上限为1000。
               */
              subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=subscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/subscription document }
               *
               * 订阅日历变更事件
               *
               * 该接口用于以用户身份订阅当前身份下日历列表中的所有日历变更。
               */
              subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/subscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=unsubscribe&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscribe document }
               *
               * 取消订阅日历
               *
               * 该接口用于以当前身份（应用 / 用户）取消对某日历的订阅状态。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 仅可操作已经被当前身份订阅的日历。
               */
              unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar&apiName=unsubscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/unsubscription document }
               *
               * 取消订阅日历变更事件
               *
               * 该接口用于以用户身份取消订阅当前身份下日历列表中的日历变更事件。
               */
              unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 日程参与人
             */
            calendarEventAttendee: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=batch_delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/batch_delete document }
               *
               * 删除日程参与人
               *
               * 批量删除日程的参与人。
               *
               * - 当前身份需要有日历的 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者。
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/create document }
               *
               * 创建日程参与人;
               *
               * 批量给日程添加参与人。
               *
               * - 当前身份需要有日历的 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;- 当前身份需要是日程的组织者，或日程设置了「参与人可邀请其它参与人」权限。;;- 新添加的日程参与人必须与日程组织者在同一个企业内。;;- 使用该接口添加会议室后，会议室会进入异步的预约流程，请求结束不代表会议室预约成功，需后续再查询预约状态。;;- 每个日程最多只能有 3000 名参与人。;;- 开启管理员能力后预约会议室可不受会议室预约范围的限制（当前不支持用管理员身份给其他人的日程预约会议室）
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee/list document }
               *
               * 获取日程参与人列表
               *
               * 获取日程的参与人列表，若参与者列表中有群组，请使用 [获取参与人群成员列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list) 。
               *
               * - 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;;- 当前身份必须有权限查看日程的参与人列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 日程参与人群成员
             */
            calendarEventAttendeeChatMember: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.attendee.chat_member&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event-attendee-chat_member/list document }
               *
               * 获取日程参与群成员列表
               *
               * 获取日程的群参与人的群成员列表。
               *
               * - 当前身份必须有权限查看日程的参与人列表。;;- 当前身份必须在群聊中，或有权限查看群成员列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 日程
             */
            calendarEvent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/create document }
               *
               * 创建日程
               *
               * 该接口用于以当前身份（应用 / 用户）在日历上创建一个日程。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/delete document }
               *
               * 删除日程
               *
               * 该接口用于以当前身份（应用 / 用户）删除日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;当前身份必须是日程的组织者。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/get document }
               *
               * 获取日程
               *
               * 该接口用于以当前身份（应用 / 用户）获取日历上的一个日程。;身份由 Header Authorization 的 Token 类型决定。
               *
               * - 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;- [例外日程](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/introduction#71c5ec78)可通过event_id的非0时间戳后缀，来获取修改的重复性日程的哪一天日程的时间信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=instance_view&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=instance_view&project=calendar&resource=calendar.event&version=v4 document }
               */
              instanceView: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=instances&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=instances&project=calendar&resource=calendar.event&version=v4 document }
               */
              instances: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/list document }
               *
               * 获取日程列表
               *
               * 该接口用于以当前身份（应用 / 用户）获取日历下的日程列表。;身份由 Header Authorization 的 Token 类型决定。
               *
               * - 当前身份必须对日历有reader、writer或owner权限才会返回日程详细信息（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。;;- 仅支持primary、shared和resource类型的日历获取日程列表。;;- page_token 分页拉取存量数据，sync_token 增量同步变更数据；目前仅传anchor_time时，会返回page_token。;;- 为了确保调用方日程同步数据的一致性，在使用sync_token时，不能同时使用start_time和end_time，否则可能造成日程数据缺失。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=patch&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/patch document }
               *
               * 更新日程
               *
               * 该接口用于以当前身份（应用 / 用户）更新日历上的一个日程。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历有 writer 或 owner 权限，并且日历的类型只能为 primary 或 shared。;;当前身份为日程组织者时，可修改所有可编辑字段。;;当前身份为日程参与者时，仅可编辑部分字段。（如：visibility, free_busy_status, color, reminders）
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=reply&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reply&project=calendar&resource=calendar.event&version=v4 document }
               */
              reply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=search&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/search document }
               *
               * 搜索日程
               *
               * 该接口用于以用户身份搜索某日历下的相关日程。;;身份由 Header Authorization 的 Token 类型决定。
               *
               * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=subscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/subscription document }
               *
               * 订阅日程变更事件
               *
               * 该接口用于以用户身份订阅指定日历下的日程变更事件。
               *
               * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
               */
              subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event&apiName=unsubscription&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar-event/unsubscription document }
               *
               * 取消订阅日程变更事件
               *
               * 该接口用于以用户身份取消订阅指定日历下的日程变更事件。
               *
               * 当前身份必须对日历有reader、writer或owner权限（调用[获取日历](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/calendar/get)接口，role字段可查看权限）。
               */
              unsubscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * calendar.event.meeting_chat
             */
            calendarEventMeetingChat: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_chat&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_chat&version=v4 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_chat&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=calendar&resource=calendar.event.meeting_chat&version=v4 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * calendar.event.meeting_minute
             */
            calendarEventMeetingMinute: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=calendar.event.meeting_minute&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=calendar&resource=calendar.event.meeting_minute&version=v4 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * Exchange绑定
             */
            exchangeBinding: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/create document }
               *
               * 创建Exchange绑定关系
               *
               * 本接口将Exchange账户绑定到飞书账户，进而支持Exchange日历的导入
               *
               * 操作用户需要是企业超级管理员
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/delete document }
               *
               * 解除Exchange绑定关系
               *
               * 本接口解除Exchange账户和飞书账户的绑定关系，Exchange账户解除绑定后才能绑定其他飞书账户
               *
               * 操作用户需要是企业超级管理员
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=exchange_binding&apiName=get&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/exchange_binding/get document }
               *
               * 获取绑定状态
               *
               * 本接口获取Exchange账户的绑定状态，包括exchange日历是否同步完成。
               *
               * 操作用户需要是企业超级管理员
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * freebusy
             */
            freebusy: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=freebusy&apiName=batch&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=calendar&resource=freebusy&version=v4 document }
               */
              batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/freebusy/batch`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=freebusy&apiName=list&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/freebusy/list document }
               *
               * 查询主日历忙闲信息
               *
               * 查询用户主日历或会议室的忙闲信息。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/freebusy/list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 日历设置
             */
            setting: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=setting&apiName=generate_caldav_conf&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/setting/generate_caldav_conf document }
               *
               * 生成CalDAV配置
               *
               * 用于为当前用户生成一个CalDAV账号密码，用于将飞书日历信息同步到本地设备日历。
               */
              generateCaldavConf: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 请假
             */
            timeoffEvent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=timeoff_event&apiName=create&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/create document }
               *
               * 创建请假日程
               *
               * 为指定用户创建一个请假日程，可以是一个普通请假日程，也可以是一个全天日程。;创建请假日程后，会在相应时间内，在用户个人签名页展示请假信息。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/timeoff_events`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=calendar&resource=timeoff_event&apiName=delete&version=v4 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/calendar-v4/timeoff_event/delete document }
               *
               * 删除请假日程
               *
               * 删除一个指定的请假日程，请假日程删除，用户个人签名页的请假信息也会消失。;一个应用只能删除自己创建的请假日程。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$S = class extends Client$T {
      constructor() {
        super(...arguments);
        this.cardkit = {
          v1: {
            /**
             * card
             */
            card: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=cardkit&resource=card&version=v1 document }
               *
               * 按指定的多个操作批量局部更新卡片，支持更新卡片设置、添加组件、删除组件、更新组件
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=cardkit&resource=card&version=v1 document }
               *
               * 创建卡片实例，成功后可通过发送消息等接口发送卡片实例
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card&apiName=id_convert&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=id_convert&project=cardkit&resource=card&version=v1 document }
               *
               * 获取消息 id 对应的卡片 id
               */
              idConvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card&apiName=settings&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=settings&project=cardkit&resource=card&version=v1 document }
               *
               * 更新指定的卡片设置
               */
              settings: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=cardkit&resource=card&version=v1 document }
               *
               * 对卡片进行全量更新，即：以全新的卡片内容更新已有卡片
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * card.element
             */
            cardElement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card.element&apiName=content&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=content&project=cardkit&resource=card.element&version=v1 document }
               *
               * 以传入的文本内容覆盖已有卡片组件内容，卡片将自动识别其中的增量变更内容，并以“打字机”效果输出。
               */
              content: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card.element&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=cardkit&resource=card.element&version=v1 document }
               *
               * 在卡片内指定位置添加组件
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card.element&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=cardkit&resource=card.element&version=v1 document }
               *
               * 删除卡片内的指定组件
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card.element&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=cardkit&resource=card.element&version=v1 document }
               *
               * 以传入的配置覆盖指定组件的已有配置
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=cardkit&resource=card.element&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=cardkit&resource=card.element&version=v1 document }
               *
               * 以新组件全量替换更新指定组件
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$R = class extends Client$S {
      constructor() {
        super(...arguments);
        this.comment_sdk = {};
      }
    };
    var Client$Q = class extends Client$R {
      constructor() {
        super(...arguments);
        this.compensation = {
          v1: {
            /**
             * archive
             */
            archive: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=archive&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=compensation&resource=archive&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/archives`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=archive&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=archive&version=v1 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/archives/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * change_reason
             */
            changeReason: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/change_reasons`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=change_reason&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=change_reason&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/change_reasons`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * indicator
             */
            indicator: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/indicators`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=indicator&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=indicator&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/indicators`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * item
             */
            item: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/items`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=item&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=item&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/items`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * item_category
             */
            itemCategory: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/item_categories`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=item_category&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=item_category&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/item_categories`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * lump_sum_payment
             */
            lumpSumPayment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=lump_sum_payment&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=compensation&resource=lump_sum_payment&version=v1 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=lump_sum_payment&apiName=batch_remove&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_remove&project=compensation&resource=lump_sum_payment&version=v1 document }
               */
              batchRemove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=lump_sum_payment&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=compensation&resource=lump_sum_payment&version=v1 document }
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=lump_sum_payment&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=lump_sum_payment&version=v1 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryDetailWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=lump_sum_payment&apiName=query_detail&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_detail&project=compensation&resource=lump_sum_payment&version=v1 document }
               */
              queryDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * plan
             */
            plan: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/plans`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=plan&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=plan&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/plans`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * recurring_payment
             */
            recurringPayment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=recurring_payment&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=compensation&resource=recurring_payment&version=v1 document }
               *
               * 创建经常性支付记录
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=recurring_payment&apiName=batch_remove&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_remove&project=compensation&resource=recurring_payment&version=v1 document }
               *
               * 删除经常性支付记录
               */
              batchRemove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=recurring_payment&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=compensation&resource=recurring_payment&version=v1 document }
               *
               * 更新经常性支付记录
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=recurring_payment&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=recurring_payment&version=v1 document }
               *
               * 查询经常性支付记录
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * social_archive
             */
            socialArchive: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=social_archive&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=social_archive&version=v1 document }
               *
               * 通过员工ID和生效时间查询参保档案
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_archive/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * social_archive_adjust_record
             */
            socialArchiveAdjustRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=social_archive_adjust_record&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=social_archive_adjust_record&version=v1 document }
               *
               * 根据员工ID查询待增员、待减员记录
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * social_insurance
             */
            socialInsurance: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=social_insurance&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=social_insurance&version=v1 document }
               *
               * 获取险种列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_insurances`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * social_plan
             */
            socialPlan: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_plans`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=social_plan&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=compensation&resource=social_plan&version=v1 document }
               *
               * 分页获取参保方案列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_plans`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=compensation&resource=social_plan&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=compensation&resource=social_plan&version=v1 document }
               *
               * 批量查询参保方案
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/compensation/v1/social_plans/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$P = class extends Client$Q {
      constructor() {
        super(...arguments);
        this.contact = {
          /**
           * 自定义用户字段
           */
          customAttr: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/custom_attrs`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=custom_attr&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list document }
             *
             * 获取企业自定义用户字段
             *
             * 获取企业自定义的用户字段配置信息
             *
             * 调用该接口前，需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif)
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/custom_attrs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 部门
           */
          department: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=batch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 document }
             */
            batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/batch`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            childrenWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=children&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children document }
             *
             * 获取子部门列表
             *
             * 通过部门ID获取部门的子部门列表。
             *
             * - 部门ID 必填，根部门的部门ID 为0。;- 使用 `user_access_token` 时，返回该用户组织架构可见性范围（[登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility)）内的所有可见部门。当进行递归查询时，最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0，会检验应用是否有全员通讯录权限，如果是非0 部门ID，则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码，有权限则返回部门下子部门列表（根据fetch_child决定是否递归）。
             */
            children: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create document }
             *
             * 创建部门
             *
             * 该接口用于向通讯录中创建部门。
             *
             * 只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门，则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete document }
             *
             * 删除部门
             *
             * 该接口用于从通讯录中删除部门。
             *
             * 应用需要同时拥有待删除部门及其父部门的通讯录授权。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get document }
             *
             * 获取单个部门信息
             *
             * 该接口用于向通讯录获取单个部门信息。
             *
             * - 使用`tenant_access_token`时，应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息，则需要拥有全员权限。;- 使用`user_access_token`时，用户需要有待查询部门的可见性，如果需要获取根部门信息，则要求员工可见所有人。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            parentWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/parent`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=parent&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent document }
             *
             * 获取父部门信息
             *
             * 该接口用来递归获取部门父部门的信息，并按照由子到父的顺序返回有权限的父部门信息列表。
             *
             * 使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如：A >>B>>C>>D四级部门，通讯录权限只到B，那么查询D部门的parent，会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。
             */
            parent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/parent`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch document }
             *
             * 修改部门部分信息
             *
             * 该接口用于更新通讯录中部门的信息。
             *
             * 调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=search&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search document }
             *
             * 搜索部门
             *
             * 搜索部门，用户通过关键词查询可见的部门数据，部门可见性需要管理员在后台配置。
             *
             * 部门存在，但用户搜索不到并不一定是搜索有问题，可能是管理员在后台配置了权限控制，导致用户无法搜索到该部门。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=unbind_department_chat&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat document }
             *
             * 部门群转为普通群
             *
             * 通过该接口将部门群转为普通群。
             */
            unbindDepartmentChat: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update document }
             *
             * 更新部门所有信息
             *
             * 该接口用于更新当前部门所有信息。
             *
             * - 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值（order字段除外）。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=update_department_id&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 document }
             */
            updateDepartmentId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 人员类型
           */
          employeeTypeEnum: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create document }
             *
             * 新增人员类型
             *
             * 新增自定义人员类型
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete document }
             *
             * 删除人员类型
             *
             * 删除自定义人员类型
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list document }
             *
             * 查询人员类型
             *
             * 该接口用于获取员工的人员类型
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update document }
             *
             * 更新人员类型
             *
             * 更新自定义人员类型
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * functional_role
           */
          functionalRole: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * functional_role.member
           */
          functionalRoleMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=batch_create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 document }
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=batch_delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=scopes&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 document }
             */
            scopes: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户组
           */
          group: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create document }
             *
             * 创建用户组
             *
             * 使用该接口创建用户组，请注意创建用户组时应用的通讯录权限范围需为“全部员工”，否则会创建失败，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete document }
             *
             * 删除用户组
             *
             * 通过该接口可删除企业中的用户组，请注意删除用户组时应用的通讯录权限范围需为“全部员工”，否则会删除失败，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get document }
             *
             * 查询用户组
             *
             * 根据用户组 ID 查询某个用户组的基本信息，支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=member_belong&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong document }
             *
             * 查询用户所属用户组
             *
             * 通过该接口可查询该用户所属的用户组列表，可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”，则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”，则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            memberBelong: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/member_belong`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch document }
             *
             * 更新用户组
             *
             * 使用该接口更新用户组信息，请注意更新用户组时应用的通讯录权限范围需为“全部员工”，否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            simplelistWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/simplelist`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=simplelist&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist document }
             *
             * 查询用户组列表
             *
             * 通过该接口可查询企业的用户组列表，可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”，则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”，则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            simplelist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/simplelist`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户组成员
           */
          groupMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=add&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add document }
             *
             * 添加用户组成员
             *
             * 向用户组中添加成员(目前成员仅支持用户，未来会支持部门)，如果应用的通讯录权限范围是“全部员工”，则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            add: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=batch_add&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add document }
             *
             * 批量添加用户组成员
             *
             * 向普通用户组中批量添加成员(目前仅支持添加用户，暂不支持添加部门），如果应用的通讯录权限范围是“全部员工”，则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             *
             * 请求体中的member_type，目前仅支持user， 未来将支持department。
             */
            batchAdd: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=batch_remove&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove document }
             *
             * 批量移除用户组成员
             *
             * 从普通用户组中批量移除成员 (目前仅支持移除用户，暂不支持移除部门）。如果应用的通讯录权限范围是“全部员工”，则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除， [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             *
             * 请求体中的member_type，目前仅支持user， 未来将支持department。
             */
            batchRemove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=remove&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove document }
             *
             * 移除用户组成员
             *
             * 从用户组中移除成员 (目前成员仅支持用户，未来会支持部门)，如果应用的通讯录权限范围是“全部员工”，则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除， [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=simplelist&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist document }
             *
             * 查询用户组成员列表
             *
             * 通过该接口可查询某个用户组的成员列表（支持查询成员中的用户和部门）, 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”，则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”，则仅可查询通讯录权限范围中的用户组的成员列表，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
             */
            simplelist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_family
           */
          jobFamily: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_level
           */
          jobLevel: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_title
           */
          jobTitle: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_title&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_title&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 通讯录权限范围
           */
          scope: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/scopes`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=scope&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list document }
             *
             * 获取通讯录授权范围
             *
             * 该接口用于获取应用被授权可访问的通讯录范围，包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时，返回的部门列表为该企业所有的一级部门；否则返回的部门为管理员在设置授权范围时勾选的部门（不包含勾选部门的子部门）。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/scopes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 单位
           */
          unit: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=bind_department&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department document }
             *
             * 建立部门与单位的绑定关系
             *
             * 通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能，企业需开通相关版本，否则会绑定失败，不同版本请参考[飞书版本对比](https://www.feishu.cn/service)
             */
            bindDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/bind_department`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create document }
             *
             * 创建单位
             *
             * 该接口用于创建单位。注意：单位功能属于旗舰版付费功能，企业需开通对应版本才可以创建单位，不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete document }
             *
             * 删除单位
             *
             * 使用该接口删除单位，需要有更新单位的权限。注意：如果单位的单位类型被其它的业务使用，不允许删除。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get document }
             *
             * 获取单位信息
             *
             * 该接口用于获取单位信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list document }
             *
             * 批量获取单位列表
             *
             * 通过该接口获取企业的单位列表，需获取单位的权限
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=list_department&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department document }
             *
             * 获取单位绑定的部门列表
             *
             * 通过该接口获取单位绑定的部门列表，需具有获取单位的权限
             */
            listDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/list_department`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch document }
             *
             * 修改单位信息
             *
             * 调用该接口，需要有更新单位的权限。注意：单位功能属于旗舰版付费功能，企业需开通对应版本才可以修改单位
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=unbind_department&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department document }
             *
             * 解除部门与单位的绑定关系
             *
             * 通过该接口解除部门与单位的绑定关系，需更新单位的权限，需对应部门的通讯录权限。由于单位是旗舰版付费功能，企业需开通相关功能，否则会解绑失败
             */
            unbindDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/unbind_department`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户
           */
          user: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=batch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 document }
             */
            batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/batch`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=batch_get_id&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id document }
             *
             * 通过手机号或邮箱获取用户 ID
             *
             * 通过该接口，可使用手机号/邮箱获取用户的 ID 信息，具体获取支持的 ID 类型包括 open_id、user_id、union_id，可通过查询参数指定。
             *
             * 如果查询的手机号、邮箱不存在，或者无权限查看对应的用户，则返回的用户ID列表为空。
             */
            batchGetId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/batch_get_id`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create document }
             *
             * 创建用户
             *
             * 使用该接口向通讯录创建一个用户，可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。
             *
             * - 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户，如果想要在根部门下新增用户，必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后，会给用户发送邀请短信/邮件，用户在操作同意后才可访问团队。;- 返回数据中不返回手机号，如果需要请重新查询用户信息获取手机号。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete document }
             *
             * 删除用户
             *
             * 该接口用于从通讯录删除一个用户信息，可以理解为员工离职。
             *
             * - 若用户归属部门A、部门B，应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据（如文档）的接收者，如果不设置则由其leader接收，如果该员工没有leader，则会将该员工的数据删除。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            findByDepartmentWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/find_by_department`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=find_by_department&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department document }
             *
             * 获取部门直属用户列表
             *
             * 基于部门ID获取部门直属用户列表。
             *
             * - 部门ID 必填，根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤，返回个人组织架构通讯录范围（[登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility)）内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0，则校验应用是否具有全员通讯录权限； 如果是非0的部门ID，则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码，有权限则返回对应部门下的直接用户列表。
             */
            findByDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/find_by_department`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get document }
             *
             * 获取单个用户信息
             *
             * 该接口用于获取通讯录中单个用户的信息。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch document }
             *
             * 修改用户部分信息
             *
             * 该接口用于更新通讯录中用户的字段，未传递的参数不会更新。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=resurrect&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect document }
             *
             * 恢复已删除用户
             *
             * 该接口用于恢复已删除用户（已离职的成员），仅自建应用可申请，应用商店应用无权调用接口。
             *
             * - 仅支持恢复离职 30 天内的成员。恢复后，部分用户数据仍不可恢复，请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复，请先离职对应的成员，否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复，请先修改对应成员的信息，否则接口会报错。
             */
            resurrect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update document }
             *
             * 更新用户所有信息
             *
             * 该接口用于更新通讯录中用户的字段。
             *
             * 应用需要拥有待更新用户的通讯录授权，如果涉及到用户部门变更，还需要同时拥有变更前、后所有新部门的通讯录授权。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=update_user_id&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 document }
             */
            updateUserId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * work_city
           */
          workCity: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=work_city&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=contact&resource=work_city&apiName=list&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v3: {
            /**
             * 自定义用户字段
             */
            customAttr: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/custom_attrs`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=custom_attr&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/list document }
               *
               * 获取企业自定义用户字段
               *
               * 获取企业自定义的用户字段配置信息
               *
               * 调用该接口前，需要先确认[企业管理员](https://www.feishu.cn/hc/zh-CN/articles/360049067822)在[企业管理后台 - 组织架构 - 成员字段管理](http://www.feishu.cn/admin/contacts/employee-field-new/custom) 自定义字段管理栏开启了“允许开放平台API调用“。;;![通讯录.gif](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/544738c94f13ef0b9ebaff53a5133cc7_E9EGMkXyzX.gif)
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/custom_attrs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 部门
             */
            department: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=batch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 document }
               */
              batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/batch`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              childrenWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=children&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children document }
               *
               * 获取子部门列表
               *
               * 通过部门ID获取部门的子部门列表。
               *
               * - 部门ID 必填，根部门的部门ID 为0。;- 使用 `user_access_token` 时，返回该用户组织架构可见性范围（[登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility)）内的所有可见部门。当进行递归查询时，最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0，会检验应用是否有全员通讯录权限，如果是非0 部门ID，则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码，有权限则返回部门下子部门列表（根据fetch_child决定是否递归）。
               */
              children: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create document }
               *
               * 创建部门
               *
               * 该接口用于向通讯录中创建部门。
               *
               * 只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门，则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete document }
               *
               * 删除部门
               *
               * 该接口用于从通讯录中删除部门。
               *
               * 应用需要同时拥有待删除部门及其父部门的通讯录授权。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get document }
               *
               * 获取单个部门信息
               *
               * 该接口用于向通讯录获取单个部门信息。
               *
               * - 使用`tenant_access_token`时，应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息，则需要拥有全员权限。;- 使用`user_access_token`时，用户需要有待查询部门的可见性，如果需要获取根部门信息，则要求员工可见所有人。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              parentWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/parent`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=parent&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent document }
               *
               * 获取父部门信息
               *
               * 该接口用来递归获取部门父部门的信息，并按照由子到父的顺序返回有权限的父部门信息列表。
               *
               * 使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如：A >>B>>C>>D四级部门，通讯录权限只到B，那么查询D部门的parent，会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。
               */
              parent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/parent`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch document }
               *
               * 修改部门部分信息
               *
               * 该接口用于更新通讯录中部门的信息。
               *
               * 调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=search&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search document }
               *
               * 搜索部门
               *
               * 搜索部门，用户通过关键词查询可见的部门数据，部门可见性需要管理员在后台配置。
               *
               * 部门存在，但用户搜索不到并不一定是搜索有问题，可能是管理员在后台配置了权限控制，导致用户无法搜索到该部门。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=unbind_department_chat&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat document }
               *
               * 部门群转为普通群
               *
               * 通过该接口将部门群转为普通群。
               */
              unbindDepartmentChat: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update document }
               *
               * 更新部门所有信息
               *
               * 该接口用于更新当前部门所有信息。
               *
               * - 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值（order字段除外）。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=department&apiName=update_department_id&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 document }
               */
              updateDepartmentId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 人员类型
             */
            employeeTypeEnum: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/create document }
               *
               * 新增人员类型
               *
               * 新增自定义人员类型
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/delete document }
               *
               * 删除人员类型
               *
               * 删除自定义人员类型
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list document }
               *
               * 查询人员类型
               *
               * 该接口用于获取员工的人员类型
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=employee_type_enum&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/update document }
               *
               * 更新人员类型
               *
               * 更新自定义人员类型
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * functional_role
             */
            functionalRole: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=functional_role&version=v3 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=functional_role&version=v3 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=functional_role&version=v3 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * functional_role.member
             */
            functionalRoleMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=batch_create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=contact&resource=functional_role.member&version=v3 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=batch_delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=contact&resource=functional_role.member&version=v3 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=functional_role.member&version=v3 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=functional_role.member&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=functional_role.member&apiName=scopes&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=scopes&project=contact&resource=functional_role.member&version=v3 document }
               */
              scopes: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户组
             */
            group: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/create document }
               *
               * 创建用户组
               *
               * 使用该接口创建用户组，请注意创建用户组时应用的通讯录权限范围需为“全部员工”，否则会创建失败，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/delete document }
               *
               * 删除用户组
               *
               * 通过该接口可删除企业中的用户组，请注意删除用户组时应用的通讯录权限范围需为“全部员工”，否则会删除失败，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/get document }
               *
               * 查询用户组
               *
               * 根据用户组 ID 查询某个用户组的基本信息，支持查询普通用户组和动态用户组。请确保应用的通讯录权限范围里包括该用户组或者是“全部员工”，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=member_belong&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/member_belong document }
               *
               * 查询用户所属用户组
               *
               * 通过该接口可查询该用户所属的用户组列表，可分别查询普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”，则可获取该员工所属的全部用户组列表。如果应用的通讯录权限范围不是“全部员工”，则仅可获取通讯录权限范围内该员工所属的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              memberBelong: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/member_belong`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/patch document }
               *
               * 更新用户组
               *
               * 使用该接口更新用户组信息，请注意更新用户组时应用的通讯录权限范围需为“全部员工”，否则会更新失败。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              simplelistWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/simplelist`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group&apiName=simplelist&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group/simplelist document }
               *
               * 查询用户组列表
               *
               * 通过该接口可查询企业的用户组列表，可分别查询普通用户组或动态用户组。如果应用的通讯录权限范围是“全部员工”，则可获取企业全部用户组列表。如果应用的通讯录权限范围不是“全部员工”，则仅可获取通讯录权限范围内的用户组。[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              simplelist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/simplelist`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户组成员
             */
            groupMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=add&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/add document }
               *
               * 添加用户组成员
               *
               * 向用户组中添加成员(目前成员仅支持用户，未来会支持部门)，如果应用的通讯录权限范围是“全部员工”，则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              add: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=batch_add&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_add document }
               *
               * 批量添加用户组成员
               *
               * 向普通用户组中批量添加成员(目前仅支持添加用户，暂不支持添加部门），如果应用的通讯录权限范围是“全部员工”，则可将任何成员添加到任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员添加到通讯录权限范围的用户组中，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               *
               * 请求体中的member_type，目前仅支持user， 未来将支持department。
               */
              batchAdd: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=batch_remove&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/batch_remove document }
               *
               * 批量移除用户组成员
               *
               * 从普通用户组中批量移除成员 (目前仅支持移除用户，暂不支持移除部门）。如果应用的通讯录权限范围是“全部员工”，则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除， [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               *
               * 请求体中的member_type，目前仅支持user， 未来将支持department。
               */
              batchRemove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=remove&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/remove document }
               *
               * 移除用户组成员
               *
               * 从用户组中移除成员 (目前成员仅支持用户，未来会支持部门)，如果应用的通讯录权限范围是“全部员工”，则可将任何成员移出任何用户组。如果应用的通讯录权限范围不是“全部员工”，则仅可将通讯录权限范围中的成员从通讯录权限范围的用户组中移除， [点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=group.member&apiName=simplelist&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/group-member/simplelist document }
               *
               * 查询用户组成员列表
               *
               * 通过该接口可查询某个用户组的成员列表（支持查询成员中的用户和部门）, 本接口支持普通用户组和动态用户组。如果应用的通讯录权限范围是“全部员工”，则可查询企业内任何用户组的成员列表。如果应用的通讯录权限范围不是“全部员工”，则仅可查询通讯录权限范围中的用户组的成员列表，[点击了解通讯录权限范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。
               */
              simplelist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_family
             */
            jobFamily: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_family&version=v3 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_family&version=v3 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_family&version=v3 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_family&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_family&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_family&version=v3 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_level
             */
            jobLevel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=job_level&version=v3 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=job_level&version=v3 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_level&version=v3 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_level&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_level&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=job_level&version=v3 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_title
             */
            jobTitle: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_title&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=job_title&version=v3 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=job_title&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=job_title&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/job_titles`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 通讯录权限范围
             */
            scope: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/scopes`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=scope&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list document }
               *
               * 获取通讯录授权范围
               *
               * 该接口用于获取应用被授权可访问的通讯录范围，包括可访问的部门列表、用户列表和用户组列表。;授权范围为全员时，返回的部门列表为该企业所有的一级部门；否则返回的部门为管理员在设置授权范围时勾选的部门（不包含勾选部门的子部门）。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/scopes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 单位
             */
            unit: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=bind_department&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/bind_department document }
               *
               * 建立部门与单位的绑定关系
               *
               * 通过该接口建立部门与单位的绑定关系。由于单位是旗舰版付费功能，企业需开通相关版本，否则会绑定失败，不同版本请参考[飞书版本对比](https://www.feishu.cn/service)
               */
              bindDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/bind_department`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/create document }
               *
               * 创建单位
               *
               * 该接口用于创建单位。注意：单位功能属于旗舰版付费功能，企业需开通对应版本才可以创建单位，不同版本请参考[飞书版本对比](https://www.feishu.cn/service)。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/delete document }
               *
               * 删除单位
               *
               * 使用该接口删除单位，需要有更新单位的权限。注意：如果单位的单位类型被其它的业务使用，不允许删除。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/get document }
               *
               * 获取单位信息
               *
               * 该接口用于获取单位信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list document }
               *
               * 批量获取单位列表
               *
               * 通过该接口获取企业的单位列表，需获取单位的权限
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=list_department&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/list_department document }
               *
               * 获取单位绑定的部门列表
               *
               * 通过该接口获取单位绑定的部门列表，需具有获取单位的权限
               */
              listDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/list_department`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/patch document }
               *
               * 修改单位信息
               *
               * 调用该接口，需要有更新单位的权限。注意：单位功能属于旗舰版付费功能，企业需开通对应版本才可以修改单位
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/:unit_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=unit&apiName=unbind_department&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/unit/unbind_department document }
               *
               * 解除部门与单位的绑定关系
               *
               * 通过该接口解除部门与单位的绑定关系，需更新单位的权限，需对应部门的通讯录权限。由于单位是旗舰版付费功能，企业需开通相关功能，否则会解绑失败
               */
              unbindDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/unit/unbind_department`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户
             */
            user: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=batch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 document }
               */
              batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/batch`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=batch_get_id&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch_get_id document }
               *
               * 通过手机号或邮箱获取用户 ID
               *
               * 通过该接口，可使用手机号/邮箱获取用户的 ID 信息，具体获取支持的 ID 类型包括 open_id、user_id、union_id，可通过查询参数指定。
               *
               * 如果查询的手机号、邮箱不存在，或者无权限查看对应的用户，则返回的用户ID列表为空。
               */
              batchGetId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/batch_get_id`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/create document }
               *
               * 创建用户
               *
               * 使用该接口向通讯录创建一个用户，可以理解为员工入职。创建用户后只返回有数据权限的数据。具体的数据权限的与字段的对应关系请参照[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)。
               *
               * - 新增用户的所有部门必须都在当前应用的通讯录授权范围内才允许新增用户，如果想要在根部门下新增用户，必须要有全员权限。;- 应用商店应用无权限调用此接口。;- 创建用户后，会给用户发送邀请短信/邮件，用户在操作同意后才可访问团队。;- 返回数据中不返回手机号，如果需要请重新查询用户信息获取手机号。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/delete document }
               *
               * 删除用户
               *
               * 该接口用于从通讯录删除一个用户信息，可以理解为员工离职。
               *
               * - 若用户归属部门A、部门B，应用的通讯录权限范围必须包括部门A和部门B才可以删除用户。;- 用户可以在删除员工时设置删除员工数据（如文档）的接收者，如果不设置则由其leader接收，如果该员工没有leader，则会将该员工的数据删除。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              findByDepartmentWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/find_by_department`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=find_by_department&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department document }
               *
               * 获取部门直属用户列表
               *
               * 基于部门ID获取部门直属用户列表。
               *
               * - 部门ID 必填，根部门的部门ID为0。;- 使用 `user_access_token` 情况下根据个人组织架构的通讯录可见范围进行权限过滤，返回个人组织架构通讯录范围（[登录企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility)）内可见的用户数据。;- 使用`tenant_access_token`会根据应用通讯录的范围进行权限过滤。 如果请求的部门ID为0，则校验应用是否具有全员通讯录权限； 如果是非0的部门ID，则会验证应用是否具有该部门的通讯录权限。 无权限返回无权限错误码，有权限则返回对应部门下的直接用户列表。
               */
              findByDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/find_by_department`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get document }
               *
               * 获取单个用户信息
               *
               * 该接口用于获取通讯录中单个用户的信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch document }
               *
               * 修改用户部分信息
               *
               * 该接口用于更新通讯录中用户的字段，未传递的参数不会更新。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=resurrect&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/resurrect document }
               *
               * 恢复已删除用户
               *
               * 该接口用于恢复已删除用户（已离职的成员），仅自建应用可申请，应用商店应用无权调用接口。
               *
               * - 仅支持恢复离职 30 天内的成员。恢复后，部分用户数据仍不可恢复，请谨慎调用。;- 待恢复成员的用户 ID 不能被企业内其他成员使用。如有重复，请先离职对应的成员，否则接口会报错。;- 待恢复成员的手机号和邮箱不能被企业内其他成员使用。如有重复，请先修改对应成员的信息，否则接口会报错。
               */
              resurrect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/update document }
               *
               * 更新用户所有信息
               *
               * 该接口用于更新通讯录中用户的字段。
               *
               * 应用需要拥有待更新用户的通讯录授权，如果涉及到用户部门变更，还需要同时拥有变更前、后所有新部门的通讯录授权。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=user&apiName=update_user_id&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_user_id&project=contact&resource=user&version=v3 document }
               */
              updateUserId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * work_city
             */
            workCity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=work_city&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=work_city&version=v3 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=contact&resource=work_city&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=work_city&version=v3 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/contact/v3/work_cities`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$O = class extends Client$P {
      constructor() {
        super(...arguments);
        this.content_check = {};
      }
    };
    var Client$N = class extends Client$O {
      constructor() {
        super(...arguments);
        this.contract = {};
      }
    };
    var Client$M = class extends Client$N {
      constructor() {
        super(...arguments);
        this.corehr = {
          /**
           * assigned_user
           */
          assignedUser: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=assigned_user&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search document }
             *
             * 获取组织类角色授权列表
             *
             * 查询组织类角色的授权信息
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/assigned_users/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * authorization
           */
          authorization: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=add_role_assign&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_role_assign&project=corehr&resource=authorization&version=v1 document }
             *
             * 追加更新组织类授权
             */
            addRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=get_by_param&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_param&project=corehr&resource=authorization&version=v1 document }
             *
             * 根据ID查询单个用户授权
             */
            getByParam: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=authorization&version=v1 document }
             *
             * 批量查询用户授权
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=remove_role_assign&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_role_assign&project=corehr&resource=authorization&version=v1 document }
             *
             * 删除组织类授权
             */
            removeRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=update_role_assign&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_role_assign&project=corehr&resource=authorization&version=v1 document }
             *
             * 覆盖更新组织类授权
             */
            updateRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * common_data.id
           */
          commonDataId: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.id&apiName=convert&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=convert&project=corehr&resource=common_data.id&version=v1 document }
             */
            convert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * common_data.meta_data
           */
          commonDataMetaData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.meta_data&apiName=add_enum_option&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_enum_option&project=corehr&resource=common_data.meta_data&version=v1 document }
             */
            addEnumOption: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.meta_data&apiName=edit_enum_option&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=edit_enum_option&project=corehr&resource=common_data.meta_data&version=v1 document }
             */
            editEnumOption: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 公司
           */
          company: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create document }
             *
             * 创建公司
             *
             * 创建公司
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete document }
             *
             * 删除公司
             *
             * 删除公司
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get document }
             *
             * 查询单个公司
             *
             * 根据 ID 查询单个公司
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list document }
             *
             * 批量查询公司
             *
             * 批量查询公司
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=company&version=v1 document }
             *
             * 更新公司数据
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * compensation_standard
           */
          compensationStandard: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=compensation_standard&apiName=match&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 document }
             *
             * 分页查询地点数据
             */
            match: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 合同
           */
          contract: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create document }
             *
             * 创建合同
             *
             * 创建合同
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete document }
             *
             * 删除合同
             *
             * 删除合同
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get document }
             *
             * 查询单个合同
             *
             * 根据 ID 查询单个合同
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list document }
             *
             * 批量查询合同
             *
             * 批量查询合同
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch document }
             *
             * 更新合同
             *
             * 更新合同
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 地理库信息
           */
          countryRegion: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=country_region&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get document }
             *
             * 查询单条国家/地区信息
             *
             * 查询单条国家/地区信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=country_region&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list document }
             *
             * 批量查询国家/地区信息
             *
             * 批量查询国家/地区信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/country_regions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 货币信息
           */
          currency: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=currency&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get document }
             *
             * 查询单个货币信息
             *
             * 查询单个货币信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=currency&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list document }
             *
             * 批量查询货币信息
             *
             * 批量查询货币信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/currencies`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 自定义字段
           */
          customField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=get_by_param&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param document }
             *
             * 获取自定义字段详情
             *
             * 获取「飞书人事」具体对象下某自定义字段的详细信息
             */
            getByParam: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=list_object_api_name&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name document }
             *
             * 获取飞书人事对象列表
             *
             * 获取「飞书人事」中的对象列表，含系统预置对象与自定义对象
             */
            listObjectApiName: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query document }
             *
             * 获取自定义字段列表
             *
             * 获取「飞书人事」具体对象下的自定义字段列表
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 部门
           */
          department: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create document }
             *
             * 创建部门
             *
             * 创建部门
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete document }
             *
             * 删除部门
             *
             * 删除部门
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get document }
             *
             * 查询单个部门
             *
             * 根据 ID 查询单个部门
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list document }
             *
             * 批量查询部门
             *
             * 批量查询部门
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch document }
             *
             * 更新部门
             *
             * 更新部门
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 人员类型
           */
          employeeType: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create document }
             *
             * 创建人员类型
             *
             * 创建人员类型
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete document }
             *
             * 删除人员类型
             *
             * 删除人员类型
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get document }
             *
             * 查询单个人员类型
             *
             * 根据 ID 查询单个人员类型
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list document }
             *
             * 批量查询人员类型
             *
             * 批量查询人员类型
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch document }
             *
             * 更新人员类型数据
             *
             * 更新人员类型数据
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 雇佣信息
           */
          employment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create document }
             *
             * 创建雇佣信息
             *
             * 创建人员的雇佣信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete document }
             *
             * 删除雇佣信息
             *
             * 删除人员的雇佣信息
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch document }
             *
             * 更新雇佣信息
             *
             * 更新雇佣信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * file
           */
          file: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=file&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/files/:id`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 职务
           */
          job: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create document }
             *
             * 创建职务
             *
             * 创建职务
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete document }
             *
             * 删除职务
             *
             * 删除职务
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get document }
             *
             * 查询单个职务
             *
             * 根据 ID 查询单个职务
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list document }
             *
             * 批量查询职务
             *
             * 批量查询职务
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch document }
             *
             * 更新职务
             *
             * 更新职务
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 异动信息
           */
          jobChange: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_change&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create document }
             *
             * 发起员工异动
             *
             * 创建员工异动信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_changes`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 任职信息
           */
          jobData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create document }
             *
             * 创建任职信息
             *
             * 在系统中第一次创建员工任职数据，通常在员工入职或者做数据批量导入的时候使用，【任职原因】只支持填写“入职”
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete document }
             *
             * 删除任职信息
             *
             * 删除人员的任职信息
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get document }
             *
             * 查询单个任职信息
             *
             * 根据 ID 查询单任职信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list document }
             *
             * 批量查询任职信息
             *
             * 批量查询人员的任职信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch document }
             *
             * 更新任职信息
             *
             * 更新任职信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 职务序列
           */
          jobFamily: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create document }
             *
             * 创建职务序列
             *
             * 创建职务序列
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete document }
             *
             * 删除职务序列
             *
             * 删除职务序列
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get document }
             *
             * 查询单个职务序列
             *
             * 根据 ID 查询单个职务序列
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list document }
             *
             * 批量查询职务序列
             *
             * 批量查询职务序列
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch document }
             *
             * 更新职务序列
             *
             * 更新职务序列
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 职务级别
           */
          jobLevel: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create document }
             *
             * 创建职务级别
             *
             * 创建职务级别
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete document }
             *
             * 删除职务级别
             *
             * 删除职务级别
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get document }
             *
             * 查询单个职务级别
             *
             * 根据 ID 查询单个职务级别
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list document }
             *
             * 批量查询职务级别
             *
             * 批量查询职务级别
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch document }
             *
             * 更新职务级别
             *
             * 更新职务级别
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 休假管理
           */
          leave: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=calendar_by_scope&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=calendar_by_scope&project=corehr&resource=leave&version=v1 document }
             */
            calendarByScope: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_balances&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances document }
             *
             * 批量查询员工假期余额
             *
             * 批量获取员工各个假期的余额数据
             */
            leaveBalances: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_request_history&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history document }
             *
             * 批量查询员工请假记录
             *
             * 批量获取员工的请假记录数据
             */
            leaveRequestHistory: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_types&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types document }
             *
             * 获取假期类型列表
             *
             * 获取休假设置后台配置的假期类型列表（比如年假、事假、婚假等）
             */
            leaveTypes: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=work_calendar&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=work_calendar&project=corehr&resource=leave&version=v1 document }
             */
            workCalendar: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=work_calendar_date&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=work_calendar_date&project=corehr&resource=leave&version=v1 document }
             */
            workCalendarDate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * leave_granting_record
           */
          leaveGrantingRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave_granting_record&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create document }
             *
             * 创建假期授予记录
             *
             * 向飞书人事休假系统写入假期授予记录
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leave_granting_records`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave_granting_record&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete document }
             *
             * 删除假期授予记录
             *
             * 删除飞书人事休假系统中的假期授予记录（仅支持删除授予来源是「手动授予」或「外部系统授予」的记录）
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 地点
           */
          location: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create document }
             *
             * 创建地点
             *
             * 创建地点
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete document }
             *
             * 删除地点
             *
             * 删除地点
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations/:location_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get document }
             *
             * 查询单个地点
             *
             * 根据 ID 查询单个地点
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations/:location_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list document }
             *
             * 批量查询地点
             *
             * 批量查询地点
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 国家证件类型
           */
          nationalIdType: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create document }
             *
             * 创建国家证件类型
             *
             * 创建国家证件类型
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete document }
             *
             * 删除国家证件类型
             *
             * 删除国家证件类型
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get document }
             *
             * 查询单个国家证件类型
             *
             * 根据 ID 查询单个国家证件类型
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list document }
             *
             * 批量查询国家证件类型
             *
             * 批量查询国家证件类型
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch document }
             *
             * 更新国家证件类型
             *
             * 更新国家证件类型
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 员工离职
           */
          offboarding: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query document }
             *
             * 查询员工离职原因列表
             *
             * 查询「飞书人事」-「离职设置」中的离职原因
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 document }
             *
             * 根据 雇佣 ID 查询员工离职信息
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=submit&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit document }
             *
             * 操作员工离职
             *
             * 操作员工直接离职
             */
            submit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/submit`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 个人信息
           */
          person: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/create document }
             *
             * 创建个人信息
             *
             * 创建人员的个人信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete document }
             *
             * 删除个人信息
             *
             * 删除人员的个人信息
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get document }
             *
             * 查询单个个人信息
             *
             * 根据 ID 查询单个人员的个人信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/patch document }
             *
             * 更新个人信息
             *
             * 更新个人信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=upload&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload document }
             *
             * 上传文件
             *
             * 上传文件
             */
            upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/upload`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          /**
           * 待入职
           */
          preHire: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete document }
             *
             * 删除待入职人员
             *
             * 删除待入职人员
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get document }
             *
             * 查询单个待入职人员
             *
             * 根据 ID 查询单个待入职人员
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list document }
             *
             * 批量查询待入职人员
             *
             * 批量查询待入职人员
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch document }
             *
             * 更新待入职数据
             *
             * 更新待入职数据
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 流程管理
           */
          processFormVariableData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.form_variable_data&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get document }
             *
             * 获取流程表单数据
             *
             * 获取流程表单数据
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * security_group
           */
          securityGroup: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=security_group&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list document }
             *
             * 批量获取角色列表
             *
             * 批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/security_groups`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=security_group&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query document }
             *
             * HRBP/属地 BP 查询
             *
             * 通过部门或工作地点，查询对应的 HRBP/属地 BP
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/security_groups/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 地理库信息
           */
          subdivision: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subdivision&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get document }
             *
             * 查询单条省份/行政区信息
             *
             * 查询单条省份/行政区信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subdivision&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list document }
             *
             * 批量查询省份/行政区信息
             *
             * 批量查询省份/行政区信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subdivisions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 地理库信息
           */
          subregion: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subregion&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get document }
             *
             * 查询单条城市/区域信息
             *
             * 查询单条城市/区域信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subregion&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list document }
             *
             * 批量查询城市/区域信息
             *
             * 批量查询城市/区域信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subregions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 异动原因
           */
          transferReason: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=transfer_reason&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query document }
             *
             * 获取异动原因列表
             *
             * 获取异动原因列表
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 异动类型
           */
          transferType: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=transfer_type&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query document }
             *
             * 获取异动类型列表
             *
             * 获取异动类型列表
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/transfer_types/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 工时制度
           */
          workingHoursType: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create document }
             *
             * 创建工时制度
             *
             * 创建工时制度
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete document }
             *
             * 删除工时制度
             *
             * 删除工时制度
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get document }
             *
             * 查询单个工时制度
             *
             * 根据 ID 查询单个工时制度
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list document }
             *
             * 批量查询工时制度
             *
             * 批量查询工时制度
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch document }
             *
             * 更新工时制度
             *
             * 更新工时制度
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * assigned_user
             */
            assignedUser: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=assigned_user&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/assigned_user/search document }
               *
               * 获取组织类角色授权列表
               *
               * 查询组织类角色的授权信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/assigned_users/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * authorization
             */
            authorization: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=add_role_assign&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_role_assign&project=corehr&resource=authorization&version=v1 document }
               *
               * 追加更新组织类授权
               */
              addRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=get_by_param&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_param&project=corehr&resource=authorization&version=v1 document }
               *
               * 根据ID查询单个用户授权
               */
              getByParam: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=authorization&version=v1 document }
               *
               * 批量查询用户授权
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=remove_role_assign&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_role_assign&project=corehr&resource=authorization&version=v1 document }
               *
               * 删除组织类授权
               */
              removeRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=authorization&apiName=update_role_assign&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_role_assign&project=corehr&resource=authorization&version=v1 document }
               *
               * 覆盖更新组织类授权
               */
              updateRoleAssign: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * common_data.id
             */
            commonDataId: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.id&apiName=convert&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=convert&project=corehr&resource=common_data.id&version=v1 document }
               */
              convert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * common_data.meta_data
             */
            commonDataMetaData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.meta_data&apiName=add_enum_option&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_enum_option&project=corehr&resource=common_data.meta_data&version=v1 document }
               */
              addEnumOption: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=common_data.meta_data&apiName=edit_enum_option&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=edit_enum_option&project=corehr&resource=common_data.meta_data&version=v1 document }
               */
              editEnumOption: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 公司
             */
            company: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/create document }
               *
               * 创建公司
               *
               * 创建公司
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/delete document }
               *
               * 删除公司
               *
               * 删除公司
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/get document }
               *
               * 查询单个公司
               *
               * 根据 ID 查询单个公司
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list document }
               *
               * 批量查询公司
               *
               * 批量查询公司
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=company&version=v1 document }
               *
               * 更新公司数据
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/companies/:company_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * compensation_standard
             */
            compensationStandard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=compensation_standard&apiName=match&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=corehr&resource=compensation_standard&version=v1 document }
               *
               * 分页查询地点数据
               */
              match: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 合同
             */
            contract: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/create document }
               *
               * 创建合同
               *
               * 创建合同
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/delete document }
               *
               * 删除合同
               *
               * 删除合同
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/get document }
               *
               * 查询单个合同
               *
               * 根据 ID 查询单个合同
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/list document }
               *
               * 批量查询合同
               *
               * 批量查询合同
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/contract/patch document }
               *
               * 更新合同
               *
               * 更新合同
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 地理库信息
             */
            countryRegion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=country_region&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/get document }
               *
               * 查询单条国家/地区信息
               *
               * 查询单条国家/地区信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=country_region&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/country_region/list document }
               *
               * 批量查询国家/地区信息
               *
               * 批量查询国家/地区信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/country_regions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 货币信息
             */
            currency: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=currency&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get document }
               *
               * 查询单个货币信息
               *
               * 查询单个货币信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=currency&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/list document }
               *
               * 批量查询货币信息
               *
               * 批量查询货币信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/currencies`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 自定义字段
             */
            customField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=get_by_param&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/get_by_param document }
               *
               * 获取自定义字段详情
               *
               * 获取「飞书人事」具体对象下某自定义字段的详细信息
               */
              getByParam: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=list_object_api_name&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/list_object_api_name document }
               *
               * 获取飞书人事对象列表
               *
               * 获取「飞书人事」中的对象列表，含系统预置对象与自定义对象
               */
              listObjectApiName: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_field&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/custom_field/query document }
               *
               * 获取自定义字段列表
               *
               * 获取「飞书人事」具体对象下的自定义字段列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/custom_fields/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 部门
             */
            department: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/create document }
               *
               * 创建部门
               *
               * 创建部门
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/delete document }
               *
               * 删除部门
               *
               * 删除部门
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/get document }
               *
               * 查询单个部门
               *
               * 根据 ID 查询单个部门
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list document }
               *
               * 批量查询部门
               *
               * 批量查询部门
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/patch document }
               *
               * 更新部门
               *
               * 更新部门
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/departments/:department_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 人员类型
             */
            employeeType: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/create document }
               *
               * 创建人员类型
               *
               * 创建人员类型
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/delete document }
               *
               * 删除人员类型
               *
               * 删除人员类型
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/get document }
               *
               * 查询单个人员类型
               *
               * 根据 ID 查询单个人员类型
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list document }
               *
               * 批量查询人员类型
               *
               * 批量查询人员类型
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee_type&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/patch document }
               *
               * 更新人员类型数据
               *
               * 更新人员类型数据
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 雇佣信息
             */
            employment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/create document }
               *
               * 创建雇佣信息
               *
               * 创建人员的雇佣信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/delete document }
               *
               * 删除雇佣信息
               *
               * 删除人员的雇佣信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employment&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/patch document }
               *
               * 更新雇佣信息
               *
               * 更新雇佣信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * file
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=file&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=file&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/files/:id`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 职务
             */
            job: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/create document }
               *
               * 创建职务
               *
               * 创建职务
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/delete document }
               *
               * 删除职务
               *
               * 删除职务
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/get document }
               *
               * 查询单个职务
               *
               * 根据 ID 查询单个职务
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/list document }
               *
               * 批量查询职务
               *
               * 批量查询职务
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job/patch document }
               *
               * 更新职务
               *
               * 更新职务
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 异动信息
             */
            jobChange: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_change&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/create document }
               *
               * 发起员工异动
               *
               * 创建员工异动信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_changes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 任职信息
             */
            jobData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/create document }
               *
               * 创建任职信息
               *
               * 在系统中第一次创建员工任职数据，通常在员工入职或者做数据批量导入的时候使用，【任职原因】只支持填写“入职”
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/delete document }
               *
               * 删除任职信息
               *
               * 删除人员的任职信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/get document }
               *
               * 查询单个任职信息
               *
               * 根据 ID 查询单任职信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/list document }
               *
               * 批量查询任职信息
               *
               * 批量查询人员的任职信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_data&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_data/patch document }
               *
               * 更新任职信息
               *
               * 更新任职信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 职务序列
             */
            jobFamily: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/create document }
               *
               * 创建职务序列
               *
               * 创建职务序列
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/delete document }
               *
               * 删除职务序列
               *
               * 删除职务序列
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/get document }
               *
               * 查询单个职务序列
               *
               * 根据 ID 查询单个职务序列
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list document }
               *
               * 批量查询职务序列
               *
               * 批量查询职务序列
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/patch document }
               *
               * 更新职务序列
               *
               * 更新职务序列
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 职务级别
             */
            jobLevel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/create document }
               *
               * 创建职务级别
               *
               * 创建职务级别
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/delete document }
               *
               * 删除职务级别
               *
               * 删除职务级别
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/get document }
               *
               * 查询单个职务级别
               *
               * 根据 ID 查询单个职务级别
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list document }
               *
               * 批量查询职务级别
               *
               * 批量查询职务级别
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/patch document }
               *
               * 更新职务级别
               *
               * 更新职务级别
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 休假管理
             */
            leave: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=calendar_by_scope&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=calendar_by_scope&project=corehr&resource=leave&version=v1 document }
               */
              calendarByScope: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_balances&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_balances document }
               *
               * 批量查询员工假期余额
               *
               * 批量获取员工各个假期的余额数据
               */
              leaveBalances: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_request_history&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_request_history document }
               *
               * 批量查询员工请假记录
               *
               * 批量获取员工的请假记录数据
               */
              leaveRequestHistory: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=leave_types&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/leave_types document }
               *
               * 获取假期类型列表
               *
               * 获取休假设置后台配置的假期类型列表（比如年假、事假、婚假等）
               */
              leaveTypes: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=work_calendar&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=work_calendar&project=corehr&resource=leave&version=v1 document }
               */
              workCalendar: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave&apiName=work_calendar_date&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=work_calendar_date&project=corehr&resource=leave&version=v1 document }
               */
              workCalendarDate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * leave_granting_record
             */
            leaveGrantingRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave_granting_record&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/create document }
               *
               * 创建假期授予记录
               *
               * 向飞书人事休假系统写入假期授予记录
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leave_granting_records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=leave_granting_record&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave_granting_record/delete document }
               *
               * 删除假期授予记录
               *
               * 删除飞书人事休假系统中的假期授予记录（仅支持删除授予来源是「手动授予」或「外部系统授予」的记录）
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 地点
             */
            location: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/create document }
               *
               * 创建地点
               *
               * 创建地点
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/delete document }
               *
               * 删除地点
               *
               * 删除地点
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations/:location_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/get document }
               *
               * 查询单个地点
               *
               * 根据 ID 查询单个地点
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations/:location_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list document }
               *
               * 批量查询地点
               *
               * 批量查询地点
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/locations`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 国家证件类型
             */
            nationalIdType: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/create document }
               *
               * 创建国家证件类型
               *
               * 创建国家证件类型
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/delete document }
               *
               * 删除国家证件类型
               *
               * 删除国家证件类型
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/get document }
               *
               * 查询单个国家证件类型
               *
               * 根据 ID 查询单个国家证件类型
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list document }
               *
               * 批量查询国家证件类型
               *
               * 批量查询国家证件类型
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=national_id_type&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/patch document }
               *
               * 更新国家证件类型
               *
               * 更新国家证件类型
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 员工离职
             */
            offboarding: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/query document }
               *
               * 查询员工离职原因列表
               *
               * 查询「飞书人事」-「离职设置」中的离职原因
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=offboarding&version=v1 document }
               *
               * 根据 雇佣 ID 查询员工离职信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=submit&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/submit document }
               *
               * 操作员工离职
               *
               * 操作员工直接离职
               */
              submit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/offboardings/submit`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 个人信息
             */
            person: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/create document }
               *
               * 创建个人信息
               *
               * 创建人员的个人信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/delete document }
               *
               * 删除个人信息
               *
               * 删除人员的个人信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/get document }
               *
               * 查询单个个人信息
               *
               * 根据 ID 查询单个人员的个人信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/patch document }
               *
               * 更新个人信息
               *
               * 更新个人信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/:person_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=upload&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/person/upload document }
               *
               * 上传文件
               *
               * 上传文件
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/persons/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * 待入职
             */
            preHire: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/delete document }
               *
               * 删除待入职人员
               *
               * 删除待入职人员
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/get document }
               *
               * 查询单个待入职人员
               *
               * 根据 ID 查询单个待入职人员
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/list document }
               *
               * 批量查询待入职人员
               *
               * 批量查询待入职人员
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/pre_hire/patch document }
               *
               * 更新待入职数据
               *
               * 更新待入职数据
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 流程管理
             */
            processFormVariableData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.form_variable_data&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/process-form_variable_data/get document }
               *
               * 获取流程表单数据
               *
               * 获取流程表单数据
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * security_group
             */
            securityGroup: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=security_group&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/list document }
               *
               * 批量获取角色列表
               *
               * 批量查询「飞书人事」-「权限设置」-「角色设置」中的角色列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/security_groups`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=security_group&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/security_group/query document }
               *
               * HRBP/属地 BP 查询
               *
               * 通过部门或工作地点，查询对应的 HRBP/属地 BP
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/security_groups/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 地理库信息
             */
            subdivision: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subdivision&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/get document }
               *
               * 查询单条省份/行政区信息
               *
               * 查询单条省份/行政区信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subdivision&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subdivision/list document }
               *
               * 批量查询省份/行政区信息
               *
               * 批量查询省份/行政区信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subdivisions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 地理库信息
             */
            subregion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subregion&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/get document }
               *
               * 查询单条城市/区域信息
               *
               * 查询单条城市/区域信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=subregion&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/subregion/list document }
               *
               * 批量查询城市/区域信息
               *
               * 批量查询城市/区域信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/subregions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 异动原因
             */
            transferReason: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=transfer_reason&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_reason/query document }
               *
               * 获取异动原因列表
               *
               * 获取异动原因列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 异动类型
             */
            transferType: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=transfer_type&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/transfer_type/query document }
               *
               * 获取异动类型列表
               *
               * 获取异动类型列表
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/transfer_types/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 工时制度
             */
            workingHoursType: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/create document }
               *
               * 创建工时制度
               *
               * 创建工时制度
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/delete document }
               *
               * 删除工时制度
               *
               * 删除工时制度
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/get document }
               *
               * 查询单个工时制度
               *
               * 根据 ID 查询单个工时制度
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/list document }
               *
               * 批量查询工时制度
               *
               * 批量查询工时制度
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=working_hours_type&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/working_hours_type/patch document }
               *
               * 更新工时制度
               *
               * 更新工时制度
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * approval_groups
             */
            approvalGroups: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=approval_groups&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=approval_groups&version=v2 document }
               *
               * 获取审批组信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=approval_groups&apiName=open_query_department_change_list_by_ids&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=open_query_department_change_list_by_ids&project=corehr&resource=approval_groups&version=v2 document }
               *
               * 获取部门调整信息详情
               */
              openQueryDepartmentChangeListByIds: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=approval_groups&apiName=open_query_job_change_list_by_ids&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=open_query_job_change_list_by_ids&project=corehr&resource=approval_groups&version=v2 document }
               */
              openQueryJobChangeListByIds: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=approval_groups&apiName=open_query_position_change_list_by_ids&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=open_query_position_change_list_by_ids&project=corehr&resource=approval_groups&version=v2 document }
               *
               * 获取岗位调整信息详情
               */
              openQueryPositionChangeListByIds: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * approver
             */
            approver: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approvers`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=approver&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=approver&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/approvers`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.bank
             */
            basicInfoBank: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.bank&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.bank&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.bank_branch
             */
            basicInfoBankBranch: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.bank_branch&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.bank_branch&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.city
             */
            basicInfoCity: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.city&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.city&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.country_region
             */
            basicInfoCountryRegion: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.country_region&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.country_region&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.country_region_subdivision
             */
            basicInfoCountryRegionSubdivision: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.country_region_subdivision&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.country_region_subdivision&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.currency
             */
            basicInfoCurrency: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.currency&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.currency&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.district
             */
            basicInfoDistrict: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.district&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.district&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.language
             */
            basicInfoLanguage: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.language&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.language&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.nationality
             */
            basicInfoNationality: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.nationality&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.nationality&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * basic_info.time_zone
             */
            basicInfoTimeZone: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=basic_info.time_zone&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=basic_info.time_zone&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * bp
             */
            bp: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=bp&apiName=get_by_department&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_department&project=corehr&resource=bp&version=v2 document }
               */
              getByDepartment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/bps`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=bp&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=bp&version=v2 document }
               *
               * 待补充
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/bps`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * company
             */
            company: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=active&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=company&version=v2 document }
               */
              active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/companies/active`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=company&version=v2 document }
               *
               * 通过公司 ID 批量获取公司信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/companies/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=company&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=company&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * contract
             */
            contract: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/contracts/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=contract&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=contract&version=v2 document }
               *
               * 根据合同 ID 、雇佣 ID 查询合同信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/contracts/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_allocation
             */
            costAllocation: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_allocation&apiName=batch_query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=corehr&resource=cost_allocation&version=v2 document }
               *
               * 通过员工ID批量获取通道信息
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_allocation&apiName=create_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_version&project=corehr&resource=cost_allocation&version=v2 document }
               *
               * 创建成本分摊
               */
              createVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_allocation&apiName=remove_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=cost_allocation&version=v2 document }
               *
               * 删除成本分摊
               */
              removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_allocation&apiName=update_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_version&project=corehr&resource=cost_allocation&version=v2 document }
               *
               * 更新成本分摊
               */
              updateVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_center
             */
            costCenter: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=cost_center&version=v2 document }
               *
               * 创建成本中心
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=cost_center&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=cost_center&version=v2 document }
               *
               * 创建成本中心版本
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=cost_center&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=cost_center&version=v2 document }
               *
               * 查询成本中心信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_center.version
             */
            costCenterVersion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center.version&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=cost_center.version&version=v2 document }
               *
               * 创建成本中心版本
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center.version&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=cost_center.version&version=v2 document }
               *
               * 撤销成本中心版本
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=cost_center.version&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=cost_center.version&version=v2 document }
               *
               * 创建成本中心版本
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * custom_org
             */
            customOrg: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=active&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=custom_org&version=v2 document }
               *
               * 启/停用自定义组织
               */
              active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=custom_org&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=delete_org&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete_org&project=corehr&resource=custom_org&version=v2 document }
               *
               * 删除自定义组织
               */
              deleteOrg: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=custom_org&version=v2 document }
               *
               * 更新自定义组织
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=custom_org&version=v2 document }
               *
               * 查询自定义组织信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=custom_org&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=update_rule&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_rule&project=corehr&resource=custom_org&version=v2 document }
               *
               * 更新匹配规则
               */
              updateRule: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * default_cost_center
             */
            defaultCostCenter: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=batch_query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=corehr&resource=default_cost_center&version=v2 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=create_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_version&project=corehr&resource=default_cost_center&version=v2 document }
               */
              createVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=remove_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=default_cost_center&version=v2 document }
               */
              removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=update_version&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_version&project=corehr&resource=default_cost_center&version=v2 document }
               */
              updateVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * department
             */
            department: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=department&version=v2 document }
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=department&version=v2 document }
               *
               * 删除部门数据
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=parents&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 document }
               */
              parents: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/parents`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=department&version=v2 document }
               *
               * 更新部门数据
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_multi_timeline&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=department&version=v2 document }
               *
               * 查询任意日期部门信息
               */
              queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryOperationLogsWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_operation_logs&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_operation_logs&project=corehr&resource=department&version=v2 document }
               *
               * 查询操作日志
               */
              queryOperationLogs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=department&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_timeline&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_timeline&project=corehr&resource=department&version=v2 document }
               *
               * 查询任意日期部门信息
               */
              queryTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=department&version=v2 document }
               *
               * 根据部门 ID，上级部门查询部门列表
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=tree&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tree&project=corehr&resource=department&version=v2 document }
               */
              tree: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/tree`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * draft
             */
            draft: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=draft&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=draft&version=v2 document }
               *
               * 根据组织架构调整 ID 查询调整流程信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employee
             */
            employee: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employee&version=v2 document }
               *
               * 通过员工 ID 批量获取员工信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=employee&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employee&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=employee&version=v2 document }
               *
               * 根据 email、工号、个人电话等条件查询员工雇佣信息以及个人基础信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employees.additional_job
             */
            employeesAdditionalJob: {
              batchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.additional_job&apiName=batch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=corehr&resource=employees.additional_job&version=v2 document }
               *
               * 批量查询兼职信息
               */
              batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.additional_job&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=employees.additional_job&version=v2 document }
               *
               * 创建兼职
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.additional_job&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=employees.additional_job&version=v2 document }
               *
               * 删除兼职
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.additional_job&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=employees.additional_job&version=v2 document }
               *
               * 更新兼职
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employees.bp
             */
            employeesBp: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.bp&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.bp&version=v2 document }
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employees.international_assignment
             */
            employeesInternationalAssignment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.international_assignment&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=employees.international_assignment&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.international_assignment&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=employees.international_assignment&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.international_assignment&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=employees.international_assignment&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.international_assignment&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=employees.international_assignment&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employees.job_data
             */
            employeesJobData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.job_data&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=employees.job_data&version=v2 document }
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=employees.job_data&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=employees.job_data&version=v2 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * enum
             */
            enum: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=enum&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=enum&version=v2 document }
               *
               * 通过apiname批量获取枚举信息
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/enums/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job
             */
            job: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job&version=v2 document }
               *
               * 批量获取职务信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=job&version=v2 document }
               *
               * 根据 ID 查询单个职务。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=job&version=v2 document }
               *
               * 分页查询职务数据
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=query_multi_timeline&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=job&version=v2 document }
               *
               * 查询生效时间在指定时间范围的职务
               */
              queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=job&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_change
             */
            jobChange: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_change&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=job_change&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_changes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_change&apiName=revoke&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=revoke&project=corehr&resource=job_change&version=v2 document }
               */
              revoke: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_changes/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_change&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=job_change&version=v2 document }
               *
               * 获取员工异动列表
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_changes/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_family
             */
            jobFamily: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_family&version=v2 document }
               *
               * 批量获取序列信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=query_multi_timeline&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=job_family&version=v2 document }
               *
               * 查询生效时间在指定时间范围的序列
               */
              queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_family&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=job_family&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_grade
             */
            jobGrade: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_grade&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=job_grade&version=v2 document }
               *
               * 创建职等数据
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_grade&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=job_grade&version=v2 document }
               *
               * 删除职等信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_grade&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=job_grade&version=v2 document }
               *
               * 更新职等信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_grade&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=job_grade&version=v2 document }
               *
               * 查询职等信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_grade&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=job_grade&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_level
             */
            jobLevel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=job_level&version=v2 document }
               *
               * 批量获取职级信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=job_level&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=job_level&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * location
             */
            location: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=active&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=location&version=v2 document }
               *
               * 启停/停用地点
               */
              active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/active`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=location&version=v2 document }
               *
               * 通过地点 ID 批量获取地点信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=location&version=v2 document }
               *
               * 更新地点
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/:location_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=location&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * location.address
             */
            locationAddress: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location.address&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=location.address&version=v2 document }
               *
               * 添加地点地址
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location.address&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=location.address&version=v2 document }
               *
               * 删除地点地址
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=location.address&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=location.address&version=v2 document }
               *
               * 更新地点地址
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * offboarding
             */
            offboarding: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=edit&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=edit&project=corehr&resource=offboarding&version=v2 document }
               *
               * 编辑离职信息
               */
              edit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/offboardings/edit`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=revoke&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=revoke&project=corehr&resource=offboarding&version=v2 document }
               *
               * 撤销离职信息
               */
              revoke: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=offboarding&apiName=submit_v2&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=submit_v2&project=corehr&resource=offboarding&version=v2 document }
               */
              submitV2: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * pathway
             */
            pathway: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pathway&apiName=active&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=pathway&version=v2 document }
               *
               * 启/停用通道
               */
              active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pathways/active`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pathway&apiName=batch_get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=pathway&version=v2 document }
               *
               * 通过通道 ID 批量获取通道信息
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pathway&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=pathway&version=v2 document }
               *
               * 创建通道
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pathways`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pathway&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=pathway&version=v2 document }
               *
               * 删除通道
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pathway&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=pathway&version=v2 document }
               *
               * 更新通道信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * person
             */
            person: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=person&version=v2 document }
               *
               * 创建个人信息数据
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/persons`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=person&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=person&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/persons/:person_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * position
             */
            position: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=active&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=position&version=v2 document }
               *
               * 启/停用岗位
               */
              active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/active`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=position&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=del_position&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=del_position&project=corehr&resource=position&version=v2 document }
               *
               * 删除岗位
               */
              delPosition: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/del_position`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=position&version=v2 document }
               *
               * 更新岗位
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/:position_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=position&version=v2 document }
               *
               * 查询岗位信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=position&apiName=query_recent_change&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=position&version=v2 document }
               */
              queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 待入职
             */
            preHire: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=complete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=complete&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 完成入职
               */
              complete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/pre_hire/create document }
               *
               * 创建待入职人员
               *
               * 创建待入职人员
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 删除待入职
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 更新待入职
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 批量查询待入职数据
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=restore_flow_instance&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=restore_flow_instance&project=corehr&resource=pre_hire&version=v2 document }
               */
              restoreFlowInstance: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 根据部门 ID，上级部门查询部门列表
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=transform_onboarding_task&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transform_onboarding_task&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 入职常规任务的流转，支持手动开启任务，提交任务以及审批任务
               */
              transformOnboardingTask: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=transit_task&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transit_task&project=corehr&resource=pre_hire&version=v2 document }
               *
               * 任务流转
               */
              transitTask: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=pre_hire&apiName=withdraw_onboarding&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw_onboarding&project=corehr&resource=pre_hire&version=v2 document }
               */
              withdrawOnboarding: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * probation.assessment
             */
            probationAssessment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation.assessment&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=probation.assessment&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/assessments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation.assessment&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=probation.assessment&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation.assessment&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=probation.assessment&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * probation
             */
            probation: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation&apiName=enable_disable_assessment&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=enable_disable_assessment&project=corehr&resource=probation&version=v2 document }
               */
              enableDisableAssessment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=probation&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation&apiName=submit&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=submit&project=corehr&resource=probation&version=v2 document }
               */
              submit: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/submit`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=probation&apiName=withdraw&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=corehr&resource=probation&version=v2 document }
               */
              withdraw: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/probation/withdraw`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process.approver
             */
            processApprover: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.approver&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=corehr&resource=process.approver&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process.extra
             */
            processExtra: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.extra&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=corehr&resource=process.extra&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process
             */
            process: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process&apiName=flow_variable_data&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=flow_variable_data&project=corehr&resource=process&version=v2 document }
               */
              flowVariableData: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=process&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=process&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process.form_variable_data
             */
            processFormVariableData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.form_variable_data&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=corehr&resource=process.form_variable_data&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process.transfer
             */
            processTransfer: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process.transfer&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=corehr&resource=process.transfer&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process_revoke
             */
            processRevoke: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process_revoke&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=corehr&resource=process_revoke&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * process_withdraw
             */
            processWithdraw: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=process_withdraw&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=corehr&resource=process_withdraw&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * report_detail_row
             */
            reportDetailRow: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=report_detail_row&apiName=batchDelete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batchDelete&project=corehr&resource=report_detail_row&version=v2 document }
               *
               * 批量删除填报行
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=report_detail_row&apiName=batchSave&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batchSave&project=corehr&resource=report_detail_row&version=v2 document }
               *
               * 批量创建/更新填报行
               */
              batchSave: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * signature_file
             */
            signatureFile: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_file&apiName=download&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=corehr&resource=signature_file&version=v2 document }
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`, path2),
                  method: "POST",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_file&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=signature_file&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_file&apiName=list_by_biz_id&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_biz_id&project=corehr&resource=signature_file&version=v2 document }
               */
              listByBizId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_file&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=signature_file&version=v2 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_file&apiName=terminate&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=terminate&project=corehr&resource=signature_file&version=v2 document }
               */
              terminate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * signature_node
             */
            signatureNode: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_node&apiName=list_by_file_id&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_file_id&project=corehr&resource=signature_node&version=v2 document }
               */
              listByFileId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * signature_template
             */
            signatureTemplate: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_template&apiName=search&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=corehr&resource=signature_template&version=v2 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_templates/search`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * signature_template_info_with_thumbnail
             */
            signatureTemplateInfoWithThumbnail: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=signature_template_info_with_thumbnail&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=signature_template_info_with_thumbnail&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workforce_plan
             */
            workforcePlan: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plans`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=workforce_plan&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=corehr&resource=workforce_plan&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plans`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workforce_plan_detail
             */
            workforcePlanDetail: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=workforce_plan_detail&apiName=batch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=corehr&resource=workforce_plan_detail&version=v2 document }
               */
              batch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=workforce_plan_detail&apiName=batch_v2&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_v2&project=corehr&resource=workforce_plan_detail&version=v2 document }
               */
              batchV2: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workforce_plan_detail_row
             */
            workforcePlanDetailRow: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=workforce_plan_detail_row&apiName=batchDelete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batchDelete&project=corehr&resource=workforce_plan_detail_row&version=v2 document }
               *
               * 批量删除明细行
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=workforce_plan_detail_row&apiName=batchSave&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batchSave&project=corehr&resource=workforce_plan_detail_row&version=v2 document }
               *
               * 批量创建/更新明细行
               */
              batchSave: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$L = class extends Client$M {
      constructor() {
        super(...arguments);
        this.directory = {
          v1: {
            /**
             * collaboration_rule
             */
            collaborationRule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=collaboration_rule&version=v1 document }
               *
               * 创建关联组织规则
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=collaboration_rule&version=v1 document }
               *
               * 删除关联组织的规则
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_rule&version=v1 document }
               *
               * 获取关联组织规则列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=directory&resource=collaboration_rule&version=v1 document }
               *
               * 更新关联组织规则
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * collaboration_tenant
             */
            collaborationTenant: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_tenant&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_tenant&version=v1 document }
               *
               * 在创建规则时，需要知道对方租户的tenant key，为拿到有效的tenant key，这里提供一个专门给管理员获取关联组织租户的接口，该接口可以直接请求到所有关联组织列表。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * collboration_share_entity
             */
            collborationShareEntity: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collboration_share_entity&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collboration_share_entity&version=v1 document }
               *
               * 获取双方租户分享的实体ID,完成可见性规则的设置
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * department
             */
            department: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=department&version=v1 document }
               *
               * 创建部门信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=department&version=v1 document }
               *
               * 删除部门信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=filter&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=department&version=v1 document }
               *
               * 查询部门ID列表
               */
              filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/filter`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=idconvert&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=department&version=v1 document }
               */
              idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/idconvert`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=mget&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=department&version=v1 document }
               *
               * 查询部门
               */
              mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/mget`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=department&version=v1 document }
               *
               * 更新部门信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=department&version=v1 document }
               *
               * 搜索租户内部门
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * employee
             */
            employee: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=employee&version=v1 document }
               *
               * 创建员工信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=employee&version=v1 document }
               *
               * 离职员工信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=filter&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=employee&version=v1 document }
               *
               * 查询员工ID列表
               */
              filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/filter`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=idconvert&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=employee&version=v1 document }
               */
              idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/idconvert`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=mget&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=employee&version=v1 document }
               *
               * 批量获取员工数据
               */
              mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/mget`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=employee&version=v1 document }
               *
               * 更新员工信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=regular&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=regular&project=directory&resource=employee&version=v1 document }
               *
               * 待离职雇员恢复成在职状态
               */
              regular: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=resurrect&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resurrect&project=directory&resource=employee&version=v1 document }
               *
               * 恢复员工信息
               */
              resurrect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=employee&version=v1 document }
               *
               * 搜索租户内员工
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=to_be_resigned&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=to_be_resigned&project=directory&resource=employee&version=v1 document }
               *
               * 更新在职雇员到待离职状态
               */
              toBeResigned: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$K = class extends Client$L {
      constructor() {
        super(...arguments);
        this.docs_tool = {};
      }
    };
    var Client$J = class extends Client$K {
      constructor() {
        super(...arguments);
        this.docs = {
          v1: {
            /**
             * content
             */
            content: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docs&resource=content&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docs&resource=content&version=v1 document }
               *
               * 获取云文档正文内容
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docs/v1/content`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$I = class extends Client$J {
      constructor() {
        super(...arguments);
        this.document_ai = {
          v1: {
            /**
             * bank_card
             */
            bankCard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=bank_card&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=bank_card&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * business_card
             */
            businessCard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=business_card&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_card&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * business_license
             */
            businessLicense: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=business_license&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=business_license&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * chinese_passport
             */
            chinesePassport: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=chinese_passport&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=chinese_passport&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * contract
             */
            contract: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=contract&apiName=field_extraction&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=field_extraction&project=document_ai&resource=contract&version=v1 document }
               */
              fieldExtraction: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * driving_license
             */
            drivingLicense: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=driving_license&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=driving_license&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * food_manage_license
             */
            foodManageLicense: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=food_manage_license&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_manage_license&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * food_produce_license
             */
            foodProduceLicense: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=food_produce_license&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=food_produce_license&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * health_certificate
             */
            healthCertificate: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=health_certificate&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=health_certificate&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * hkm_mainland_travel_permit
             */
            hkmMainlandTravelPermit: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=hkm_mainland_travel_permit&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=hkm_mainland_travel_permit&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * id_card
             */
            idCard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=id_card&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=id_card&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * resume
             */
            resume: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=resume&apiName=parse&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parse&project=document_ai&resource=resume&version=v1 document }
               */
              parse: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/resume/parse`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * taxi_invoice
             */
            taxiInvoice: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=taxi_invoice&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=taxi_invoice&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * train_invoice
             */
            trainInvoice: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=train_invoice&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=train_invoice&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * tw_mainland_travel_permit
             */
            twMainlandTravelPermit: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=tw_mainland_travel_permit&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=tw_mainland_travel_permit&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * vat_invoice
             */
            vatInvoice: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=vat_invoice&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vat_invoice&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * vehicle_invoice
             */
            vehicleInvoice: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=vehicle_invoice&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_invoice&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * vehicle_license
             */
            vehicleLicense: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=document_ai&resource=vehicle_license&apiName=recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recognize&project=document_ai&resource=vehicle_license&version=v1 document }
               */
              recognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            }
          }
        };
      }
    };
    var Client$H = class extends Client$I {
      constructor() {
        super(...arguments);
        this.docx = {
          /**
           * chat.announcement.block
           */
          chatAnnouncementBlock: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=docx&resource=chat.announcement.block&version=v1 document }
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement.block&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=docx&resource=chat.announcement.block&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * chat.announcement.block.children
           */
          chatAnnouncementBlockChildren: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=docx&resource=chat.announcement.block.children&version=v1 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=docx&resource=chat.announcement.block.children&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement.block.children&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * chat.announcement
           */
          chatAnnouncement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 块
           */
          documentBlock: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update document }
             *
             * 批量更新块
             *
             * 批量更新块的富文本内容。
             *
             * 频率限制：单个应用调用频率上限为每秒 3 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe)，了解相关规则及约束。
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get document }
             *
             * 获取块
             *
             * 获取指定块的富文本内容。
             *
             * 频率限制：单个应用调用频率上限为每秒 5 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih)，了解相关规则及约束。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list document }
             *
             * 获取文档所有块
             *
             * 获取文档所有块的富文本内容并分页返回。
             *
             * 频率限制：单个应用调用频率上限为每秒 5 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc)，了解相关规则及约束。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch document }
             *
             * 更新块
             *
             * 更新指定的块。
             *
             * 频率限制：单个应用调用频率上限为每秒 3 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g)，了解相关规则及约束。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * document.block.children
           */
          documentBlockChildren: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete document }
             *
             * 删除块
             *
             * 指定需要操作的块，删除其指定范围的子块。如果操作成功，接口将返回应用删除操作后的文档版本号。
             *
             * 频率限制：单个应用调用频率上限为每秒 3 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b)，了解相关规则及约束。
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create document }
             *
             * 创建块
             *
             * 指定需要操作的块，为其创建一批子块，并插入到指定位置。如果操作成功，接口将返回新创建子块的富文本内容。
             *
             * 频率限制：单个应用调用频率上限为每秒 3 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb)，了解相关规则及约束。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get document }
             *
             * 获取所有子块
             *
             * 给定一个指定版本的文档，并指定需要操作的块，分页遍历其所有子块富文本内容 。如果不指定版本，则会默认查询最新版本。
             *
             * 频率限制：单个应用调用频率上限为每秒 5 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd)，了解相关规则及约束。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * document.block.descendant
           */
          documentBlockDescendant: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.descendant&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=docx&resource=document.block.descendant&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 文档
           */
          document: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=convert&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=convert&project=docx&resource=document&version=v1 document }
             */
            convert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create document }
             *
             * 创建文档
             *
             * 创建新版文档，文档标题和目录可选。
             *
             * 频率限制：单个应用调用频率上限为每秒 3 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f)，了解相关规则及约束。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get document }
             *
             * 获取文档基本信息
             *
             * 获取文档最新版本号、标题等
             *
             * 频率限制：单个应用调用频率上限为每秒 5 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde)，了解相关规则及约束。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=raw_content&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content document }
             *
             * 获取文档纯文本内容
             *
             * 获取文档的纯文本内容。
             *
             * 频率限制：单个应用调用频率上限为每秒 5 次。
             *
             * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg)，了解相关规则及约束。
             */
            rawContent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * chat.announcement.block
             */
            chatAnnouncementBlock: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=docx&resource=chat.announcement.block&version=v1 document }
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement.block&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=docx&resource=chat.announcement.block&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat.announcement.block.children
             */
            chatAnnouncementBlockChildren: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=docx&resource=chat.announcement.block.children&version=v1 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=docx&resource=chat.announcement.block.children&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement.block.children&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement.block.children&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat.announcement
             */
            chatAnnouncement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=chat.announcement&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docx&resource=chat.announcement&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 块
             */
            documentBlock: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/batch_update document }
               *
               * 批量更新块
               *
               * 批量更新块的富文本内容。
               *
               * 频率限制：单个应用调用频率上限为每秒 3 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnMiwAKCiE6oQEkPyhvmmQEe)，了解相关规则及约束。
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/get document }
               *
               * 获取块
               *
               * 获取指定块的富文本内容。
               *
               * 频率限制：单个应用调用频率上限为每秒 5 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcnWEMWYAg2YMkEq0SZXHzaih)，了解相关规则及约束。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/list document }
               *
               * 获取文档所有块
               *
               * 获取文档所有块的富文本内容并分页返回。
               *
               * 频率限制：单个应用调用频率上限为每秒 5 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnamKaccZKqIMopnREJCZUMe#doxcn6AkCE2AUUm2WwxID7lS7Xc)，了解相关规则及约束。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block/patch document }
               *
               * 更新块
               *
               * 更新指定的块。
               *
               * 频率限制：单个应用调用频率上限为每秒 3 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnEeyS0I8MMqoieIMpK7jm8g)，了解相关规则及约束。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * document.block.children
             */
            documentBlockChildren: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/batch_delete document }
               *
               * 删除块
               *
               * 指定需要操作的块，删除其指定范围的子块。如果操作成功，接口将返回应用删除操作后的文档版本号。
               *
               * 频率限制：单个应用调用频率上限为每秒 3 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcngCsscGk0WacO258mYDgM6b)，了解相关规则及约束。
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/create document }
               *
               * 创建块
               *
               * 指定需要操作的块，为其创建一批子块，并插入到指定位置。如果操作成功，接口将返回新创建子块的富文本内容。
               *
               * 频率限制：单个应用调用频率上限为每秒 3 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnm0ooUe0s20GwwVB3a05rtb)，了解相关规则及约束。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.children&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document-block-children/get document }
               *
               * 获取所有子块
               *
               * 给定一个指定版本的文档，并指定需要操作的块，分页遍历其所有子块富文本内容 。如果不指定版本，则会默认查询最新版本。
               *
               * 频率限制：单个应用调用频率上限为每秒 5 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnE2UK2yY0gEGK8nBMPtB0vd)，了解相关规则及约束。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * document.block.descendant
             */
            documentBlockDescendant: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document.block.descendant&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=docx&resource=document.block.descendant&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 文档
             */
            document: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=convert&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=convert&project=docx&resource=document&version=v1 document }
               */
              convert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create document }
               *
               * 创建文档
               *
               * 创建新版文档，文档标题和目录可选。
               *
               * 频率限制：单个应用调用频率上限为每秒 3 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnyoyCgwS8ywWwMtQr9yjZ2f)，了解相关规则及约束。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/get document }
               *
               * 获取文档基本信息
               *
               * 获取文档最新版本号、标题等
               *
               * 频率限制：单个应用调用频率上限为每秒 5 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnWKAE4aSaIU4GcdLInSaVde)，了解相关规则及约束。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=docx&resource=document&apiName=raw_content&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content document }
               *
               * 获取文档纯文本内容
               *
               * 获取文档的纯文本内容。
               *
               * 频率限制：单个应用调用频率上限为每秒 5 次。
               *
               * 在调用此接口前，请仔细阅读[新版文档 OpenAPI 接口校验规则](https://bytedance.feishu.cn/docx/doxcnby5Y0yoACL3PdfZqrJEm6f#doxcnQeqI4wiKIMis6GNvCOBuqg)，了解相关规则及约束。
               */
              rawContent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$G = class extends Client$H {
      constructor() {
        super(...arguments);
        this.drive = {
          /**
           * 导出
           */
          exportTask: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create document }
             *
             * 创建导出任务
             *
             * 创建导出任务，将云文件导出为指定格式的本地文件。该接口为异步接口，需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download document }
             *
             * 下载导出文件
             *
             * 根据任务导出结果的token，下载导出文件
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get document }
             *
             * 查询导出任务结果
             *
             * 根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果，前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 评论
           */
          fileComment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query document }
             *
             * 批量获取评论
             *
             * 该接口用于根据评论 ID 列表批量获取评论。
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create document }
             *
             * 添加评论
             *
             * 往云文档添加一条全局评论。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get document }
             *
             * 获取评论
             *
             * 获取云文档中的某条评论。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list document }
             *
             * 分页获取文档评论
             *
             * 该接口用于根据文档 token 分页获取文档评论。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch document }
             *
             * 解决/恢复 评论
             *
             * 解决或恢复云文档中的评论。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 评论
           */
          fileCommentReply: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete document }
             *
             * 删除回复
             *
             * 删除云文档中的某条回复。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list document }
             *
             * 获取回复
             *
             * 该接口用于根据评论 ID 以及分页参数，获取回复。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update document }
             *
             * 更新回复
             *
             * 更新云文档中的某条回复。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 事件
           */
          file: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=copy&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy document }
             *
             * 复制文件
             *
             * 将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间，则复制的文件会在「**我的空间**」的「**归我所有**」列表里。
             *
             * 该接口不支持并发拷贝多个文件，且调用频率上限为 5QPS 且 10000次/天
             */
            copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=create_folder&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder document }
             *
             * 新建文件夹
             *
             * 在用户云空间的指定文件夹中创建一个新的空文件夹。
             *
             * 该接口不支持并发创建，且调用频率上限为 5QPS 以及 10000次/天
             */
            createFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/create_folder`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=create_shortcut&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 document }
             */
            createShortcut: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/create_shortcut`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete document }
             *
             * 删除文件
             *
             * 删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后，会进入用户回收站里。
             *
             * 该接口不支持并发调用，且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id，可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。
             *
             * 要删除文件需要确保应用具有下述两种权限之一：;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者，但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限（full access）。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=delete_subscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe document }
             *
             * 取消云文档事件订阅情况
             *
             * 该接口**仅支持文档拥有者**取消订阅自己文档的通知事件，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
             */
            deleteSubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download document }
             *
             * 下载文件
             *
             * 使用该接口可以下载在云空间目录下的文件（不含飞书文档/表格/思维导图等在线文档）。支持range下载。
             *
             * 该接口支持调用频率上限为5QPS
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=get_subscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe document }
             *
             * 查询云文档事件订阅状态
             *
             * 该接口**仅支持文档拥有者**查询自己文档的订阅状态，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
             */
            getSubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list document }
             *
             * 获取文件夹下的清单
             *
             * 获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档（文档、电子表格、多维表格、思维笔记）、文件夹和快捷方式。该接口支持分页，但是不会递归的获取子文件夹的清单。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=move&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move document }
             *
             * 移动文件
             *
             * 将文件或者文件夹移动到用户云空间的其他位置。
             */
            move: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/move`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=subscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe document }
             *
             * 订阅云文档事件
             *
             * 该接口仅支持**文档拥有者**订阅自己文档的通知事件，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
             */
            subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=task_check&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check document }
             *
             * 查询异步任务状态
             *
             * 查询删除文件夹等异步任务的状态信息。
             */
            taskCheck: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/task_check`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_all&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all document }
             *
             * 上传文件
             *
             * 向云空间指定目录下上传一个小文件。
             *
             * 该接口支持调用频率上限为5QPS
             *
             * 请不要使用这个接口上传大于20MB的文件，如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。
             */
            uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_all`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_finish&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish document }
             *
             * 分片上传文件（完成上传）
             *
             * 触发完成上传。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            uploadFinish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_finish`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_part&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part document }
             *
             * 分片上传文件（上传分片）
             *
             * 上传对应的文件块。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            uploadPart: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_part`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_prepare&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare document }
             *
             * 分片上传文件（预上传）
             *
             * 发送初始化请求获取上传事务ID和分块策略，目前是以4MB大小进行定长分片。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             *
             * 你在24小时内可保存上传事务ID和上传进度，以便可以恢复上传
             */
            uploadPrepare: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_prepare`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * file.statistics
           */
          fileStatistics: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.statistics&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get document }
             *
             * 获取文件统计信息
             *
             * 此接口用于获取文件统计信息，包括文档阅读人数、次数和点赞数。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 订阅
           */
          fileSubscription: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create document }
             *
             * 创建订阅
             *
             * 订阅文档中的变更事件，当前支持文档评论订阅，订阅后文档评论更新会有“云文档助手”推送给订阅的用户
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get document }
             *
             * 获取订阅状态
             *
             * 根据订阅ID获取该订阅的状态
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch document }
             *
             * 更新订阅状态
             *
             * 根据订阅ID更新订阅状态
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 文档版本
           */
          fileVersion: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create document }
             *
             * 创建文档版本
             *
             * 创建文档版本。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete document }
             *
             * 删除文档版本
             *
             * 删除文档版本。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get document }
             *
             * 获取文档版本
             *
             * 获取文档版本。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list document }
             *
             * 获取文档版本列表
             *
             * 获取文档所有版本。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * file.view_record
           */
          fileViewRecord: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.view_record&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入
           */
          importTask: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create document }
             *
             * 创建导入任务
             *
             * 创建导入任务。支持导入为 doc、docx、sheet、bitable，参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide)
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get document }
             *
             * 查询导入结果
             *
             * 根据创建导入任务返回的 ticket 查询导入结果。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 素材
           */
          media: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=batch_get_tmp_download_url&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url document }
             *
             * 获取素材临时下载链接
             *
             * 通过file_token获取素材临时下载链接，链接时效性是24小时，过期失效。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            batchGetTmpDownloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download document }
             *
             * 下载素材
             *
             * 使用该接口可以下载素材。素材表示在各种创作容器里的文件，如Doc文档内的图片，文件均属于素材。支持range下载。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_all&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all document }
             *
             * 上传素材
             *
             * 将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示，只会显示在对应云文档中。
             *
             * 该接口支持调用频率上限为5QPS
             *
             * 请不要使用这个接口上传大于20MB的文件，如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。
             */
            uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_all`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_finish&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish document }
             *
             * 分片上传素材（完成上传）
             *
             * 触发完成上传。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            uploadFinish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_finish`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_part&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part document }
             *
             * 分片上传素材（上传分片）
             *
             * 上传对应的文件块。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             */
            uploadPart: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_part`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_prepare&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare document }
             *
             * 分片上传素材（预上传）
             *
             * 发送初始化请求获取上传事务ID和分块策略，目前是以4MB大小进行定长分片。
             *
             * 该接口不支持太高的并发，且调用频率上限为5QPS
             *
             * 您在24小时内可保存上传事务ID和上传进度，以便可以恢复上传
             */
            uploadPrepare: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * meta
           */
          meta: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=meta&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query document }
             *
             * 获取文档元数据
             *
             * 该接口用于根据 token 获取各类文件的元数据
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/metas/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 成员
           */
          permissionMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=auth&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 document }
             */
            auth: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=drive&resource=permission.member&version=v1 document }
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create document }
             *
             * 增加协作者权限
             *
             * 该接口用于根据 filetoken 给用户增加文档的权限。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete document }
             *
             * 移除协作者权限
             *
             * 该接口用于根据 filetoken 移除文档协作者的权限。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list document }
             *
             * 获取协作者列表
             *
             * 该接口用于根据 filetoken 查询协作者
             *
             * - 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=transfer_owner&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 document }
             */
            transferOwner: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update document }
             *
             * 更新协作者权限
             *
             * 该接口用于根据 filetoken 更新文档协作者的权限。
             *
             * 该接口要求文档协作者已存在，如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 设置
           */
          permissionPublic: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get document }
             *
             * 获取云文档权限设置
             *
             * 该接口用于根据 filetoken 获取云文档的权限设置。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch document }
             *
             * 更新云文档权限设置
             *
             * 该接口用于根据 filetoken 更新云文档的权限设置。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * permission.public.password
           */
          permissionPublicPassword: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 导出
             */
            exportTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create document }
               *
               * 创建导出任务
               *
               * 创建导出任务，将云文件导出为指定格式的本地文件。该接口为异步接口，需要通过轮询 [查询导出任务结果](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get) 接口获取任务结果。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download document }
               *
               * 下载导出文件
               *
               * 根据任务导出结果的token，下载导出文件
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/get document }
               *
               * 查询导出任务结果
               *
               * 根据[创建导出任务](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/create)的ticket查询导出任务的结果，前提条件需要先调用创建导出任务接口。;;通过该接口获取到下载文件的 token 后调用[下载导出文件接口](/ssl::ttdoc//uAjLw4CM/ukTMukTMukTM/reference/drive-v1/export_task/download)将文件进行下载
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 评论
             */
            fileComment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/batch_query document }
               *
               * 批量获取评论
               *
               * 该接口用于根据评论 ID 列表批量获取评论。
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/create document }
               *
               * 添加评论
               *
               * 往云文档添加一条全局评论。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/get document }
               *
               * 获取评论
               *
               * 获取云文档中的某条评论。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/list document }
               *
               * 分页获取文档评论
               *
               * 该接口用于根据文档 token 分页获取文档评论。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment/patch document }
               *
               * 解决/恢复 评论
               *
               * 解决或恢复云文档中的评论。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 评论
             */
            fileCommentReply: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/delete document }
               *
               * 删除回复
               *
               * 删除云文档中的某条回复。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list document }
               *
               * 获取回复
               *
               * 该接口用于根据评论 ID 以及分页参数，获取回复。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/update document }
               *
               * 更新回复
               *
               * 更新云文档中的某条回复。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 事件
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=copy&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/copy document }
               *
               * 复制文件
               *
               * 将文件复制到用户云空间的其他文件夹中。不支持复制文件夹。;;如果目标文件夹是我的空间，则复制的文件会在「**我的空间**」的「**归我所有**」列表里。
               *
               * 该接口不支持并发拷贝多个文件，且调用频率上限为 5QPS 且 10000次/天
               */
              copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=create_folder&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/create_folder document }
               *
               * 新建文件夹
               *
               * 在用户云空间的指定文件夹中创建一个新的空文件夹。
               *
               * 该接口不支持并发创建，且调用频率上限为 5QPS 以及 10000次/天
               */
              createFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/create_folder`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=create_shortcut&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_shortcut&project=drive&resource=file&version=v1 document }
               */
              createShortcut: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/create_shortcut`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete document }
               *
               * 删除文件
               *
               * 删除用户在云空间内的文件或者文件夹。文件或者文件夹被删除后，会进入用户回收站里。
               *
               * 该接口不支持并发调用，且调用频率上限为5QPS。删除文件夹会异步执行并返回一个task_id，可以使用[task_check](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check)接口查询任务执行状态。
               *
               * 要删除文件需要确保应用具有下述两种权限之一：;1. 该应用是文件所有者并且具有该文件所在父文件夹的编辑权限。;2. 该应用并非文件所有者，但是是该文件所在父文件夹的所有者或者拥有该父文件夹的所有权限（full access）。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=delete_subscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete_subscribe document }
               *
               * 取消云文档事件订阅情况
               *
               * 该接口**仅支持文档拥有者**取消订阅自己文档的通知事件，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
               */
              deleteSubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/download document }
               *
               * 下载文件
               *
               * 使用该接口可以下载在云空间目录下的文件（不含飞书文档/表格/思维导图等在线文档）。支持range下载。
               *
               * 该接口支持调用频率上限为5QPS
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=get_subscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/get_subscribe document }
               *
               * 查询云文档事件订阅状态
               *
               * 该接口**仅支持文档拥有者**查询自己文档的订阅状态，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
               */
              getSubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v1/files`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list document }
               *
               * 获取文件夹下的清单
               *
               * 获取用户云空间中指定文件夹下的文件清单。清单类型包括文件、各种在线文档（文档、电子表格、多维表格、思维笔记）、文件夹和快捷方式。该接口支持分页，但是不会递归的获取子文件夹的清单。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=move&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/move document }
               *
               * 移动文件
               *
               * 将文件或者文件夹移动到用户云空间的其他位置。
               */
              move: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/move`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=subscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/subscribe document }
               *
               * 订阅云文档事件
               *
               * 该接口仅支持**文档拥有者**订阅自己文档的通知事件，可订阅的文档类型为**旧版文档**、**新版文档**、**电子表格**和**多维表格**。在调用该接口之前请确保正确[配置事件回调网址和订阅事件类型](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM#2eb3504a)(暂不支持单独订阅文档维度的某类事件)，事件类型参考[事件列表](https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-list)。
               */
              subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=task_check&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/task_check document }
               *
               * 查询异步任务状态
               *
               * 查询删除文件夹等异步任务的状态信息。
               */
              taskCheck: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/task_check`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_all&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all document }
               *
               * 上传文件
               *
               * 向云空间指定目录下上传一个小文件。
               *
               * 该接口支持调用频率上限为5QPS
               *
               * 请不要使用这个接口上传大于20MB的文件，如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/multipart-upload-file-/introduction)。
               */
              uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_all`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_finish&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish document }
               *
               * 分片上传文件（完成上传）
               *
               * 触发完成上传。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              uploadFinish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_finish`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_part&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part document }
               *
               * 分片上传文件（上传分片）
               *
               * 上传对应的文件块。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              uploadPart: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_part`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_prepare&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare document }
               *
               * 分片上传文件（预上传）
               *
               * 发送初始化请求获取上传事务ID和分块策略，目前是以4MB大小进行定长分片。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               *
               * 你在24小时内可保存上传事务ID和上传进度，以便可以恢复上传
               */
              uploadPrepare: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/upload_prepare`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * file.statistics
             */
            fileStatistics: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.statistics&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-statistics/get document }
               *
               * 获取文件统计信息
               *
               * 此接口用于获取文件统计信息，包括文档阅读人数、次数和点赞数。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 订阅
             */
            fileSubscription: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/create document }
               *
               * 创建订阅
               *
               * 订阅文档中的变更事件，当前支持文档评论订阅，订阅后文档评论更新会有“云文档助手”推送给订阅的用户
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/get document }
               *
               * 获取订阅状态
               *
               * 根据订阅ID获取该订阅的状态
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.subscription&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-subscription/patch document }
               *
               * 更新订阅状态
               *
               * 根据订阅ID更新订阅状态
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 文档版本
             */
            fileVersion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create document }
               *
               * 创建文档版本
               *
               * 创建文档版本。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete document }
               *
               * 删除文档版本
               *
               * 删除文档版本。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get document }
               *
               * 获取文档版本
               *
               * 获取文档版本。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list document }
               *
               * 获取文档版本列表
               *
               * 获取文档所有版本。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * file.view_record
             */
            fileViewRecord: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.view_record&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.view_record&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入
             */
            importTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create document }
               *
               * 创建导入任务
               *
               * 创建导入任务。支持导入为 doc、docx、sheet、bitable，参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide)
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get document }
               *
               * 查询导入结果
               *
               * 根据创建导入任务返回的 ticket 查询导入结果。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 素材
             */
            media: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=batch_get_tmp_download_url&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url document }
               *
               * 获取素材临时下载链接
               *
               * 通过file_token获取素材临时下载链接，链接时效性是24小时，过期失效。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              batchGetTmpDownloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download document }
               *
               * 下载素材
               *
               * 使用该接口可以下载素材。素材表示在各种创作容器里的文件，如Doc文档内的图片，文件均属于素材。支持range下载。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_all&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all document }
               *
               * 上传素材
               *
               * 将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示，只会显示在对应云文档中。
               *
               * 该接口支持调用频率上限为5QPS
               *
               * 请不要使用这个接口上传大于20MB的文件，如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。
               */
              uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_all`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_finish&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_finish document }
               *
               * 分片上传素材（完成上传）
               *
               * 触发完成上传。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              uploadFinish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_finish`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_part&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_part document }
               *
               * 分片上传素材（上传分片）
               *
               * 上传对应的文件块。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               */
              uploadPart: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_part`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_prepare&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_prepare document }
               *
               * 分片上传素材（预上传）
               *
               * 发送初始化请求获取上传事务ID和分块策略，目前是以4MB大小进行定长分片。
               *
               * 该接口不支持太高的并发，且调用频率上限为5QPS
               *
               * 您在24小时内可保存上传事务ID和上传进度，以便可以恢复上传
               */
              uploadPrepare: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * meta
             */
            meta: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=meta&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/meta/batch_query document }
               *
               * 获取文档元数据
               *
               * 该接口用于根据 token 获取各类文件的元数据
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/metas/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 成员
             */
            permissionMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=auth&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 document }
               */
              auth: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=drive&resource=permission.member&version=v1 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create document }
               *
               * 增加协作者权限
               *
               * 该接口用于根据 filetoken 给用户增加文档的权限。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/delete document }
               *
               * 移除协作者权限
               *
               * 该接口用于根据 filetoken 移除文档协作者的权限。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/list document }
               *
               * 获取协作者列表
               *
               * 该接口用于根据 filetoken 查询协作者
               *
               * - 你能获取到协作者列表的前提是你对该文档有分享权限;- 目前仅支持人、群、组织架构三种类型的协作者
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=transfer_owner&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 document }
               */
              transferOwner: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/update document }
               *
               * 更新协作者权限
               *
               * 该接口用于根据 filetoken 更新文档协作者的权限。
               *
               * 该接口要求文档协作者已存在，如还未对文档协作者授权请先调用[「增加权限」 ](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-member/create)接口进行授权。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 设置
             */
            permissionPublic: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/get document }
               *
               * 获取云文档权限设置
               *
               * 该接口用于根据 filetoken 获取云文档的权限设置。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/permission-public/patch document }
               *
               * 更新云文档权限设置
               *
               * 该接口用于根据 filetoken 更新云文档的权限设置。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * permission.public.password
             */
            permissionPublicPassword: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=drive&resource=permission.public.password&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=drive&resource=permission.public.password&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public.password&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=drive&resource=permission.public.password&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * file.like
             */
            fileLike: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.like&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=drive&resource=file.like&version=v2 document }
               *
               * 获取指定文件的点赞者列表并分页返回。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * permission.public
             */
            permissionPublic: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=drive&resource=permission.public&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v2/permissions/:token/public`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.public&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=drive&resource=permission.public&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/drive/v2/permissions/:token/public`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$F = class extends Client$G {
      constructor() {
        super(...arguments);
        this.edu = {};
      }
    };
    var Client$E = class extends Client$F {
      constructor() {
        super(...arguments);
        this.ehr = {
          /**
           * 飞书人事（标准版)
           */
          attachment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=ehr&resource=attachment&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get document }
             *
             * 下载附件
             *
             * 根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中，「文件」类型的字段 id，即是文件 token
             *
             * ![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png)
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/ehr/v1/attachments/:token`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 飞书人事（标准版)
           */
          employee: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/ehr/v1/employees`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=ehr&resource=employee&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list document }
             *
             * 批量获取员工花名册信息
             *
             * 根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ，批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/ehr/v1/employees`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 飞书人事（标准版)
             */
            attachment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=ehr&resource=attachment&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/attachment/get document }
               *
               * 下载附件
               *
               * 根据文件 token 下载文件。;;调用 「批量获取员工花名册信息」接口的返回值中，「文件」类型的字段 id，即是文件 token
               *
               * ![image.png](//sf1-ttcdn-tos.pstatp.com/obj/open-platform-opendoc/bed391d2a8ce6ed2d5985ea69bf92850_9GY1mnuDXP.png)
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/ehr/v1/attachments/:token`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 飞书人事（标准版)
             */
            employee: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/ehr/v1/employees`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=ehr&resource=employee&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/ehr/ehr-v1/employee/list document }
               *
               * 批量获取员工花名册信息
               *
               * 根据员工飞书用户 ID / 员工状态 / 雇员类型等搜索条件 ，批量获取员工花名册字段信息。字段包括「系统标准字段 / system_fields」和「自定义字段 / custom_fields」
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/ehr/v1/employees`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$D = class extends Client$E {
      constructor() {
        super(...arguments);
        this.elearning = {};
      }
    };
    var Client$C = class extends Client$D {
      constructor() {
        super(...arguments);
        this.event = {
          /**
           * 事件订阅
           */
          outboundIp: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/event/v1/outbound_ip`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=event&resource=outbound_ip&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list document }
             *
             * 获取事件出口 IP
             *
             * 飞书开放平台向应用配置的回调地址推送事件时，是通过特定的 IP 发送出去的，应用可以通过本接口获取所有相关的 IP 地址。
             *
             * IP 地址有变更可能，建议应用每隔 6 小时定时拉取最新的 IP 地址，以免由于企业防火墙设置，导致应用无法及时接收到飞书开放平台推送的事件。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/event/v1/outbound_ip`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 事件订阅
             */
            outboundIp: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/event/v1/outbound_ip`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=event&resource=outbound_ip&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list document }
               *
               * 获取事件出口 IP
               *
               * 飞书开放平台向应用配置的回调地址推送事件时，是通过特定的 IP 发送出去的，应用可以通过本接口获取所有相关的 IP 地址。
               *
               * IP 地址有变更可能，建议应用每隔 6 小时定时拉取最新的 IP 地址，以免由于企业防火墙设置，导致应用无法及时接收到飞书开放平台推送的事件。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/event/v1/outbound_ip`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$B = class extends Client$C {
      constructor() {
        super(...arguments);
        this.exam = {};
      }
    };
    var Client$A = class extends Client$B {
      constructor() {
        super(...arguments);
        this.face_detection = {};
      }
    };
    var Client$z = class extends Client$A {
      constructor() {
        super(...arguments);
        this.feelgood = {};
      }
    };
    var Client$y = class extends Client$z {
      constructor() {
        super(...arguments);
        this.helpdesk = {
          /**
           * 客服
           */
          agent: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent&apiName=agent_email&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email document }
             *
             * 获取客服邮箱地址
             *
             * 该接口用于获取客服邮箱地址
             */
            agentEmail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_emails`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch document }
             *
             * 更新客服信息
             *
             * 更新客服状态等信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 客服工作日程
           */
          agentSchedules: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete document }
             *
             * 删除客服
             *
             * 该接口用于删除客服
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get document }
             *
             * 获取客服工作日程;
             *
             * 该接口用于获取客服信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch document }
             *
             * 更新客服日程
             *
             * 该接口用于更新客服的日程
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * agent_schedule
           */
          agentSchedule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_schedule&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create document }
             *
             * 创建客服
             *
             * 该接口用于创建客服
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_schedule&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list document }
             *
             * 获取全部客服工作日程
             *
             * 该接口用于获取所有客服信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 客服技能
           */
          agentSkill: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create document }
             *
             * 创建客服技能
             *
             * 该接口用于创建客服技能
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete document }
             *
             * 删除客服技能
             *
             * 该接口用于删除客服技能
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get document }
             *
             * 获取客服技能
             *
             * 该接口用于获取客服技能
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list document }
             *
             * 获取全部客服技能
             *
             * 获取全部客服技能
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch document }
             *
             * 更新客服技能
             *
             * 该接口用于更新客服技能
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 客服技能规则
           */
          agentSkillRule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill_rule&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list document }
             *
             * 获取客服技能列表
             *
             * 该接口用于获取全部客服技能。仅支持自建应用。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 机器人消息
           */
          botMessage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=bot.message&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create document }
             *
             * 服务台机器人发送消息
             *
             * 通过服务台机器人给指定用户的服务台专属群或私聊发送消息，支持文本、富文本、卡片、图片。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/message`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 知识库分类
           */
          category: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create document }
             *
             * 创建知识库分类
             *
             * 该接口用于创建知识库分类。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete document }
             *
             * 删除知识库分类详情
             *
             * 该接口用于删除知识库分类详情。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get document }
             *
             * 获取知识库分类
             *
             * 该接口用于获取知识库分类。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list document }
             *
             * 获取全部知识库分类 - meta
             *
             * 该接口用于获取服务台知识库所有分类
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch document }
             *
             * 更新知识库分类详情
             *
             * 该接口用于更新知识库分类详情。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 事件订阅
           */
          event: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=event&apiName=subscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe document }
             *
             * 订阅服务台事件
             *
             * 用于订阅服务台事件
             */
            subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=event&apiName=unsubscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe document }
             *
             * 取消订阅服务台事件
             *
             * 用于取消订阅服务台事件
             */
            unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 知识库
           */
          faq: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create document }
             *
             * 创建知识库
             *
             * 该接口用于创建知识库。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete document }
             *
             * 删除知识库
             *
             * 该接口用于删除知识库。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=faq_image&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image document }
             *
             * 获取知识库图像
             *
             * 该接口用于获取知识库图像。
             */
            faqImage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get document }
             *
             * 获取知识库详情
             *
             * 该接口用于获取服务台知识库详情。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list document }
             *
             * 获取全部知识库详情
             *
             * 该接口用于获取服务台知识库详情。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch document }
             *
             * 修改知识库
             *
             * 该接口用于修改知识库。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/search`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search document }
             *
             * 搜索知识库
             *
             * 该接口用于搜索服务台知识库。
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/search`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 推送中心
           */
          notification: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=cancel_approve&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve document }
             *
             * 取消审核
             *
             * 提交审核后，如果需要取消审核，则调用此接口
             */
            cancelApprove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=cancel_send&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send document }
             *
             * 取消推送
             *
             * 取消推送接口，审核通过后待调度可以调用，发送过程中可以调用（会撤回已发送的消息），发送完成后可以需要推送（会撤回所有已发送的消息）
             */
            cancelSend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create document }
             *
             * 创建推送
             *
             * 调用接口创建推送，创建成功后为草稿状态
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=execute_send&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send document }
             *
             * 执行推送
             *
             * 审核通过后调用此接口设置推送时间，等待调度系统调度，发送消息
             */
            executeSend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get document }
             *
             * 查询推送
             *
             * 查询推送详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch document }
             *
             * 更新推送
             *
             * 更新推送信息，只有在草稿状态下才可以调用此接口进行更新
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=preview&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview document }
             *
             * 预览推送内容
             *
             * 在正式执行推送之前是可以调用此接口预览设置的推送内容
             */
            preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=submit_approve&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve document }
             *
             * 提交审核
             *
             * 正常情况下调用创建推送接口后，就可以调用提交审核接口，如果创建人是服务台owner则会自动审核通过，否则会通知服务台owner审核此推送信息
             */
            submitApprove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 工单
           */
          ticket: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=answer_user_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query document }
             *
             * 回复用户提问结果至工单
             *
             * 该接口用于回复用户提问结果至工单，需要工单仍处于进行中且未接入人工状态。仅支持自建应用。
             */
            answerUserQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=customized_fields&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields document }
             *
             * 获取服务台自定义字段详情
             *
             * 该接口用于获取服务台自定义字段详情。
             */
            customizedFields: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/customized_fields`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get document }
             *
             * 获取工单详情
             *
             * 该接口用于获取单个服务台工单详情。仅支持自建应用。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list document }
             *
             * 获取全部工单详情
             *
             * 该接口用于获取全部工单详情。仅支持自建应用。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=start_service&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service document }
             *
             * 创建服务台对话
             *
             * 该接口用于创建服务台对话。
             */
            startService: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/start_service`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=ticket_image&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image document }
             *
             * 获取服务台工单内消息图像
             *
             * 该接口用于获取服务台工单消息图象。仅支持自建应用。
             */
            ticketImage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_images`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update document }
             *
             * 更新工单详情
             *
             * 该接口用于更新服务台工单详情。只会更新数据，不会触发相关操作。如修改工单状态到关单，不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 事件
           */
          ticketMessage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket.message&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create document }
             *
             * 工单发送消息
             *
             * 该接口用于工单发送消息。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket.message&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list document }
             *
             * 获取服务台工单消息详情
             *
             * 该接口用于获取服务台工单消息详情。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 工单自定义字段
           */
          ticketCustomizedField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create document }
             *
             * 创建工单自定义字段
             *
             * 该接口用于创建自定义字段
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete document }
             *
             * 删除工单自定义字段
             *
             * 该接口用于删除工单自定义字段。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get document }
             *
             * 获取工单自定义字段
             *
             * 该接口用于获取工单自定义字段详情。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list document }
             *
             * 获取全部工单自定义字段
             *
             * 该接口用于获取全部工单自定义字段。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch document }
             *
             * 更新工单自定义字段
             *
             * 该接口用于更新自定义字段。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 客服
             */
            agent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent&apiName=agent_email&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email document }
               *
               * 获取客服邮箱地址
               *
               * 该接口用于获取客服邮箱地址
               */
              agentEmail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_emails`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/patch document }
               *
               * 更新客服信息
               *
               * 更新客服状态等信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 客服工作日程
             */
            agentSchedules: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/delete document }
               *
               * 删除客服
               *
               * 该接口用于删除客服
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/get document }
               *
               * 获取客服工作日程;
               *
               * 该接口用于获取客服信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent.schedules&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent-schedules/patch document }
               *
               * 更新客服日程
               *
               * 该接口用于更新客服的日程
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * agent_schedule
             */
            agentSchedule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_schedule&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/create document }
               *
               * 创建客服
               *
               * 该接口用于创建客服
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_schedule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_schedule/list document }
               *
               * 获取全部客服工作日程
               *
               * 该接口用于获取所有客服信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 客服技能
             */
            agentSkill: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/create document }
               *
               * 创建客服技能
               *
               * 该接口用于创建客服技能
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/delete document }
               *
               * 删除客服技能
               *
               * 该接口用于删除客服技能
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/get document }
               *
               * 获取客服技能
               *
               * 该接口用于获取客服技能
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/list document }
               *
               * 获取全部客服技能
               *
               * 获取全部客服技能
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill/patch document }
               *
               * 更新客服技能
               *
               * 该接口用于更新客服技能
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 客服技能规则
             */
            agentSkillRule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=agent_skill_rule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent_skill_rule/list document }
               *
               * 获取客服技能列表
               *
               * 该接口用于获取全部客服技能。仅支持自建应用。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 机器人消息
             */
            botMessage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=bot.message&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/bot-message/create document }
               *
               * 服务台机器人发送消息
               *
               * 通过服务台机器人给指定用户的服务台专属群或私聊发送消息，支持文本、富文本、卡片、图片。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/message`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 知识库分类
             */
            category: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/create document }
               *
               * 创建知识库分类
               *
               * 该接口用于创建知识库分类。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/delete document }
               *
               * 删除知识库分类详情
               *
               * 该接口用于删除知识库分类详情。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/get document }
               *
               * 获取知识库分类
               *
               * 该接口用于获取知识库分类。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/list document }
               *
               * 获取全部知识库分类 - meta
               *
               * 该接口用于获取服务台知识库所有分类
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=category&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/category/patch document }
               *
               * 更新知识库分类详情
               *
               * 该接口用于更新知识库分类详情。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/categories/:id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 事件订阅
             */
            event: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=event&apiName=subscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/subscribe document }
               *
               * 订阅服务台事件
               *
               * 用于订阅服务台事件
               */
              subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=event&apiName=unsubscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/event/unsubscribe document }
               *
               * 取消订阅服务台事件
               *
               * 用于取消订阅服务台事件
               */
              unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 知识库
             */
            faq: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/create document }
               *
               * 创建知识库
               *
               * 该接口用于创建知识库。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/delete document }
               *
               * 删除知识库
               *
               * 该接口用于删除知识库。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=faq_image&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/faq_image document }
               *
               * 获取知识库图像
               *
               * 该接口用于获取知识库图像。
               */
              faqImage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/get document }
               *
               * 获取知识库详情
               *
               * 该接口用于获取服务台知识库详情。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/list document }
               *
               * 获取全部知识库详情
               *
               * 该接口用于获取服务台知识库详情。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/patch document }
               *
               * 修改知识库
               *
               * 该接口用于修改知识库。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/search`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/faq/search document }
               *
               * 搜索知识库
               *
               * 该接口用于搜索服务台知识库。
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/faqs/search`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 推送中心
             */
            notification: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=cancel_approve&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_approve document }
               *
               * 取消审核
               *
               * 提交审核后，如果需要取消审核，则调用此接口
               */
              cancelApprove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=cancel_send&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/cancel_send document }
               *
               * 取消推送
               *
               * 取消推送接口，审核通过后待调度可以调用，发送过程中可以调用（会撤回已发送的消息），发送完成后可以需要推送（会撤回所有已发送的消息）
               */
              cancelSend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/create document }
               *
               * 创建推送
               *
               * 调用接口创建推送，创建成功后为草稿状态
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=execute_send&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/execute_send document }
               *
               * 执行推送
               *
               * 审核通过后调用此接口设置推送时间，等待调度系统调度，发送消息
               */
              executeSend: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/get document }
               *
               * 查询推送
               *
               * 查询推送详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/patch document }
               *
               * 更新推送
               *
               * 更新推送信息，只有在草稿状态下才可以调用此接口进行更新
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=preview&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/preview document }
               *
               * 预览推送内容
               *
               * 在正式执行推送之前是可以调用此接口预览设置的推送内容
               */
              preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=notification&apiName=submit_approve&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/notification/submit_approve document }
               *
               * 提交审核
               *
               * 正常情况下调用创建推送接口后，就可以调用提交审核接口，如果创建人是服务台owner则会自动审核通过，否则会通知服务台owner审核此推送信息
               */
              submitApprove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 工单
             */
            ticket: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=answer_user_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/answer_user_query document }
               *
               * 回复用户提问结果至工单
               *
               * 该接口用于回复用户提问结果至工单，需要工单仍处于进行中且未接入人工状态。仅支持自建应用。
               */
              answerUserQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=customized_fields&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/customized_fields document }
               *
               * 获取服务台自定义字段详情
               *
               * 该接口用于获取服务台自定义字段详情。
               */
              customizedFields: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/customized_fields`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/get document }
               *
               * 获取工单详情
               *
               * 该接口用于获取单个服务台工单详情。仅支持自建应用。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/list document }
               *
               * 获取全部工单详情
               *
               * 该接口用于获取全部工单详情。仅支持自建应用。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=start_service&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/start_service document }
               *
               * 创建服务台对话
               *
               * 该接口用于创建服务台对话。
               */
              startService: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/start_service`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=ticket_image&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/ticket_image document }
               *
               * 获取服务台工单内消息图像
               *
               * 该接口用于获取服务台工单消息图象。仅支持自建应用。
               */
              ticketImage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_images`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket/update document }
               *
               * 更新工单详情
               *
               * 该接口用于更新服务台工单详情。只会更新数据，不会触发相关操作。如修改工单状态到关单，不会关闭聊天页面。仅支持自建应用。要更新的工单字段必须至少输入一项。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 事件
             */
            ticketMessage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket.message&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/create document }
               *
               * 工单发送消息
               *
               * 该接口用于工单发送消息。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket.message&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket-message/list document }
               *
               * 获取服务台工单消息详情
               *
               * 该接口用于获取服务台工单消息详情。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 工单自定义字段
             */
            ticketCustomizedField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/create document }
               *
               * 创建工单自定义字段
               *
               * 该接口用于创建自定义字段
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/delete document }
               *
               * 删除工单自定义字段
               *
               * 该接口用于删除工单自定义字段。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/get document }
               *
               * 获取工单自定义字段
               *
               * 该接口用于获取工单自定义字段详情。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/list document }
               *
               * 获取全部工单自定义字段
               *
               * 该接口用于获取全部工单自定义字段。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket_customized_field&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/ticket_customized_field/patch document }
               *
               * 更新工单自定义字段
               *
               * 该接口用于更新自定义字段。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$x = class extends Client$y {
      constructor() {
        super(...arguments);
        this.hire = {
          /**
           * advertisement
           */
          advertisement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=advertisement&apiName=publish&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/advertisement/publish document }
             *
             * 职位发布至官网
             *
             * 支持把职位发布至招聘官网、内推平台
             */
            publish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 猎头（灰度租户可见）
           */
          agency: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=agency&version=v1 document }
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/get document }
             *
             * 获取猎头供应商信息
             *
             * 根据猎头供应商 ID 获取猎头供应商信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=get_agency_account&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_agency_account&project=hire&resource=agency&version=v1 document }
             */
            getAgencyAccount: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=operate_agency_account&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=operate_agency_account&project=hire&resource=agency&version=v1 document }
             */
            operateAgencyAccount: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=protect&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/protect document }
             *
             * 设置猎头保护期
             *
             * 设置猎头保护期
             */
            protect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/protect`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=protect_search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=protect_search&project=hire&resource=agency&version=v1 document }
             */
            protectSearch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/query document }
             *
             * 查询猎头供应商信息
             *
             * 根据猎头供应商名称查询猎头供应商信息
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 投递
           */
          application: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=cancel_onboard&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/cancel_onboard document }
             *
             * 取消候选人入职
             *
             * 操作候选人取消入职
             */
            cancelOnboard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create document }
             *
             * 创建投递
             *
             * 根据人才 ID 和职位 ID 创建投递
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get document }
             *
             * 获取投递信息
             *
             * 根据投递 ID 获取单个投递信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=get_detail&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_detail&project=hire&resource=application&version=v1 document }
             */
            getDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list document }
             *
             * 获取投递列表
             *
             * 根据限定条件获取投递列表信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=offer&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer document }
             *
             * 获取 Offer 信息
             *
             * 根据投递 ID 获取 Offer 信息
             */
            offer: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=recover&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recover&project=hire&resource=application&version=v1 document }
             */
            recover: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=terminate&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate document }
             *
             * 终止投递
             *
             * 根据投递 ID 修改投递状态为「已终止」
             */
            terminate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=transfer_onboard&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard document }
             *
             * 操作候选人入职
             *
             * 根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段，可通过「转移阶段」接口变更投递状态
             */
            transferOnboard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=transfer_stage&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_stage document }
             *
             * 转移阶段
             *
             * 转移投递阶段
             */
            transferStage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * application.interview
           */
          applicationInterview: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application.interview&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 附件
           */
          attachment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uIDN1YjLyQTN24iM0UjN/create_attachment document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get document }
             *
             * 获取附件信息
             *
             * 获取招聘系统中附件的元信息，比如文件名、创建时间、文件url等
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=preview&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview document }
             *
             * 获取附件预览信息
             *
             * 根据附件 ID 获取附件预览信息
             */
            preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 背调 （灰度租户可见）
           */
          backgroundCheckOrder: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=background_check_order&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=background_check_order&version=v1 document }
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=background_check_order&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/background_check_order/list document }
             *
             * 获取背调信息
             *
             * 根据投递ID或背调更新时间获取背调信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/background_check_orders`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * diversity_inclusion
           */
          diversityInclusion: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=diversity_inclusion&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=diversity_inclusion&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 生态对接账号自定义字段
           */
          ecoAccountCustomField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete document }
             *
             * 删除帐号自定义字段
             *
             * 删除用户在服务商处的身份标示字段（如用户在服务商处的租户 ID）。删除后，不影响已添加帐号对应的自定义字段的值。但在添加新帐号时，将不能再使用此自定义字段。删除不支持撤销，对应的 key 将无法再次复用。
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update document }
             *
             * 更新帐号自定义字段
             *
             * 更新用户在服务商处的身份标示字段（如用户在服务商处的租户 ID），此方法只会更新同一 scope 内 key 一致的自定义字段。
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create document }
             *
             * 创建帐号自定义字段
             *
             * 定制用户在服务商处的身份标示字段（如用户在服务商处的租户 ID）。用户在飞书招聘后台添加帐号后，系统会推送「帐号绑定」事件给开发者，事件将携带用户填写的自定义字段信息，开发者可根据此信息识别飞书招聘用户在服务商处的身份信息，完成飞书招聘用户和服务商帐号的绑定，并以此来推送对应的套餐或试卷列表等。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 背调订单
           */
          ecoBackgroundCheck: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=cancel&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel document }
             *
             * 终止背调订单
             *
             * 终止背调订单
             */
            cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=update_progress&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress document }
             *
             * 更新背调进度
             *
             * 更新指定背调的进度信息
             */
            updateProgress: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=update_result&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result document }
             *
             * 回传背调的最终结果
             *
             * 回传背调的最终结果
             */
            updateResult: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 背调自定义字段
           */
          ecoBackgroundCheckCustomField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete document }
             *
             * 删除背调自定义字段
             *
             * 删除用户在发起背调时的自定义字段，删除不影响已创建的背调，删除后对应的自定义字段的 key 不能再复用。
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update document }
             *
             * 更新背调自定义字段
             *
             * 更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型，且将影响已发起的背调表单展示。
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create document }
             *
             * 创建背调自定义字段
             *
             * 定制用户在发起背调时的自定义字段
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 背调套餐和附加调查项
           */
          ecoBackgroundCheckPackage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete document }
             *
             * 删除背调套餐和附加调查项
             *
             * 删除指定帐号的指定背调套餐和附加调查项信息，删除不会影响已创建的背调。
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update document }
             *
             * 更新背调套餐和附加调查项
             *
             * 更新指定帐号可用的背调套餐和附加调查项信息，更新将影响已发起背调的表单项展示
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create document }
             *
             * 推送背调套餐和附加调查项
             *
             * 定制指定帐号可用的背调套餐和附加调查项信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * eco_exam
           */
          ecoExam: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam&apiName=login_info&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 document }
             */
            loginInfo: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam&apiName=update_result&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 document }
             */
            updateResult: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * eco_exam_paper
           */
          ecoExamPaper: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 document }
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入 e-HR
           */
          ehrImportTask: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=ehr_import_task&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch document }
             *
             * 更新 e-HR 导入任务结果
             *
             * 在处理完导入 e-HR 事件后，可调用该接口，更新  e-HR 导入任务结果
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 入职
           */
          employee: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get document }
             *
             * 通过员工 ID 获取入职信息
             *
             * 通过员工 ID 获取入职信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/:employee_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=get_by_application&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application document }
             *
             * 通过投递 ID 获取入职信息
             *
             * 通过投递 ID 获取入职信息
             */
            getByApplication: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/get_by_application`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch document }
             *
             * 更新入职状态
             *
             * 根据员工 ID 更新员工转正、离职状态
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/:employee_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 评估（灰度租户可见）
           */
          evaluation: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=evaluation&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list document }
             *
             * 获取简历评估信息
             *
             * 获取简历评估信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 评估任务
           */
          evaluationTask: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluation_tasks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=evaluation_task&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation_task/list document }
             *
             * 获取员工评估任务
             *
             * 获取员工评估任务
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluation_tasks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 笔试 (灰度租户可见)
           */
          exam: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=exam&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/exam/create document }
             *
             * 添加笔试结果
             *
             * 根据投递 ID 添加该投递下的笔试结果
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/exams`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 笔试阅卷任务
           */
          examMarkingTask: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=exam_marking_task&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/exam_marking_task/list document }
             *
             * 获取员工笔试阅卷任务
             *
             * 获取员工笔试阅卷任务
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入外部系统信息（灰度租户可见）
           */
          externalApplication: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create document }
             *
             * 创建外部投递
             *
             * 导入来自其他系统的投递信息，创建为外部投递
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 document }
             *
             * 删除外部投递
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=external_application&version=v1 document }
             *
             * 根据人才 id 获取外部投递列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 document }
             *
             * 更新外部投递
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入外部系统信息（灰度租户可见）
           */
          externalBackgroundCheck: {
            batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_background_check&version=v1 document }
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create document }
             *
             * 创建外部背调
             *
             * 导入来自其他系统的背调信息，创建为外部背调
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_background_check&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_background_check&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入外部系统信息（灰度租户可见）
           */
          externalInterview: {
            batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_interview&version=v1 document }
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create document }
             *
             * 创建外部面试
             *
             * 导入来自其他系统的面试信息，创建为外部面试
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_interview&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_interview&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入外部系统信息（灰度租户可见）
           */
          externalInterviewAssessment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview_assessment&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create document }
             *
             * 创建外部面评
             *
             * 导入来自其他系统的面评信息，创建为外部面评
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interview_assessments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview_assessment&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=hire&resource=external_interview_assessment&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * external_offer
           */
          externalOffer: {
            batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=batch_query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_offer&version=v1 document }
             */
            batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=external_offer&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_offer&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_offer&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * external_referral_reward
           */
          externalReferralReward: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_referral_reward&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=external_referral_reward&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_referral_rewards`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_referral_reward&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_referral_reward&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 面试
           */
          interview: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview&apiName=get_by_talent&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/get_by_talent document }
             *
             * 获取人才面试信息
             *
             * 获取人才面试信息
             */
            getByTalent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list document }
             *
             * 获取面试信息
             *
             * 根据投递 ID 或面试时间获取面试信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviews`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * interview_feedback_form
           */
          interviewFeedbackForm: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_feedback_form&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interview_feedback_form&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * interview_record.attachment
           */
          interviewRecordAttachment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record.attachment&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=interview_record.attachment&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records/attachments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * interview_record
           */
          interviewRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_record/get document }
             *
             * 获取面试评价详细信息
             *
             * 获取面试评价详细信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interview_record&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * interview_registration_schema
           */
          interviewRegistrationSchema: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_registration_schema&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_registration_schema/list document }
             *
             * 获取面试登记表模板列表
             *
             * 获取面试登记表模板列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 面试轮次类型
           */
          interviewRoundType: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_round_type&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_round_type/list document }
             *
             * 获取面试轮次类型列表
             *
             * 获取面试轮次类型列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_round_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 面试任务
           */
          interviewTask: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_tasks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_task&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_task/list document }
             *
             * 获取员工面试任务
             *
             * 获取员工面试任务
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_tasks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * interviewer
           */
          interviewer: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interviewer&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interviewer&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interviewer&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=hire&resource=interviewer&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 职位
           */
          job: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=close&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/close document }
             *
             * 关闭职位
             *
             * 支持关闭职位，关闭后，职位将同步从官网、内推、猎头渠道下线
             */
            close: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=combined_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create document }
             *
             * 新建职位
             *
             * 新建职位，字段的是否必填，以系统中的「职位字段管理」中的设置为准。
             */
            combinedCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/combined_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=combined_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update document }
             *
             * 更新职位
             *
             * 更新职位信息，该接口为全量更新，若字段没有返回值，则原有值将会被清空。字段的是否必填，将以系统中的「职位字段管理」中的设置为准。
             */
            combinedUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=config&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config document }
             *
             * 获取职位设置
             *
             * 获取职位设置
             */
            config: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get document }
             *
             * 获取职位信息
             *
             * 根据职位 ID 获取职位信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=get_detail&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_detail&project=hire&resource=job&version=v1 document }
             */
            getDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/list document }
             *
             * 获取职位列表
             *
             * 根据更新时间获取职位列表，仅支持获取默认字段信息，获取详细信息可调用[获取职位详细](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get)接口
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=open&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/open document }
             *
             * 重启职位
             *
             * 支持开启职位
             */
            open: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=recruiter&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recruiter&project=hire&resource=job&version=v1 document }
             */
            recruiter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=update_config&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config document }
             *
             * 更新职位设置
             *
             * 更新职位设置，包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。
             */
            updateConfig: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job.manager
           */
          jobManager: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job.manager&apiName=batch_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/batch_update document }
             *
             * 更新职位相关人员
             *
             * 更新职位相关人员
             */
            batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job.manager&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get document }
             *
             * 获取职位上的招聘人员信息
             *
             * 根据职位 ID 获取职位上的招聘人员信息，如招聘负责人、用人经理
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_function
           */
          jobFunction: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_functions`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_function&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_function/list document }
             *
             * 获取职能分类列表
             *
             * 获取职能分类列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_functions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 流程
           */
          jobProcess: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_process&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list document }
             *
             * 获取招聘流程信息
             *
             * 获取全部招聘流程信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_processes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_publish_record
           */
          jobPublishRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_publish_record&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_publish_record/search document }
             *
             * 获取职位广告发布记录
             *
             * 获取职位广告发布记录
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_publish_records/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 招聘需求（灰度租户可见）
           */
          jobRequirement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create document }
             *
             * 创建招聘需求
             *
             * 创建招聘需求，除招聘需求编号为必填外，其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete document }
             *
             * 删除招聘需求
             *
             * 删除招聘需求
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list document }
             *
             * 获取招聘需求列表
             *
             * 获取招聘需求列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=list_by_id&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 document }
             *
             * 获取招聘需求信息
             */
            listById: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update document }
             *
             * 更新招聘需求
             *
             * 更新招聘需求
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_requirement_schema
           */
          jobRequirementSchema: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement_schema&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list document }
             *
             * 获取招聘需求模板
             *
             * 获取招聘需求模板
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_schema
           */
          jobSchema: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_schema&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_schema/list document }
             *
             * 获取职位模板
             *
             * 获取社招、校招职位模板中的职位字段，包括系统默认字段和自定义字段
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_schemas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * job_type
           */
          jobType: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_types`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_type&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_types`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 地址（灰度租户可见）
           */
          location: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=location&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/location/list document }
             *
             * 获取地址列表
             *
             * 获取地址列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=location&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=hire&resource=location&version=v1 document }
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * minutes
           */
          minutes: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=minutes&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=minutes&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/minutes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 备注
           */
          note: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create document }
             *
             * 创建备注
             *
             * 创建备注信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=note&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get document }
             *
             * 获取备注
             *
             * 根据备注 ID 获取备注信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list document }
             *
             * 获取备注列表
             *
             * 获取备注列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch document }
             *
             * 更新备注
             *
             * 根据备注 ID 更新备注信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * Offer
           */
          offer: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create document }
             *
             * 创建 Offer
             *
             * 创建 Offer 时，需传入本文档中标注为必传的参数，其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get document }
             *
             * 获取 Offer 详情
             *
             * 根据 Offer ID 获取 Offer 详细信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=intern_offer_status&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status document }
             *
             * 更新实习 Offer 入/离职状态
             *
             * 对「实习待入职」状态的实习 Offer 确认入职、放弃入职，或对「实习已入职」状态的实习 Offer 操作离职
             */
            internOfferStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list document }
             *
             * 获取 Offer 列表
             *
             * 根据人才 ID 获取 Offer 列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=offer_status&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 document }
             */
            offerStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update document }
             *
             * 更新 Offer 信息
             *
             * 1. 更新 Offer 时，需传入本文档中标注为必传的参数，其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义；;2. 对系统中已存在的 offer 进行更新的，若更新 offer 中含有「修改需审批」的字段，更新后原 Offer 的审批会自动撤回，需要重新发起审批
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * Offer 申请表（灰度租户可见）
           */
          offerApplicationForm: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_application_form&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_application_form/get document }
             *
             * 获取Offer申请表模板信息
             *
             * 获取Offer申请表模板信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_application_form&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_application_form/list document }
             *
             * 获取 Offer 申请表列表
             *
             * 获取 Offer 申请表列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_application_forms`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * Offer 审批流配置（灰度租户可见）
           */
          offerApprovalTemplate: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_approval_template&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_approval_template/list document }
             *
             * 获取 Offer 审批流配置列表
             *
             * 获取 Offer 审批流配置列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_approval_templates`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * offer_custom_field
           */
          offerCustomField: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_custom_field&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_custom_field/update document }
             *
             * 更新 Offer 申请表自定义字段
             *
             * - 本文档支持通过接口更新「飞书招聘」-「设置」-「Offer 申请表设置」中 Offer 申请表的自定义字段配置；;- 当前修改申请表信息（包括更新自定义字段）后，所有申请表的 schema_id 均会更新，即所有申请表均会新增一个版本，申请表的 schema_id 会在创建 offer、更新 offer 中使用；;- 「飞书招聘」中 Offer 申请表自定义字段创建后，不支持修改字段类型，本接口亦不支持更新字段类型；;- 当前字段类型为「公式」的，不支持通过接口更新
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * offer_schema
           */
          offerSchema: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_schema&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * portal_apply_schema
           */
          portalApplySchema: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=portal_apply_schema&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=portal_apply_schema&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 问卷（灰度租户可见）
           */
          questionnaire: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=questionnaire&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list document }
             *
             * 获取面试满意度问卷列表
             *
             * 获取面试满意度问卷列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/questionnaires`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 内推
           */
          referral: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral&apiName=get_by_application&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application document }
             *
             * 获取内推信息
             *
             * 根据投递 ID 获取内推信息
             */
            getByApplication: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=referral&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referrals/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * referral_account
           */
          referralAccount: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=deactivate&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 document }
             */
            deactivate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=enable&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=enable&project=hire&resource=referral_account&version=v1 document }
             */
            enable: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/enable`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=get_account_assets&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_account_assets&project=hire&resource=referral_account&version=v1 document }
             */
            getAccountAssets: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=reconciliation&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 document }
             */
            reconciliation: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=withdraw&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 document }
             */
            withdraw: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * referral_website.job_post
           */
          referralWebsiteJobPost: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_website.job_post&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 document }
             *
             * 获取内推官网下职位广告详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_website.job_post&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 document }
             *
             * 获取内推官网下的职位列表。自定义数据暂不支持列表获取，请从「获取内推官网下职位广告详情」接口获取
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * registration_schema
           */
          registrationSchema: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/registration_schemas`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=registration_schema&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/registration_schemas`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 简历来源
           */
          resumeSource: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/resume_sources`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=resume_source&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list document }
             *
             * 获取简历来源列表
             *
             * 获取简历来源列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/resume_sources`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 权限
           */
          role: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=role&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=role&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles/:role_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=role&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/role/list document }
             *
             * 获取角色列表
             *
             * 获取角色列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 项目（灰度租户可见）
           */
          subject: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=subject&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/subject/list document }
             *
             * 获取项目列表
             *
             * 获取项目列表（概念上一批集体启动和管理的职位可以定义为一个项目，例如 「2012 秋招项目」）
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/subjects`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 人才
           */
          talent: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=add_to_folder&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder document }
             *
             * 将人才加入指定文件夹
             *
             * 将人才加入指定文件夹
             */
            addToFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=batch_get_id&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id document }
             *
             * 通过人才信息获取人才 ID
             *
             * 通过人才信息获取人才 ID
             */
            batchGetId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=combined_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/combined_create document }
             *
             * 创建人才
             *
             * 用于在企业内创建一个人才。姓名为系统预设的必填字段，邮箱/电话字段请在飞书招聘标准简历模板设置中确认是否必填。可配合[获取人才字段](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query)接口获取自定义字段信息。
             */
            combinedCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/combined_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=combined_update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/combined_update document }
             *
             * 更新人才信息
             *
             * 用于在企业内更新一个人才。姓名为系统预设的必填字段，邮箱/电话字段请在飞书招聘标准简历模板设置中确认是否必填。可配合[获取人才字段](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query)接口获取自定义字段信息。
             */
            combinedUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/combined_update`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get document }
             *
             * 获取人才信息
             *
             * 根据人才 ID 获取人才信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/list document }
             *
             * 获取人才列表
             *
             * 根据更新时间获取人才列表，仅支持获取默认字段信息，获取详细信息可调用「获取人才详细」接口
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=onboard_status&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=onboard_status&project=hire&resource=talent&version=v1 document }
             */
            onboardStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=remove_to_folder&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_to_folder&project=hire&resource=talent&version=v1 document }
             */
            removeToFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=tag&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tag&project=hire&resource=talent&version=v1 document }
             */
            tag: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导入外部系统信息（灰度租户可见）
           */
          talentExternalInfo: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent.external_info&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent-external_info/create document }
             *
             * 创建人才外部信息
             *
             * 创建人才外部信息
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent.external_info&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent-external_info/update document }
             *
             * 更新人才外部信息
             *
             * 更新人才外部信息
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_blocklist
           */
          talentBlocklist: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_blocklist&apiName=change_talent_block&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=change_talent_block&project=hire&resource=talent_blocklist&version=v1 document }
             */
            changeTalentBlock: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_folder
           */
          talentFolder: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_folders`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_folder&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list document }
             *
             * 获取人才文件夹信息
             *
             * 用于获取招聘系统中人才文件夹信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_folders`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_object
           */
          talentObject: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_object&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query document }
             *
             * 获取人才字段
             *
             * 获取人才字段
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_objects/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_operation_log
           */
          talentOperationLog: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_operation_log&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/talent_operation_log/search document }
             *
             * 查询操作人对人才的操作记录
             *
             * 查询操作人对人才的操作记录
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_pool
           */
          talentPool: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=batch_change_talent_pool&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_change_talent_pool&project=hire&resource=talent_pool&version=v1 document }
             */
            batchChangeTalentPool: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=move_talent&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=move_talent&project=hire&resource=talent_pool&version=v1 document }
             */
            moveTalent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=talent_pool&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * talent_tag
           */
          talentTag: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_tags`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_tag&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=talent_tag&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_tags`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * termination_reason
           */
          terminationReason: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/termination_reasons`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=termination_reason&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/termination_reason/list document }
             *
             * 获取终止投递原因
             *
             * 获取终止投递原因
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/termination_reasons`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * test
           */
          test: {
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tests/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=test&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/test/search document }
             *
             * 获取笔试列表
             *
             * 批量获取人才在某投递流程中的笔试信息，如作答状态、笔试得分等。（目前仅支持获取 1w 条数据，若数据量较大，可通过控制 test_start_time 查询条件分批次获取全量数据）
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/tests/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 待办
           */
          todo: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/todos`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=todo&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/todo/list document }
             *
             * 获取待办列表
             *
             * 获取待办列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/todos`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * tripartite_agreement
           */
          tripartiteAgreement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=tripartite_agreement&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=tripartite_agreement&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=tripartite_agreement&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=tripartite_agreement&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 权限
           */
          userRole: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/user_roles`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=user_role&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/user_role/list document }
             *
             * 获取用户角色列表
             *
             * 获取用户角色列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/user_roles`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * website.channel
           */
          websiteChannel: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/create document }
             *
             * 创建官网推广渠道
             *
             * 根据官网 ID 和推广渠道名称创建官网推广渠道
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/delete document }
             *
             * 删除官网推广渠道
             *
             * 根据官网 ID 和推广渠道 ID 删除官网推广渠道
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/list document }
             *
             * 获取官网推广渠道列表
             *
             * 根据官网 ID 分页获取推广渠道列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/update document }
             *
             * 更新官网推广渠道
             *
             * 根据官网 ID 和推广渠道 ID 更改推广渠道名称
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * website.delivery
           */
          websiteDelivery: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery&apiName=create_by_attachment&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery/create_by_attachment document }
             *
             * 根据简历附件解析创建官网投递
             *
             * 根据简历附件解析创建官网投递
             */
            createByAttachment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery&apiName=create_by_resume&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery/create_by_resume document }
             *
             * 创建官网投递
             *
             * 创建官网投递。
             *
             * 对于自定义字段，若字段类型为单行文本，传值格式为"这是一个单行文本"；若字段类型为多行文本，传值格式为"这是一个多行文本"；若字段类型为单选，传值内容为选项的 ID，格式为"1";若字段类型为多选，传值内容为选项的ID 列表，格式为"["2", "3" ]"；若字段类型为时间段，传值格式为"["1609430400000", "1612108800000" ]"，单位是毫米级时间戳，结束时间是「至今」时，用「"-1"」表示；若字段类型为年份选择，传值格式为"1609430400000"，单位是毫秒级时间戳；若字段类型为月份选择，传值格式为"1625068800000"，单位是毫秒级时间戳；若字段类型为数字，传值格式为"1"
             */
            createByResume: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * website.delivery_task
           */
          websiteDeliveryTask: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery_task&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery_task/get document }
             *
             * 获取简历解析创建官网投递任务结果
             *
             * 获取官网投递任务信息;，如果获取到的数据data为空，仍然继续轮询，直到data不为空时，再查询data里面的数据
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * website.job_post
           */
          websiteJobPost: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/get document }
             *
             * 获取自定义官网下职位广告详情
             *
             * 获取自定义官网下职位广告详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/list document }
             *
             * 获取自定义官网下的职位列表
             *
             * 获取自定义官网下的职位列表。自定义数据暂不支持列表获取，请从「获取自定义官网下职位广告详情」接口获取。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`, path2),
                  method: "POST",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/search document }
             *
             * 搜索自定义官网下的职位列表
             *
             * 搜索自定义官网下的职位列表
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 官网（灰度租户可见）
           */
          website: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website/list document }
             *
             * 获取自定义官网列表
             *
             * 获取自定义官网列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * website.site_user
           */
          websiteSiteUser: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.site_user&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-site_user/create document }
             *
             * 创建官网用户
             *
             * 创建官网用户
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * advertisement
             */
            advertisement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=advertisement&apiName=publish&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/advertisement/publish document }
               *
               * 职位发布至官网
               *
               * 支持把职位发布至招聘官网、内推平台
               */
              publish: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 猎头（灰度租户可见）
             */
            agency: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=agency&version=v1 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/get document }
               *
               * 获取猎头供应商信息
               *
               * 根据猎头供应商 ID 获取猎头供应商信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=get_agency_account&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_agency_account&project=hire&resource=agency&version=v1 document }
               */
              getAgencyAccount: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=operate_agency_account&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=operate_agency_account&project=hire&resource=agency&version=v1 document }
               */
              operateAgencyAccount: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=protect&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/protect document }
               *
               * 设置猎头保护期
               *
               * 设置猎头保护期
               */
              protect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/protect`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=protect_search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=protect_search&project=hire&resource=agency&version=v1 document }
               */
              protectSearch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=agency&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/agency/query document }
               *
               * 查询猎头供应商信息
               *
               * 根据猎头供应商名称查询猎头供应商信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/agencies/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 投递
             */
            application: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=cancel_onboard&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/cancel_onboard document }
               *
               * 取消候选人入职
               *
               * 操作候选人取消入职
               */
              cancelOnboard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/create document }
               *
               * 创建投递
               *
               * 根据人才 ID 和职位 ID 创建投递
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/get document }
               *
               * 获取投递信息
               *
               * 根据投递 ID 获取单个投递信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=get_detail&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_detail&project=hire&resource=application&version=v1 document }
               */
              getDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list document }
               *
               * 获取投递列表
               *
               * 根据限定条件获取投递列表信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=offer&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/offer document }
               *
               * 获取 Offer 信息
               *
               * 根据投递 ID 获取 Offer 信息
               */
              offer: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=recover&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recover&project=hire&resource=application&version=v1 document }
               */
              recover: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=terminate&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/terminate document }
               *
               * 终止投递
               *
               * 根据投递 ID 修改投递状态为「已终止」
               */
              terminate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=transfer_onboard&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_onboard document }
               *
               * 操作候选人入职
               *
               * 根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段，可通过「转移阶段」接口变更投递状态
               */
              transferOnboard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application&apiName=transfer_stage&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/transfer_stage document }
               *
               * 转移阶段
               *
               * 转移投递阶段
               */
              transferStage: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * application.interview
             */
            applicationInterview: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=application.interview&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=application.interview&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 附件
             */
            attachment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uIDN1YjLyQTN24iM0UjN/create_attachment document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get document }
               *
               * 获取附件信息
               *
               * 获取招聘系统中附件的元信息，比如文件名、创建时间、文件url等
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=attachment&apiName=preview&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview document }
               *
               * 获取附件预览信息
               *
               * 根据附件 ID 获取附件预览信息
               */
              preview: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 背调 （灰度租户可见）
             */
            backgroundCheckOrder: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=background_check_order&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=background_check_order&version=v1 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=background_check_order&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/background_check_order/list document }
               *
               * 获取背调信息
               *
               * 根据投递ID或背调更新时间获取背调信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/background_check_orders`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * diversity_inclusion
             */
            diversityInclusion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=diversity_inclusion&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=diversity_inclusion&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 生态对接账号自定义字段
             */
            ecoAccountCustomField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_delete document }
               *
               * 删除帐号自定义字段
               *
               * 删除用户在服务商处的身份标示字段（如用户在服务商处的租户 ID）。删除后，不影响已添加帐号对应的自定义字段的值。但在添加新帐号时，将不能再使用此自定义字段。删除不支持撤销，对应的 key 将无法再次复用。
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/batch_update document }
               *
               * 更新帐号自定义字段
               *
               * 更新用户在服务商处的身份标示字段（如用户在服务商处的租户 ID），此方法只会更新同一 scope 内 key 一致的自定义字段。
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_account_custom_field&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_account_custom_field/create document }
               *
               * 创建帐号自定义字段
               *
               * 定制用户在服务商处的身份标示字段（如用户在服务商处的租户 ID）。用户在飞书招聘后台添加帐号后，系统会推送「帐号绑定」事件给开发者，事件将携带用户填写的自定义字段信息，开发者可根据此信息识别飞书招聘用户在服务商处的身份信息，完成飞书招聘用户和服务商帐号的绑定，并以此来推送对应的套餐或试卷列表等。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 背调订单
             */
            ecoBackgroundCheck: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=cancel&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/cancel document }
               *
               * 终止背调订单
               *
               * 终止背调订单
               */
              cancel: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=update_progress&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_progress document }
               *
               * 更新背调进度
               *
               * 更新指定背调的进度信息
               */
              updateProgress: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check&apiName=update_result&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check/update_result document }
               *
               * 回传背调的最终结果
               *
               * 回传背调的最终结果
               */
              updateResult: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 背调自定义字段
             */
            ecoBackgroundCheckCustomField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_delete document }
               *
               * 删除背调自定义字段
               *
               * 删除用户在发起背调时的自定义字段，删除不影响已创建的背调，删除后对应的自定义字段的 key 不能再复用。
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/batch_update document }
               *
               * 更新背调自定义字段
               *
               * 更新用户在发起背调时的自定义字段。更新操作不支持更新自定义字段类型，且将影响已发起的背调表单展示。
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_custom_field&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_custom_field/create document }
               *
               * 创建背调自定义字段
               *
               * 定制用户在发起背调时的自定义字段
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 背调套餐和附加调查项
             */
            ecoBackgroundCheckPackage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_delete document }
               *
               * 删除背调套餐和附加调查项
               *
               * 删除指定帐号的指定背调套餐和附加调查项信息，删除不会影响已创建的背调。
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/batch_update document }
               *
               * 更新背调套餐和附加调查项
               *
               * 更新指定帐号可用的背调套餐和附加调查项信息，更新将影响已发起背调的表单项展示
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_background_check_package&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/eco_background_check_package/create document }
               *
               * 推送背调套餐和附加调查项
               *
               * 定制指定帐号可用的背调套餐和附加调查项信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * eco_exam
             */
            ecoExam: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam&apiName=login_info&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=login_info&project=hire&resource=eco_exam&version=v1 document }
               */
              loginInfo: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam&apiName=update_result&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_result&project=hire&resource=eco_exam&version=v1 document }
               */
              updateResult: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * eco_exam_paper
             */
            ecoExamPaper: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=hire&resource=eco_exam_paper&version=v1 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=hire&resource=eco_exam_paper&version=v1 document }
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=eco_exam_paper&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=eco_exam_paper&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/eco_exam_papers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入 e-HR
             */
            ehrImportTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=ehr_import_task&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/ehr_import_task/patch document }
               *
               * 更新 e-HR 导入任务结果
               *
               * 在处理完导入 e-HR 事件后，可调用该接口，更新  e-HR 导入任务结果
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 入职
             */
            employee: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get document }
               *
               * 通过员工 ID 获取入职信息
               *
               * 通过员工 ID 获取入职信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/:employee_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=get_by_application&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application document }
               *
               * 通过投递 ID 获取入职信息
               *
               * 通过投递 ID 获取入职信息
               */
              getByApplication: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/get_by_application`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=employee&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch document }
               *
               * 更新入职状态
               *
               * 根据员工 ID 更新员工转正、离职状态
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/employees/:employee_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 评估（灰度租户可见）
             */
            evaluation: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=evaluation&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list document }
               *
               * 获取简历评估信息
               *
               * 获取简历评估信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 评估任务
             */
            evaluationTask: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluation_tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=evaluation_task&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation_task/list document }
               *
               * 获取员工评估任务
               *
               * 获取员工评估任务
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluation_tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 笔试 (灰度租户可见)
             */
            exam: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=exam&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/exam/create document }
               *
               * 添加笔试结果
               *
               * 根据投递 ID 添加该投递下的笔试结果
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/exams`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 笔试阅卷任务
             */
            examMarkingTask: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=exam_marking_task&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/exam_marking_task/list document }
               *
               * 获取员工笔试阅卷任务
               *
               * 获取员工笔试阅卷任务
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入外部系统信息（灰度租户可见）
             */
            externalApplication: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/create document }
               *
               * 创建外部投递
               *
               * 导入来自其他系统的投递信息，创建为外部投递
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_application&version=v1 document }
               *
               * 删除外部投递
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=external_application&version=v1 document }
               *
               * 根据人才 id 获取外部投递列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_application&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_application&version=v1 document }
               *
               * 更新外部投递
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入外部系统信息（灰度租户可见）
             */
            externalBackgroundCheck: {
              batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_background_check&version=v1 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_background_check/create document }
               *
               * 创建外部背调
               *
               * 导入来自其他系统的背调信息，创建为外部背调
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_background_check&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_background_check&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_background_check&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入外部系统信息（灰度租户可见）
             */
            externalInterview: {
              batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_interview&version=v1 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview/create document }
               *
               * 创建外部面试
               *
               * 导入来自其他系统的面试信息，创建为外部面试
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_interview&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_interview&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入外部系统信息（灰度租户可见）
             */
            externalInterviewAssessment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview_assessment&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_interview_assessment/create document }
               *
               * 创建外部面评
               *
               * 导入来自其他系统的面评信息，创建为外部面评
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interview_assessments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_interview_assessment&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=hire&resource=external_interview_assessment&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * external_offer
             */
            externalOffer: {
              batchQueryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=batch_query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=hire&resource=external_offer&version=v1 document }
               */
              batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=external_offer&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_offer&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_offer&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=external_offer&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * external_referral_reward
             */
            externalReferralReward: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_referral_reward&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=external_referral_reward&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_referral_rewards`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=external_referral_reward&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=external_referral_reward&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 面试
             */
            interview: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview&apiName=get_by_talent&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/get_by_talent document }
               *
               * 获取人才面试信息
               *
               * 获取人才面试信息
               */
              getByTalent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview/list document }
               *
               * 获取面试信息
               *
               * 根据投递 ID 或面试时间获取面试信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviews`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * interview_feedback_form
             */
            interviewFeedbackForm: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_feedback_form&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interview_feedback_form&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * interview_record.attachment
             */
            interviewRecordAttachment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record.attachment&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=interview_record.attachment&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records/attachments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * interview_record
             */
            interviewRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_record/get document }
               *
               * 获取面试评价详细信息
               *
               * 获取面试评价详细信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interview_record&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * interview_registration_schema
             */
            interviewRegistrationSchema: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_registration_schema&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_registration_schema/list document }
               *
               * 获取面试登记表模板列表
               *
               * 获取面试登记表模板列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 面试轮次类型
             */
            interviewRoundType: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_round_type&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_round_type/list document }
               *
               * 获取面试轮次类型列表
               *
               * 获取面试轮次类型列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_round_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 面试任务
             */
            interviewTask: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_task&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/interview_task/list document }
               *
               * 获取员工面试任务
               *
               * 获取员工面试任务
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interview_tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * interviewer
             */
            interviewer: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interviewer&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interviewer&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interviewer&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=hire&resource=interviewer&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 职位
             */
            job: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=close&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/close document }
               *
               * 关闭职位
               *
               * 支持关闭职位，关闭后，职位将同步从官网、内推、猎头渠道下线
               */
              close: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=combined_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_create document }
               *
               * 新建职位
               *
               * 新建职位，字段的是否必填，以系统中的「职位字段管理」中的设置为准。
               */
              combinedCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/combined_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=combined_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update document }
               *
               * 更新职位
               *
               * 更新职位信息，该接口为全量更新，若字段没有返回值，则原有值将会被清空。字段的是否必填，将以系统中的「职位字段管理」中的设置为准。
               */
              combinedUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=config&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/config document }
               *
               * 获取职位设置
               *
               * 获取职位设置
               */
              config: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get document }
               *
               * 获取职位信息
               *
               * 根据职位 ID 获取职位信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=get_detail&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_detail&project=hire&resource=job&version=v1 document }
               */
              getDetail: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/list document }
               *
               * 获取职位列表
               *
               * 根据更新时间获取职位列表，仅支持获取默认字段信息，获取详细信息可调用[获取职位详细](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/get)接口
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=open&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/open document }
               *
               * 重启职位
               *
               * 支持开启职位
               */
              open: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=recruiter&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=recruiter&project=hire&resource=job&version=v1 document }
               */
              recruiter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=update_config&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/update_config document }
               *
               * 更新职位设置
               *
               * 更新职位设置，包括面试评价表、Offer 申请表等。接口将按照所选择的「更新选项」进行设置参数校验和更新。
               */
              updateConfig: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job.manager
             */
            jobManager: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job.manager&apiName=batch_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/batch_update document }
               *
               * 更新职位相关人员
               *
               * 更新职位相关人员
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job.manager&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get document }
               *
               * 获取职位上的招聘人员信息
               *
               * 根据职位 ID 获取职位上的招聘人员信息，如招聘负责人、用人经理
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_function
             */
            jobFunction: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_functions`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_function&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_function/list document }
               *
               * 获取职能分类列表
               *
               * 获取职能分类列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_functions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 流程
             */
            jobProcess: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_process&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_process/list document }
               *
               * 获取招聘流程信息
               *
               * 获取全部招聘流程信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_processes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_publish_record
             */
            jobPublishRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_publish_record&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_publish_record/search document }
               *
               * 获取职位广告发布记录
               *
               * 获取职位广告发布记录
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_publish_records/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 招聘需求（灰度租户可见）
             */
            jobRequirement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/create document }
               *
               * 创建招聘需求
               *
               * 创建招聘需求，除招聘需求编号为必填外，其他字段是否必填与飞书招聘「招聘需求字段管理」内设置一致
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/delete document }
               *
               * 删除招聘需求
               *
               * 删除招聘需求
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/list document }
               *
               * 获取招聘需求列表
               *
               * 获取招聘需求列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=list_by_id&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_by_id&project=hire&resource=job_requirement&version=v1 document }
               *
               * 获取招聘需求信息
               */
              listById: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement/update document }
               *
               * 更新招聘需求
               *
               * 更新招聘需求
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_requirement_schema
             */
            jobRequirementSchema: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_requirement_schema&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_requirement_schema/list document }
               *
               * 获取招聘需求模板
               *
               * 获取招聘需求模板
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_schema
             */
            jobSchema: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_schema&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job_schema/list document }
               *
               * 获取职位模板
               *
               * 获取社招、校招职位模板中的职位字段，包括系统默认字段和自定义字段
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_schemas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * job_type
             */
            jobType: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_types`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job_type&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=job_type&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/job_types`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 地址（灰度租户可见）
             */
            location: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=location&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/location/list document }
               *
               * 获取地址列表
               *
               * 获取地址列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=location&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=hire&resource=location&version=v1 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/locations/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * minutes
             */
            minutes: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=minutes&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=minutes&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/minutes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 备注
             */
            note: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create document }
               *
               * 创建备注
               *
               * 创建备注信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=note&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get document }
               *
               * 获取备注
               *
               * 根据备注 ID 获取备注信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list document }
               *
               * 获取备注列表
               *
               * 获取备注列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=note&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch document }
               *
               * 更新备注
               *
               * 根据备注 ID 更新备注信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/notes/:note_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * Offer
             */
            offer: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create document }
               *
               * 创建 Offer
               *
               * 创建 Offer 时，需传入本文档中标注为必传的参数，其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get document }
               *
               * 获取 Offer 详情
               *
               * 根据 Offer ID 获取 Offer 详细信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=intern_offer_status&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status document }
               *
               * 更新实习 Offer 入/离职状态
               *
               * 对「实习待入职」状态的实习 Offer 确认入职、放弃入职，或对「实习已入职」状态的实习 Offer 操作离职
               */
              internOfferStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list document }
               *
               * 获取 Offer 列表
               *
               * 根据人才 ID 获取 Offer 列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=offer_status&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 document }
               */
              offerStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update document }
               *
               * 更新 Offer 信息
               *
               * 1. 更新 Offer 时，需传入本文档中标注为必传的参数，其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义；;2. 对系统中已存在的 offer 进行更新的，若更新 offer 中含有「修改需审批」的字段，更新后原 Offer 的审批会自动撤回，需要重新发起审批
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * Offer 申请表（灰度租户可见）
             */
            offerApplicationForm: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_application_form&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_application_form/get document }
               *
               * 获取Offer申请表模板信息
               *
               * 获取Offer申请表模板信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_application_form&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_application_form/list document }
               *
               * 获取 Offer 申请表列表
               *
               * 获取 Offer 申请表列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_application_forms`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * Offer 审批流配置（灰度租户可见）
             */
            offerApprovalTemplate: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_approval_template&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_approval_template/list document }
               *
               * 获取 Offer 审批流配置列表
               *
               * 获取 Offer 审批流配置列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_approval_templates`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * offer_custom_field
             */
            offerCustomField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_custom_field&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_custom_field/update document }
               *
               * 更新 Offer 申请表自定义字段
               *
               * - 本文档支持通过接口更新「飞书招聘」-「设置」-「Offer 申请表设置」中 Offer 申请表的自定义字段配置；;- 当前修改申请表信息（包括更新自定义字段）后，所有申请表的 schema_id 均会更新，即所有申请表均会新增一个版本，申请表的 schema_id 会在创建 offer、更新 offer 中使用；;- 「飞书招聘」中 Offer 申请表自定义字段创建后，不支持修改字段类型，本接口亦不支持更新字段类型；;- 当前字段类型为「公式」的，不支持通过接口更新
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * offer_schema
             */
            offerSchema: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer_schema&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=offer_schema&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * portal_apply_schema
             */
            portalApplySchema: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=portal_apply_schema&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=portal_apply_schema&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 问卷（灰度租户可见）
             */
            questionnaire: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=questionnaire&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list document }
               *
               * 获取面试满意度问卷列表
               *
               * 获取面试满意度问卷列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/questionnaires`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 内推
             */
            referral: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral&apiName=get_by_application&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application document }
               *
               * 获取内推信息
               *
               * 根据投递 ID 获取内推信息
               */
              getByApplication: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=referral&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referrals/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * referral_account
             */
            referralAccount: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=referral_account&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=deactivate&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=deactivate&project=hire&resource=referral_account&version=v1 document }
               */
              deactivate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=enable&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=enable&project=hire&resource=referral_account&version=v1 document }
               */
              enable: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/enable`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=get_account_assets&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_account_assets&project=hire&resource=referral_account&version=v1 document }
               */
              getAccountAssets: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=reconciliation&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reconciliation&project=hire&resource=referral_account&version=v1 document }
               */
              reconciliation: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_account&apiName=withdraw&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=withdraw&project=hire&resource=referral_account&version=v1 document }
               */
              withdraw: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * referral_website.job_post
             */
            referralWebsiteJobPost: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_website.job_post&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=referral_website.job_post&version=v1 document }
               *
               * 获取内推官网下职位广告详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=referral_website.job_post&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=referral_website.job_post&version=v1 document }
               *
               * 获取内推官网下的职位列表。自定义数据暂不支持列表获取，请从「获取内推官网下职位广告详情」接口获取
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * registration_schema
             */
            registrationSchema: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/registration_schemas`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=registration_schema&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=registration_schema&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/registration_schemas`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 简历来源
             */
            resumeSource: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/resume_sources`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=resume_source&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list document }
               *
               * 获取简历来源列表
               *
               * 获取简历来源列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/resume_sources`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 权限
             */
            role: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=role&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=role&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles/:role_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=role&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/role/list document }
               *
               * 获取角色列表
               *
               * 获取角色列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/roles`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 项目（灰度租户可见）
             */
            subject: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=subject&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/subject/list document }
               *
               * 获取项目列表
               *
               * 获取项目列表（概念上一批集体启动和管理的职位可以定义为一个项目，例如 「2012 秋招项目」）
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/subjects`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 人才
             */
            talent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=add_to_folder&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/add_to_folder document }
               *
               * 将人才加入指定文件夹
               *
               * 将人才加入指定文件夹
               */
              addToFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=batch_get_id&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/batch_get_id document }
               *
               * 通过人才信息获取人才 ID
               *
               * 通过人才信息获取人才 ID
               */
              batchGetId: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=combined_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/combined_create document }
               *
               * 创建人才
               *
               * 用于在企业内创建一个人才。姓名为系统预设的必填字段，邮箱/电话字段请在飞书招聘标准简历模板设置中确认是否必填。可配合[获取人才字段](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query)接口获取自定义字段信息。
               */
              combinedCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/combined_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=combined_update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/combined_update document }
               *
               * 更新人才信息
               *
               * 用于在企业内更新一个人才。姓名为系统预设的必填字段，邮箱/电话字段请在飞书招聘标准简历模板设置中确认是否必填。可配合[获取人才字段](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query)接口获取自定义字段信息。
               */
              combinedUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/combined_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/get document }
               *
               * 获取人才信息
               *
               * 根据人才 ID 获取人才信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/list document }
               *
               * 获取人才列表
               *
               * 根据更新时间获取人才列表，仅支持获取默认字段信息，获取详细信息可调用「获取人才详细」接口
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=onboard_status&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=onboard_status&project=hire&resource=talent&version=v1 document }
               */
              onboardStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=remove_to_folder&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_to_folder&project=hire&resource=talent&version=v1 document }
               */
              removeToFolder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=tag&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tag&project=hire&resource=talent&version=v1 document }
               */
              tag: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导入外部系统信息（灰度租户可见）
             */
            talentExternalInfo: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent.external_info&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent-external_info/create document }
               *
               * 创建人才外部信息
               *
               * 创建人才外部信息
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent.external_info&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent-external_info/update document }
               *
               * 更新人才外部信息
               *
               * 更新人才外部信息
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_blocklist
             */
            talentBlocklist: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_blocklist&apiName=change_talent_block&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=change_talent_block&project=hire&resource=talent_blocklist&version=v1 document }
               */
              changeTalentBlock: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_folder
             */
            talentFolder: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_folders`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_folder&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_folder/list document }
               *
               * 获取人才文件夹信息
               *
               * 用于获取招聘系统中人才文件夹信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_folders`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_object
             */
            talentObject: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_object&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent_object/query document }
               *
               * 获取人才字段
               *
               * 获取人才字段
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_objects/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_operation_log
             */
            talentOperationLog: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_operation_log&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/talent/talent_operation_log/search document }
               *
               * 查询操作人对人才的操作记录
               *
               * 查询操作人对人才的操作记录
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_pool
             */
            talentPool: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=batch_change_talent_pool&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_change_talent_pool&project=hire&resource=talent_pool&version=v1 document }
               */
              batchChangeTalentPool: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=move_talent&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=move_talent&project=hire&resource=talent_pool&version=v1 document }
               */
              moveTalent: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_pool&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=hire&resource=talent_pool&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_pools/`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * talent_tag
             */
            talentTag: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_tags`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent_tag&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=talent_tag&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/talent_tags`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * termination_reason
             */
            terminationReason: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/termination_reasons`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=termination_reason&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/termination_reason/list document }
               *
               * 获取终止投递原因
               *
               * 获取终止投递原因
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/termination_reasons`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * test
             */
            test: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/tests/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=test&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/test/search document }
               *
               * 获取笔试列表
               *
               * 批量获取人才在某投递流程中的笔试信息，如作答状态、笔试得分等。（目前仅支持获取 1w 条数据，若数据量较大，可通过控制 test_start_time 查询条件分批次获取全量数据）
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tests/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 待办
             */
            todo: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/todos`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=todo&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/todo/list document }
               *
               * 获取待办列表
               *
               * 获取待办列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/todos`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * tripartite_agreement
             */
            tripartiteAgreement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=hire&resource=tripartite_agreement&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=hire&resource=tripartite_agreement&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=tripartite_agreement&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=tripartite_agreement&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=hire&resource=tripartite_agreement&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 权限
             */
            userRole: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/user_roles`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=user_role&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/user_role/list document }
               *
               * 获取用户角色列表
               *
               * 获取用户角色列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/user_roles`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * website.channel
             */
            websiteChannel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/create document }
               *
               * 创建官网推广渠道
               *
               * 根据官网 ID 和推广渠道名称创建官网推广渠道
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/delete document }
               *
               * 删除官网推广渠道
               *
               * 根据官网 ID 和推广渠道 ID 删除官网推广渠道
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/list document }
               *
               * 获取官网推广渠道列表
               *
               * 根据官网 ID 分页获取推广渠道列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.channel&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-channel/update document }
               *
               * 更新官网推广渠道
               *
               * 根据官网 ID 和推广渠道 ID 更改推广渠道名称
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * website.delivery
             */
            websiteDelivery: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery&apiName=create_by_attachment&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery/create_by_attachment document }
               *
               * 根据简历附件解析创建官网投递
               *
               * 根据简历附件解析创建官网投递
               */
              createByAttachment: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery&apiName=create_by_resume&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery/create_by_resume document }
               *
               * 创建官网投递
               *
               * 创建官网投递。
               *
               * 对于自定义字段，若字段类型为单行文本，传值格式为"这是一个单行文本"；若字段类型为多行文本，传值格式为"这是一个多行文本"；若字段类型为单选，传值内容为选项的 ID，格式为"1";若字段类型为多选，传值内容为选项的ID 列表，格式为"["2", "3" ]"；若字段类型为时间段，传值格式为"["1609430400000", "1612108800000" ]"，单位是毫米级时间戳，结束时间是「至今」时，用「"-1"」表示；若字段类型为年份选择，传值格式为"1609430400000"，单位是毫秒级时间戳；若字段类型为月份选择，传值格式为"1625068800000"，单位是毫秒级时间戳；若字段类型为数字，传值格式为"1"
               */
              createByResume: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * website.delivery_task
             */
            websiteDeliveryTask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.delivery_task&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-delivery_task/get document }
               *
               * 获取简历解析创建官网投递任务结果
               *
               * 获取官网投递任务信息;，如果获取到的数据data为空，仍然继续轮询，直到data不为空时，再查询data里面的数据
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * website.job_post
             */
            websiteJobPost: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/get document }
               *
               * 获取自定义官网下职位广告详情
               *
               * 获取自定义官网下职位广告详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/list document }
               *
               * 获取自定义官网下的职位列表
               *
               * 获取自定义官网下的职位列表。自定义数据暂不支持列表获取，请从「获取自定义官网下职位广告详情」接口获取。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.job_post&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-job_post/search document }
               *
               * 搜索自定义官网下的职位列表
               *
               * 搜索自定义官网下的职位列表
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 官网（灰度租户可见）
             */
            website: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website/list document }
               *
               * 获取自定义官网列表
               *
               * 获取自定义官网列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * website.site_user
             */
            websiteSiteUser: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=website.site_user&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/website-site_user/create document }
               *
               * 创建官网用户
               *
               * 创建官网用户
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * interview_record
             */
            interviewRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=hire&resource=interview_record&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/hire/v2/interview_records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=interview_record&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=hire&resource=interview_record&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v2/interview_records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 人才
             */
            talent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=hire&resource=talent&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/hire-v2/talent/get document }
               *
               * 获取人才信息V2
               *
               * 根据人才 ID 获取人才信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/hire/v2/talents/:talent_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$w = class extends Client$x {
      constructor() {
        super(...arguments);
        this.human_authentication = {
          /**
           * 实名认证
           */
          identity: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=human_authentication&resource=identity&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create document }
             *
             * 录入身份信息
             *
             * 该接口用于录入实名认证的身份信息，在唤起有源活体认证前，需要使用该接口进行实名认证。
             *
             * 实名认证接口会有计费管理，接入前请联系飞书开放平台工作人员，邮箱：openplatform@bytedance.com。;;仅通过计费申请的应用，才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/human_authentication/v1/identities`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 实名认证
             */
            identity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=human_authentication&resource=identity&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create document }
               *
               * 录入身份信息
               *
               * 该接口用于录入实名认证的身份信息，在唤起有源活体认证前，需要使用该接口进行实名认证。
               *
               * 实名认证接口会有计费管理，接入前请联系飞书开放平台工作人员，邮箱：openplatform@bytedance.com。;;仅通过计费申请的应用，才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/human_authentication/v1/identities`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$v = class extends Client$w {
      constructor() {
        super(...arguments);
        this.im = {
          /**
           * 消息 - 批量消息
           */
          batchMessage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete document }
             *
             * 批量撤回消息
             *
             * 批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。
             *
             * 注意事项：;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息，所以为异步接口，会有一定延迟。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=get_progress&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress document }
             *
             * 查询批量消息整体进度
             *
             * 该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上，增加了批量请求中有效的userid数量以及消息撤回进度数据。
             *
             * 注意事项:;* 该接口返回的数据为查询时刻的快照数据
             */
            getProgress: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=read_user&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user document }
             *
             * 查询批量消息推送和阅读人数
             *
             * 批量发送消息后，可以通过该接口查询批量消息推送的总人数和阅读人数。
             *
             * 注意事项：;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据
             */
            readUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组 - 群公告
           */
          chatAnnouncement: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.announcement&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get document }
             *
             * 获取群公告信息
             *
             * 获取会话中的群公告信息，公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时，操作者须与群组在同一租户下
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.announcement&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch document }
             *
             * 更新群公告信息
             *
             * 更新会话中的群公告信息，更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时，操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置，群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置，所有成员可以更新群公告
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组
           */
          chat: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create document }
             *
             * 创建群
             *
             * 创建群并设置群头像、群名、群描述等。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群；如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete document }
             *
             * 解散群
             *
             * 解散群组。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token，需要机器人符合以下任一情况才可解散群：;    - 机器人是群主;    - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token，需要对应的用户是群主才可解散群
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get document }
             *
             * 获取群信息
             *
             * 获取群名称、群描述、群头像、群主 ID 等群基本信息。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里（否则只会返回群名称、群头像等基本信息）;- 获取内部群信息时，操作者须与群组在同一租户下
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=link&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link document }
             *
             * 获取群分享链接
             *
             * 获取指定群的分享链接。
             *
             * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时，Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时，仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时，操作者须与群组在同一租户下
             */
            link: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list document }
             *
             * 获取用户或机器人所在的群列表
             *
             * 获取用户或者机器人所在群列表。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/search`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search document }
             *
             * 搜索对用户或机器人可见的群列表
             *
             * 搜索对用户或机器人可见的群列表，包括：用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括：群ID（chat_id）、群名称、群描述等。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/search`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update document }
             *
             * 更新群信息
             *
             * 更新群头像、群名称、群描述、群配置、转让群主等。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可更新所有信息;- 对于不满足上述权限条件的群成员或机器人：;    - 若未开启 ==仅群主和群管理员可编辑群信息== 配置，仅可更新群头像、群名称、群描述、群国际化名称信息;    - 若开启了 ==仅群主和群管理员可编辑群信息== 配置，任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件：;    - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==，需要设置 ==群分享权限== 为 ==允许分享==;    - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==，需要设置 ==群分享权限== 为 ==不允许分享==
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组 - 群成员
           */
          chatManagers: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.managers&apiName=add_managers&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers document }
             *
             * 指定群管理员
             *
             * 将用户或机器人指定为群管理员。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员
             */
            addManagers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.managers&apiName=delete_managers&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers document }
             *
             * 删除群管理员
             *
             * 删除指定的群管理员（用户或机器人）。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员
             */
            deleteManagers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组 - 群成员
           */
          chatMembers: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create document }
             *
             * 将用户或机器人拉入群聊
             *
             * 将用户或机器人拉入群聊。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时，操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时，仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时，所有群成员都可以拉用户或机器人进群
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete document }
             *
             * 将用户或机器人移出群聊
             *
             * 将用户或机器人移出群聊。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群（即主动退群）;- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人，可以移除其他用户或者机器人;- 每次请求，最多移除50个用户或者5个机器人;- 操作内部群时，操作者须与群组在同一租户下
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get document }
             *
             * 获取群成员列表
             *
             * 获取用户/机器人所在群的群成员列表。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员，因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员，会一次性返回，这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时，操作者须与群组在同一租户下
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=is_in_chat&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat document }
             *
             * 判断用户或机器人是否在群里
             *
             * 根据使用的access_token判断对应的用户或者机器人是否在群里。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时，操作者须与群组在同一租户下
             */
            isInChat: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=me_join&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join document }
             *
             * 用户或机器人主动加入群聊
             *
             * 用户或机器人主动加入群聊。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时，操作者须与群组在同一租户下
             */
            meJoin: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * chat.menu_item
           */
          chatMenuItem: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_item&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch document }
             *
             * 修改群菜单元信息
             *
             * 修改某个一级菜单或者二级菜单的元信息。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组 - 群菜单
           */
          chatMenuTree: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create document }
             *
             * 添加群菜单
             *
             * 向群内添加群菜单。
             *
             * 注意事项：;- 该API是向群内追加菜单，群内原来存在的菜单并不会被覆盖。操作API后，将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内，一级菜单最多有3个，每个一级菜单最多有5个二级菜单。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete document }
             *
             * 删除群菜单。
             *
             * 删除群内菜单。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后，将返回群内所有菜单。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get document }
             *
             * 获取群内菜单
             *
             * 通过群ID获取群内菜单。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=sort&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort document }
             *
             * 排序群菜单
             *
             * 给一个群内的一级菜单排序。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后，将返回群内所有菜单。
             */
            sort: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * chat.moderation
           */
          chatModeration: {
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.moderation&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get document }
             *
             * 获取群成员发言权限
             *
             * 获取群发言模式、可发言用户名单等
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.moderation&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update document }
             *
             * 更新群发言权限
             *
             * 更新群组的发言权限设置，可设置为全员可发言、仅管理员可发言  或 指定用户可发言。
             *
             * 注意事项：; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口，**当授权用户是群主**时，可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口)，当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时，可更新群发言权限
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 群组 - 会话标签页
           */
          chatTab: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create document }
             *
             * 添加会话标签页
             *
             * 添加自定义会话标签页。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时，操作者（access token对应的身份）需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以添加会话标签页;- 操作内部群时，操作者须与群组在同一租户下
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=delete_tabs&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs document }
             *
             * 删除会话标签页
             *
             * 删除会话标签页。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以删除会话标签页;- 操作内部群时，操作者须与群组在同一租户下
             */
            deleteTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=list_tabs&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs document }
             *
             * 拉取会话标签页
             *
             * 拉取会话标签页。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时，操作者须与群组在同一租户下
             */
            listTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=sort_tabs&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs document }
             *
             * 会话标签页排序
             *
             * 会话标签页排序。
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位，不参与排序，但是请求体中必须包含该标签页的Tab ID;- 操作内部群时，操作者须与群组在同一租户下
             */
            sortTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=update_tabs&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs document }
             *
             * 更新会话标签页
             *
             * 更新会话标签页
             *
             * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时，操作者（access token对应的身份）需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以更新会话标签页;- 操作内部群时，操作者须与群组在同一租户下
             */
            updateTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * chat.top_notice
           */
          chatTopNotice: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.top_notice&apiName=delete_top_notice&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice document }
             *
             * 撤销群置顶
             *
             * 撤销会话中的置顶。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时，操作者须与群组在同一租户下
             */
            deleteTopNotice: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.top_notice&apiName=put_top_notice&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice document }
             *
             * 更新群置顶
             *
             * 更新会话中的群置顶信息，可以将群中的某一条消息，或者群公告置顶显示。
             *
             * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时，操作者须与群组在同一租户下
             */
            putTopNotice: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 消息 - 文件信息
           */
          file: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=file&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create document }
             *
             * 上传文件
             *
             * 上传文件，可以上传视频，音频和常见的文件类型。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M，且不允许上传空文件
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/files`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=file&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get document }
             *
             * 下载文件
             *
             * 下载文件接口，只能下载应用自己上传的文件。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源，请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header，发起请求的时候需要在header中设置Content-Type为application/json
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/files/:file_key`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 消息 - 图片信息
           */
          image: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=image&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create document }
             *
             * 上传图片
             *
             * 上传图片接口，支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M，且不支持上传大小为0的图片
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/images`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=image&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get document }
             *
             * 下载图片
             *
             * 下载图片资源，只能下载当前应用所上传且图片类型为message的图片。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片，avatar类型暂不支持下载;- 下载用户发送的资源，请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/images/:image_key`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 消息加急
           */
          message: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create document }
             *
             * 发送消息
             *
             * 给指定用户或者会话发送消息，支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 给用户发送消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息，需要机器人在群组中
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete document }
             *
             * 撤回消息
             *
             * 机器人撤回机器人自己发送的消息或群主撤回群内消息。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ，撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内，自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息，则机器人必须是该群的群主、管理员 或者 创建者，且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=forward&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 document }
             *
             * 转发一条消息
             */
            forward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get document }
             *
             * 获取指定消息的内容
             *
             * 通过 message_id 查询消息内容。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 机器人必须在群组中
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list document }
             *
             * 获取会话历史消息
             *
             * 获取会话（包括单聊、群组）的历史消息（聊天记录）。
             *
             * - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 获取消息时，机器人必须在群组中
             *
             * 接口级别权限默认只能获取单聊（p2p）消息，如果需要获取群组（group）消息，应用还必须拥有 **==获取群组中所有消息==** 权限
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=merge_forward&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 document }
             *
             * 合并转发多条消息
             */
            mergeForward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/merge_forward`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch document }
             *
             * 更新应用发送的消息
             *
             * 更新应用已发送的消息卡片内容。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息，该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息，需在卡片的config属性中，显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB；卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS**
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=push_follow_up&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=push_follow_up&project=im&resource=message&version=v1 document }
             */
            pushFollowUp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=read_users&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users document }
             *
             * 查询消息已读信息
             *
             * 查询消息的已读信息。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能查询机器人自己发送，且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息
             */
            readUsers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=reply&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply document }
             *
             * 回复消息
             *
             * 回复指定消息，支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 回复私聊消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息，需要机器人在群中
             */
            reply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 document }
             *
             * 编辑已发送的消息内容，当前仅支持编辑文本和富文本消息。
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_app&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app document }
             *
             * 发送应用内加急
             *
             * 对指定消息进行应用内加急。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急（用户未读的加急上限为200条）
             *
             * 特别说明：;- 默认接口限流为50 QPS，请谨慎调用
             */
            urgentApp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_phone&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone document }
             *
             * 发送电话加急
             *
             * 对指定消息进行应用内加急与电话加急。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急（用户未读的加急上限为200条）
             *
             * 特别说明：;- 通过接口产生的电话加急将消耗企业的加急额度，请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS，请谨慎调用
             */
            urgentPhone: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_sms&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms document }
             *
             * 发送短信加急
             *
             * 对指定消息进行应用内加急与短信加急。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急（用户未读的加急上限为200条）
             *
             * 特别说明：;- 通过接口产生的短信加急将消耗企业的加急额度，请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS，请谨慎调用
             */
            urgentSms: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create document }
             *
             * 通过模版消息卡片发送消息
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 给用户发送消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息，需要机器人在群组中
             */
            createByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
              const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                type: "template",
                data: {
                  template_id,
                  template_variable
                }
              }) }, rest);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                method: "POST",
                data: targetData,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=reply&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply document }
             *
             * 通过模版消息卡片回复消息
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 回复私聊消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息，需要机器人在群中
             */
            replyByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
              const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                type: "template",
                data: {
                  template_id,
                  template_variable
                }
              }) }, rest);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`, path2),
                method: "POST",
                data: targetData,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 document }
             *
             * 通过模版消息卡片
             */
            updateByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
              const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                type: "template",
                data: {
                  template_id,
                  template_variable
                }
              }) }, rest);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                method: "PUT",
                data: targetData,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 消息 - 表情回复
           */
          messageReaction: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create document }
             *
             * 添加消息表情回复
             *
             * 给指定消息添加指定类型的表情回复（reaction即表情回复，本文档统一用“reaction”代称）。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 待添加reaction的消息要真实存在，不能被撤回;- 给消息添加reaction，需要reaction的发送方（机器人或者用户）在消息所在的会话内
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete document }
             *
             * 删除消息表情回复
             *
             * 删除指定消息的表情回复（reaction即表情回复，本文档统一用“reaction”代称）。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能删除真实存在的reaction，并且删除reaction请求的操作者必须是reaction的原始添加者
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list document }
             *
             * 获取消息表情回复
             *
             * 获取指定消息的特定类型表情回复列表（reaction即表情回复，本文档统一用“reaction”代称）。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 待获取reaction信息的消息要真实存在，不能被撤回;- 获取消息的reaction，需要request的授权主体（机器人或者用户）在消息所在的会话内
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * message.resource
           */
          messageResource: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.resource&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get document }
             *
             * 获取消息中的资源文件
             *
             * 获取消息中的资源文件，包括音频，视频，图片和文件，**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            })
          },
          /**
           * 消息 - Pin
           */
          pin: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create document }
             *
             * Pin消息
             *
             * Pin一条指定的消息。
             *
             * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- Pin消息时，机器人必须在对应的群组中;- 若消息已经被Pin，返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS==
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete document }
             *
             * 移除Pin消息
             *
             * 移除一条指定消息的Pin。
             *
             * 注意事项：;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 移除Pin消息时，机器人必须在对应的群组中;- 若消息未被Pin或已被撤回，返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS==
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/pins/:message_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list document }
             *
             * 获取群内Pin消息
             *
             * 获取所在群内指定时间范围内的所有Pin消息。
             *
             * 注意事项：;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 获取Pin消息时，机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS==
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * thread
           */
          thread: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=im&resource=thread&apiName=forward&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=thread&version=v1 document }
             *
             * 转发
             */
            forward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 消息 - 批量消息
             */
            batchMessage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/delete document }
               *
               * 批量撤回消息
               *
               * 批量撤回通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口发送的消息。
               *
               * 注意事项：;- 应用需要启用[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 撤回单条发送的消息请使用[撤回消息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete)接口;- 不支持撤回发出时间超过1天的消息;- 一次调用涉及大量消息，所以为异步接口，会有一定延迟。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=get_progress&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/get_progress document }
               *
               * 查询批量消息整体进度
               *
               * 该接口在[查询批量消息推送和阅读人数](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user)查询结果的基础上，增加了批量请求中有效的userid数量以及消息撤回进度数据。
               *
               * 注意事项:;* 该接口返回的数据为查询时刻的快照数据
               */
              getProgress: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=batch_message&apiName=read_user&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/batch_message/read_user document }
               *
               * 查询批量消息推送和阅读人数
               *
               * 批量发送消息后，可以通过该接口查询批量消息推送的总人数和阅读人数。
               *
               * 注意事项：;- 只能查询通过[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)接口产生的消息;- 该接口返回的数据为查询时刻的快照数据
               */
              readUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组 - 群公告
             */
            chatAnnouncement: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.announcement&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/get document }
               *
               * 获取群公告信息
               *
               * 获取会话中的群公告信息，公告信息格式与[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 获取内部群信息时，操作者须与群组在同一租户下
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.announcement&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-announcement/patch document }
               *
               * 更新群公告信息
               *
               * 更新会话中的群公告信息，更新公告信息的格式和更新[云文档](https://open.feishu.cn/document/ukTMukTMukTM/uAzM5YjLwMTO24CMzkjN)格式相同。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作者需要拥有群公告文档的阅读权限;- 获取内部群信息时，操作者须与群组在同一租户下;- 若群开启了 ==仅群主和群管理员可编辑群信息== 配置，群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可更新群公告;- 若群未开启 ==仅群主和群管理员可编辑群信息== 配置，所有成员可以更新群公告
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组
             */
            chat: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/create document }
               *
               * 创建群
               *
               * 创建群并设置群头像、群名、群描述等。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 本接口支持在创建群的同时拉用户或机器人进群；如果仅需要拉用户或者机器人入群参考 [将用户或机器人拉入群聊](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create)接口
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/delete document }
               *
               * 解散群
               *
               * 解散群组。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 如果使用tenant_access_token，需要机器人符合以下任一情况才可解散群：;    - 机器人是群主;    - 机器人是群的创建者且具备==更新应用所创建群的群信息==权限;- 如果使用user_access_token，需要对应的用户是群主才可解散群
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get document }
               *
               * 获取群信息
               *
               * 获取群名称、群描述、群头像、群主 ID 等群基本信息。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群里（否则只会返回群名称、群头像等基本信息）;- 获取内部群信息时，操作者须与群组在同一租户下
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=link&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/link document }
               *
               * 获取群分享链接
               *
               * 获取指定群的分享链接。
               *
               * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - access_token所对应的 **机器人** 或 **授权用户** 必须在`chat_id`参数指定的群组中;- 单聊、密聊、团队群不支持分享群链接;- 当Bot被停用或Bot退出群组时，Bot生成的群链接也将停用;- 当群聊开启了 ==仅群主和群管理员可添加群成员/分享群== 设置时，仅**群主**和**群管理员**可以获取群分享链接;- 获取内部群分享链接时，操作者须与群组在同一租户下
               */
              link: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list document }
               *
               * 获取用户或机器人所在的群列表
               *
               * 获取用户或者机器人所在群列表。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 请注意区分本接口和[获取群信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/get)的请求 URL;- 获取的群列表不包含P2P单聊
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/search`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/search document }
               *
               * 搜索对用户或机器人可见的群列表
               *
               * 搜索对用户或机器人可见的群列表，包括：用户或机器人所在的群、对用户或机器人公开的群。;搜索可获得的群信息包括：群ID（chat_id）、群名称、群描述等。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/search`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/update document }
               *
               * 更新群信息
               *
               * 更新群头像、群名称、群描述、群配置、转让群主等。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 对于群主/群管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可更新所有信息;- 对于不满足上述权限条件的群成员或机器人：;    - 若未开启 ==仅群主和群管理员可编辑群信息== 配置，仅可更新群头像、群名称、群描述、群国际化名称信息;    - 若开启了 ==仅群主和群管理员可编辑群信息== 配置，任何群信息都不能修改;- 如果同时更新 ==邀请用户或机器人入群权限== 和 ==群分享权限== 这两项设置需要满足以下条件：;    - 若未开启 ==仅群主和管理员可以邀请用户或机器人入群==，需要设置 ==群分享权限== 为 ==允许分享==;    - 若开启了 ==仅群主和管理员可以邀请用户或机器人入群==，需要设置 ==群分享权限== 为 ==不允许分享==
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组 - 群成员
             */
            chatManagers: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.managers&apiName=add_managers&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/add_managers document }
               *
               * 指定群管理员
               *
               * 将用户或机器人指定为群管理员。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以指定群管理员
               */
              addManagers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.managers&apiName=delete_managers&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-managers/delete_managers document }
               *
               * 删除群管理员
               *
               * 删除指定的群管理员（用户或机器人）。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 仅有群主可以删除群管理员
               */
              deleteManagers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组 - 群成员
             */
            chatMembers: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/create document }
               *
               * 将用户或机器人拉入群聊
               *
               * 将用户或机器人拉入群聊。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 如需拉用户进群，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability); - 机器人或授权用户必须在群组中;- 外部租户不能被加入到内部群中;- 操作内部群时，操作者须与群组在同一租户下; - 在开启 ==仅群主和群管理员可添加群成员== 的设置时，仅有群主/管理员 或 创建群组且具备 ==更新应用所创建群的群信息== 权限的机器人，可以拉用户或者机器人进群; - 在未开启 ==仅群主和群管理员可添加群成员== 的设置时，所有群成员都可以拉用户或机器人进群
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/delete document }
               *
               * 将用户或机器人移出群聊
               *
               * 将用户或机器人移出群聊。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 用户或机器人在任何条件下均可移除自己出群（即主动退群）;- 仅有群主/管理员 或 创建群组并且具备 ==更新应用所创建群的群信息== 权限的机器人，可以移除其他用户或者机器人;- 每次请求，最多移除50个用户或者5个机器人;- 操作内部群时，操作者须与群组在同一租户下
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/get document }
               *
               * 获取群成员列表
               *
               * 获取用户/机器人所在群的群成员列表。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中; - 该接口不会返回群内的机器人成员; - 由于返回的群成员列表会过滤掉机器人成员，因此返回的群成员个数可能会小于指定的page_size; - 如果有同一时间加入群的群成员，会一次性返回，这会导致返回的群成员个数可能会大于指定的page_size;- 获取内部群信息时，操作者须与群组在同一租户下
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=is_in_chat&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/is_in_chat document }
               *
               * 判断用户或机器人是否在群里
               *
               * 根据使用的access_token判断对应的用户或者机器人是否在群里。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 获取内部群信息时，操作者须与群组在同一租户下
               */
              isInChat: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.members&apiName=me_join&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-members/me_join document }
               *
               * 用户或机器人主动加入群聊
               *
               * 用户或机器人主动加入群聊。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 目前仅支持加入公开群;- 操作内部群时，操作者须与群组在同一租户下
               */
              meJoin: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat.menu_item
             */
            chatMenuItem: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_item&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch document }
               *
               * 修改群菜单元信息
               *
               * 修改某个一级菜单或者二级菜单的元信息。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组 - 群菜单
             */
            chatMenuTree: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create document }
               *
               * 添加群菜单
               *
               * 向群内添加群菜单。
               *
               * 注意事项：;- 该API是向群内追加菜单，群内原来存在的菜单并不会被覆盖。操作API后，将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内，一级菜单最多有3个，每个一级菜单最多有5个二级菜单。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete document }
               *
               * 删除群菜单。
               *
               * 删除群内菜单。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后，将返回群内所有菜单。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get document }
               *
               * 获取群内菜单
               *
               * 通过群ID获取群内菜单。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=sort&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort document }
               *
               * 排序群菜单
               *
               * 给一个群内的一级菜单排序。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后，将返回群内所有菜单。
               */
              sort: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat.moderation
             */
            chatModeration: {
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.moderation&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/get document }
               *
               * 获取群成员发言权限
               *
               * 获取群发言模式、可发言用户名单等
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人 或 授权用户 必须在群里
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.moderation&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-moderation/update document }
               *
               * 更新群发言权限
               *
               * 更新群组的发言权限设置，可设置为全员可发言、仅管理员可发言  或 指定用户可发言。
               *
               * 注意事项：; - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以用户授权调用接口，**当授权用户是群主**时，可更新群发言权限;- 若以租户授权调用接口(即以机器人身份调用接口)，当**机器人是群主** 或者 **机器人是群组创建者、具备==更新应用所创建群的群信息==权限且仍在群内**时，可更新群发言权限
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 群组 - 会话标签页
             */
            chatTab: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/create document }
               *
               * 添加会话标签页
               *
               * 添加自定义会话标签页。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许添加类型为`doc`和`url`的会话标签页;- 添加doc类型时，操作者（access token对应的身份）需要拥有对应文档的权限;- tab_config字段当前只对`url`类型的会话标签页生效;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以添加会话标签页;- 操作内部群时，操作者须与群组在同一租户下
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=delete_tabs&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/delete_tabs document }
               *
               * 删除会话标签页
               *
               * 删除会话标签页。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许删除类型为`doc`和`url`的会话标签页;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以删除会话标签页;- 操作内部群时，操作者须与群组在同一租户下
               */
              deleteTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=list_tabs&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/list_tabs document }
               *
               * 拉取会话标签页
               *
               * 拉取会话标签页。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 操作内部群时，操作者须与群组在同一租户下
               */
              listTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=sort_tabs&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/sort_tabs document }
               *
               * 会话标签页排序
               *
               * 会话标签页排序。
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 消息标签页强制固定为第一顺位，不参与排序，但是请求体中必须包含该标签页的Tab ID;- 操作内部群时，操作者须与群组在同一租户下
               */
              sortTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.tab&apiName=update_tabs&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-tab/update_tabs document }
               *
               * 更新会话标签页
               *
               * 更新会话标签页
               *
               * 注意事项：;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人或授权用户必须在群里;- 只允许更新类型为`doc`和`url`的会话标签页;- 更新doc类型时，操作者（access token对应的身份）需要拥有对应文档的权限;- 在开启 ==仅群主和管理员可管理标签页== 的设置时，仅群主和群管理员可以更新会话标签页;- 操作内部群时，操作者须与群组在同一租户下
               */
              updateTabs: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat.top_notice
             */
            chatTopNotice: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.top_notice&apiName=delete_top_notice&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/delete_top_notice document }
               *
               * 撤销群置顶
               *
               * 撤销会话中的置顶。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 撤销内部群置顶时，操作者须与群组在同一租户下
               */
              deleteTopNotice: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.top_notice&apiName=put_top_notice&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-top_notice/put_top_notice document }
               *
               * 更新群置顶
               *
               * 更新会话中的群置顶信息，可以将群中的某一条消息，或者群公告置顶显示。
               *
               * 注意事项：; - 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability); - 机器人或授权用户必须在群组中;- 更新内部群置顶时，操作者须与群组在同一租户下
               */
              putTopNotice: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 消息 - 文件信息
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=file&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create document }
               *
               * 上传文件
               *
               * 上传文件，可以上传视频，音频和常见的文件类型。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M，且不允许上传空文件
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/files`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=file&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get document }
               *
               * 下载文件
               *
               * 下载文件接口，只能下载应用自己上传的文件。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源，请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header，发起请求的时候需要在header中设置Content-Type为application/json
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/files/:file_key`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 消息 - 图片信息
             */
            image: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=image&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/create document }
               *
               * 上传图片
               *
               * 上传图片接口，支持上传 JPEG、PNG、WEBP、GIF、TIFF、BMP、ICO格式图片。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 图片大小不得超过10M，且不支持上传大小为0的图片
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/images`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=image&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/image/get document }
               *
               * 下载图片
               *
               * 下载图片资源，只能下载当前应用所上传且图片类型为message的图片。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传且图片类型为message的图片，avatar类型暂不支持下载;- 下载用户发送的资源，请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/images/:image_key`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 消息加急
             */
            message: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create document }
               *
               * 发送消息
               *
               * 给指定用户或者会话发送消息，支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 给用户发送消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息，需要机器人在群组中
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete document }
               *
               * 撤回消息
               *
               * 机器人撤回机器人自己发送的消息或群主撤回群内消息。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ，撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内，自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息，则机器人必须是该群的群主、管理员 或者 创建者，且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=forward&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 document }
               *
               * 转发一条消息
               */
              forward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get document }
               *
               * 获取指定消息的内容
               *
               * 通过 message_id 查询消息内容。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 机器人必须在群组中
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list document }
               *
               * 获取会话历史消息
               *
               * 获取会话（包括单聊、群组）的历史消息（聊天记录）。
               *
               * - 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 获取消息时，机器人必须在群组中
               *
               * 接口级别权限默认只能获取单聊（p2p）消息，如果需要获取群组（group）消息，应用还必须拥有 **==获取群组中所有消息==** 权限
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=merge_forward&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 document }
               *
               * 合并转发多条消息
               */
              mergeForward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/merge_forward`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch document }
               *
               * 更新应用发送的消息
               *
               * 更新应用已发送的消息卡片内容。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息，该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息，需在卡片的config属性中，显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB；卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS**
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=push_follow_up&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=push_follow_up&project=im&resource=message&version=v1 document }
               */
              pushFollowUp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=read_users&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users document }
               *
               * 查询消息已读信息
               *
               * 查询消息的已读信息。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能查询机器人自己发送，且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息
               */
              readUsers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=reply&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply document }
               *
               * 回复消息
               *
               * 回复指定消息，支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 回复私聊消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息，需要机器人在群中
               */
              reply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 document }
               *
               * 编辑已发送的消息内容，当前仅支持编辑文本和富文本消息。
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_app&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app document }
               *
               * 发送应用内加急
               *
               * 对指定消息进行应用内加急。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急（用户未读的加急上限为200条）
               *
               * 特别说明：;- 默认接口限流为50 QPS，请谨慎调用
               */
              urgentApp: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_phone&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone document }
               *
               * 发送电话加急
               *
               * 对指定消息进行应用内加急与电话加急。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急（用户未读的加急上限为200条）
               *
               * 特别说明：;- 通过接口产生的电话加急将消耗企业的加急额度，请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS，请谨慎调用
               */
              urgentPhone: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=urgent_sms&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms document }
               *
               * 发送短信加急
               *
               * 对指定消息进行应用内加急与短信加急。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急（用户未读的加急上限为200条）
               *
               * 特别说明：;- 通过接口产生的短信加急将消耗企业的加急额度，请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS，请谨慎调用
               */
              urgentSms: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create document }
               *
               * 通过模版消息卡片发送消息
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 给用户发送消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息，需要机器人在群组中
               */
              createByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
                const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                  type: "template",
                  data: {
                    template_id,
                    template_variable
                  }
                }) }, rest);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages`, path2),
                  method: "POST",
                  data: targetData,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=reply&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply document }
               *
               * 通过模版消息卡片回复消息
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 回复私聊消息，需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息，需要机器人在群中
               */
              replyByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
                const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                  type: "template",
                  data: {
                    template_id,
                    template_variable
                  }
                }) }, rest);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`, path2),
                  method: "POST",
                  data: targetData,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 document }
               *
               * 通过模版消息卡片
               */
              updateByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const { template_id, template_variable } = data, rest = __rest(data, ["template_id", "template_variable"]);
                const targetData = Object.assign({ msg_type: "interactive", content: JSON.stringify({
                  type: "template",
                  data: {
                    template_id,
                    template_variable
                  }
                }) }, rest);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id`, path2),
                  method: "PUT",
                  data: targetData,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 消息 - 表情回复
             */
            messageReaction: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/create document }
               *
               * 添加消息表情回复
               *
               * 给指定消息添加指定类型的表情回复（reaction即表情回复，本文档统一用“reaction”代称）。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 待添加reaction的消息要真实存在，不能被撤回;- 给消息添加reaction，需要reaction的发送方（机器人或者用户）在消息所在的会话内
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/delete document }
               *
               * 删除消息表情回复
               *
               * 删除指定消息的表情回复（reaction即表情回复，本文档统一用“reaction”代称）。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 只能删除真实存在的reaction，并且删除reaction请求的操作者必须是reaction的原始添加者
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.reaction&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-reaction/list document }
               *
               * 获取消息表情回复
               *
               * 获取指定消息的特定类型表情回复列表（reaction即表情回复，本文档统一用“reaction”代称）。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 待获取reaction信息的消息要真实存在，不能被撤回;- 获取消息的reaction，需要request的授权主体（机器人或者用户）在消息所在的会话内
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * message.resource
             */
            messageResource: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=message.resource&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get document }
               *
               * 获取消息中的资源文件
               *
               * 获取消息中的资源文件，包括音频，视频，图片和文件，**暂不支持表情包资源下载**。当前仅支持 100M 以内的资源文件的下载。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 机器人和消息需要在同一会话中;- 暂不支持获取合并转发消息中的子消息的资源文件
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            },
            /**
             * 消息 - Pin
             */
            pin: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/create document }
               *
               * Pin消息
               *
               * Pin一条指定的消息。
               *
               * 注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- Pin消息时，机器人必须在对应的群组中;- 若消息已经被Pin，返回该Pin的操作信息;- 不能Pin一条对操作者不可见的消息;- 对同一条消息的Pin操作不能超过==5 QPS==
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/delete document }
               *
               * 移除Pin消息
               *
               * 移除一条指定消息的Pin。
               *
               * 注意事项：;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 移除Pin消息时，机器人必须在对应的群组中;- 若消息未被Pin或已被撤回，返回成功信息;- 不能移除一条对操作者不可见的Pin消息;- 对同一条消息移除Pin的操作不能超过==5 QPS==
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/pins/:message_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=pin&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/pin/list document }
               *
               * 获取群内Pin消息
               *
               * 获取所在群内指定时间范围内的所有Pin消息。
               *
               * 注意事项：;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)  ;- 获取Pin消息时，机器人必须在群组中;- 获取的Pin消息按Pin的创建时间降序排列;- 接口默认限流为==50 QPS==
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/pins`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * thread
             */
            thread: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=thread&apiName=forward&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=thread&version=v1 document }
               *
               * 转发
               */
              forward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * app_feed_card.batch
             */
            appFeedCardBatch: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=app_feed_card.batch&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=im&resource=app_feed_card.batch&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/app_feed_card/batch`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=app_feed_card.batch&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=app_feed_card.batch&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/app_feed_card/batch`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * app_feed_card
             */
            appFeedCard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=app_feed_card&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=im&resource=app_feed_card&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/app_feed_card`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * biz_entity_tag_relation
             */
            bizEntityTagRelation: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=biz_entity_tag_relation&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=im&resource=biz_entity_tag_relation&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=biz_entity_tag_relation&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=im&resource=biz_entity_tag_relation&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=biz_entity_tag_relation&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=biz_entity_tag_relation&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * chat_button
             */
            chatButton: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat_button&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=chat_button&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/chat_button`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * feed_card
             */
            feedCard: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=feed_card&apiName=bot_time_sentive&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=bot_time_sentive&project=im&resource=feed_card&version=v2 document }
               */
              botTimeSentive: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=feed_card&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=im&resource=feed_card&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * tag
             */
            tag: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=tag&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=im&resource=tag&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/tags`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=tag&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=im&resource=tag&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/tags/:tag_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * url_preview
             */
            urlPreview: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=im&resource=url_preview&apiName=batch_update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_update&project=im&resource=url_preview&version=v2 document }
               */
              batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/im/v2/url_previews/batch_update`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$u = class extends Client$v {
      constructor() {
        super(...arguments);
        this.lingo = {
          v1: {
            /**
             * classification
             */
            classification: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/lingo/v1/classifications`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=classification&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=classification&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/classifications`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * draft
             */
            draft: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=draft&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=draft&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/drafts`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=draft&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=draft&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * entity
             */
            entity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=lingo&resource=entity&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=lingo&resource=entity&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=lingo&resource=entity&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=highlight&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=highlight&project=lingo&resource=entity&version=v1 document }
               */
              highlight: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/highlight`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=entity&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=match&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=match&project=lingo&resource=entity&version=v1 document }
               */
              match: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/match`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=lingo&resource=entity&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=entity&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=lingo&resource=entity&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * file
             */
            file: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=file&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download&project=lingo&resource=file&version=v1 document }
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=file&apiName=upload&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=lingo&resource=file&version=v1 document }
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/files/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * repo
             */
            repo: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=lingo&resource=repo&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=lingo&resource=repo&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/lingo/v1/repos`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$t = class extends Client$u {
      constructor() {
        super(...arguments);
        this.mail = {
          /**
           * 邮件组别名
           */
          mailgroupAlias: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create document }
             *
             * 创建邮件组别名
             *
             * 创建邮件组别名
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete document }
             *
             * 删除邮件组别名
             *
             * 删除邮件组别名
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list document }
             *
             * 获取邮件组所有别名
             *
             * 获取邮件组所有别名
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 邮件组
           */
          mailgroup: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create document }
             *
             * 创建邮件组
             *
             * 创建一个邮件组
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete document }
             *
             * 删除邮件组
             *
             * 删除一个邮件组
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get document }
             *
             * 获取邮件组
             *
             * 获取特定邮件组信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list document }
             *
             * 批量获取邮件组
             *
             * 分页批量获取邮件组
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch document }
             *
             * 修改邮件组
             *
             * 更新邮件组部分字段，没有填写的字段不会被更新
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update document }
             *
             * 更新邮件组
             *
             * 更新邮件组所有信息
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 邮件组管理员
           */
          mailgroupManager: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create document }
             *
             * 批量创建邮件组管理员
             *
             * 批量创建邮件组管理员
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete document }
             *
             * 批量删除邮件组管理员
             *
             * 批量删除邮件组管理员
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list document }
             *
             * 批量获取邮件组管理员
             *
             * 批量获取邮件组管理员
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 邮件组成员
           */
          mailgroupMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 document }
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create document }
             *
             * 创建邮件组成员
             *
             * 向邮件组添加单个成员
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete document }
             *
             * 删除邮件组成员
             *
             * 删除邮件组单个成员
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get document }
             *
             * 获取邮件组成员信息
             *
             * 获取邮件组单个成员信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list document }
             *
             * 批量获取邮件组成员
             *
             * 分页批量获取邮件组成员列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 邮件组权限成员
           */
          mailgroupPermissionMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 document }
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create document }
             *
             * 创建邮件组权限成员
             *
             * 向邮件组添加单个自定义权限成员，添加后该成员可发送邮件到该邮件组
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete document }
             *
             * 删除邮件组权限成员
             *
             * 从自定义成员中删除单个成员，删除后该成员无法发送邮件到该邮件组
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get document }
             *
             * 获取邮件组权限成员
             *
             * 获取邮件组单个权限成员信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list document }
             *
             * 批量获取邮件组权限成员
             *
             * 分页批量获取邮件组权限成员列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 公共邮箱别名
           */
          publicMailboxAlias: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create document }
             *
             * 创建公共邮箱别名
             *
             * 创建公共邮箱别名
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete document }
             *
             * 删除公共邮箱别名
             *
             * 删除公共邮箱别名
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list document }
             *
             * 获取所有公共邮箱别名
             *
             * 获取所有公共邮箱别名
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 公共邮箱
           */
          publicMailbox: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create document }
             *
             * 创建公共邮箱
             *
             * 创建一个公共邮箱
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete document }
             *
             * 释放公共邮箱地址
             *
             * 该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址，一旦删除，该邮箱地址将无法恢复。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get document }
             *
             * 获取公共邮箱
             *
             * 获取公共邮箱信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list document }
             *
             * 批量获取公共邮箱
             *
             * 分页批量获取公共邮箱列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch document }
             *
             * 修改公共邮箱
             *
             * 更新公共邮箱部分字段，没有填写的字段不会被更新
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=remove_to_recycle_bin&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_to_recycle_bin&project=mail&resource=public_mailbox&version=v1 document }
             */
            removeToRecycleBin: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update document }
             *
             * 更新公共邮箱
             *
             * 更新公共邮箱所有信息
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 公共邮箱成员
           */
          publicMailboxMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 document }
             */
            batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 document }
             */
            batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=clear&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear document }
             *
             * 清空公共邮箱成员
             *
             * 删除公共邮箱所有成员
             */
            clear: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create document }
             *
             * 创建公共邮箱成员
             *
             * 向公共邮箱添加单个成员
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete document }
             *
             * 删除公共邮箱成员
             *
             * 删除公共邮箱单个成员
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get document }
             *
             * 获取公共邮箱成员信息
             *
             * 获取公共邮箱单个成员信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list document }
             *
             * 批量获取公共邮箱成员
             *
             * 分页批量获取公共邮箱成员列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 邮箱地址
           */
          user: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query document }
             *
             * 邮箱状态查询
             *
             * 使用邮箱状态查询接口，可以输入邮箱地址，查询出该邮箱地址对应的类型以及状态
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/users/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户邮箱别名
           */
          userMailboxAlias: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create document }
             *
             * 创建用户邮箱别名
             *
             * 创建用户邮箱别名
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete document }
             *
             * 删除用户邮箱别名
             *
             * 删除用户邮箱别名
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list document }
             *
             * 获取用户邮箱所有别名
             *
             * 获取用户邮箱所有别名
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户邮箱
           */
          userMailbox: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete document }
             *
             * 释放用户邮箱地址
             *
             * 该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址，一旦删除，将无法恢复。该接口支持邮件的转移，可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.event
           */
          userMailboxEvent: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=subscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=subscribe&project=mail&resource=user_mailbox.event&version=v1 document }
             */
            subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=subscription&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=subscription&project=mail&resource=user_mailbox.event&version=v1 document }
             */
            subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=unsubscribe&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=unsubscribe&project=mail&resource=user_mailbox.event&version=v1 document }
             */
            unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.folder
           */
          userMailboxFolder: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.folder&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.folder&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.folder&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=mail&resource=user_mailbox.folder&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.mail_contact
           */
          userMailboxMailContact: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.message.attachment
           */
          userMailboxMessageAttachment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message.attachment&apiName=download_url&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download_url&project=mail&resource=user_mailbox.message.attachment&version=v1 document }
             */
            downloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.message
           */
          userMailboxMessage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=mail&resource=user_mailbox.message&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=get_by_card&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_card&project=mail&resource=user_mailbox.message&version=v1 document }
             *
             * 卡片ID获取邮件ID
             */
            getByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.message&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=send&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=send&project=mail&resource=user_mailbox.message&version=v1 document }
             */
            send: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * user_mailbox.rule
           */
          userMailboxRule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.rule&version=v1 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.rule&version=v1 document }
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.rule&version=v1 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=reorder&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reorder&project=mail&resource=user_mailbox.rule&version=v1 document }
             */
            reorder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=mail&resource=user_mailbox.rule&version=v1 document }
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 邮件组别名
             */
            mailgroupAlias: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/create document }
               *
               * 创建邮件组别名
               *
               * 创建邮件组别名
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/delete document }
               *
               * 删除邮件组别名
               *
               * 删除邮件组别名
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.alias&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-alias/list document }
               *
               * 获取邮件组所有别名
               *
               * 获取邮件组所有别名
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 邮件组
             */
            mailgroup: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/create document }
               *
               * 创建邮件组
               *
               * 创建一个邮件组
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/delete document }
               *
               * 删除邮件组
               *
               * 删除一个邮件组
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/get document }
               *
               * 获取邮件组
               *
               * 获取特定邮件组信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/list document }
               *
               * 批量获取邮件组
               *
               * 分页批量获取邮件组
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/patch document }
               *
               * 修改邮件组
               *
               * 更新邮件组部分字段，没有填写的字段不会被更新
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup/update document }
               *
               * 更新邮件组
               *
               * 更新邮件组所有信息
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 邮件组管理员
             */
            mailgroupManager: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_create document }
               *
               * 批量创建邮件组管理员
               *
               * 批量创建邮件组管理员
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/batch_delete document }
               *
               * 批量删除邮件组管理员
               *
               * 批量删除邮件组管理员
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.manager&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-manager/list document }
               *
               * 批量获取邮件组管理员
               *
               * 批量获取邮件组管理员
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 邮件组成员
             */
            mailgroupMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/create document }
               *
               * 创建邮件组成员
               *
               * 向邮件组添加单个成员
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/delete document }
               *
               * 删除邮件组成员
               *
               * 删除邮件组单个成员
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/get document }
               *
               * 获取邮件组成员信息
               *
               * 获取邮件组单个成员信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list document }
               *
               * 批量获取邮件组成员
               *
               * 分页批量获取邮件组成员列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 邮件组权限成员
             */
            mailgroupPermissionMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/create document }
               *
               * 创建邮件组权限成员
               *
               * 向邮件组添加单个自定义权限成员，添加后该成员可发送邮件到该邮件组
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/delete document }
               *
               * 删除邮件组权限成员
               *
               * 从自定义成员中删除单个成员，删除后该成员无法发送邮件到该邮件组
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/get document }
               *
               * 获取邮件组权限成员
               *
               * 获取邮件组单个权限成员信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-permission_member/list document }
               *
               * 批量获取邮件组权限成员
               *
               * 分页批量获取邮件组权限成员列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 公共邮箱别名
             */
            publicMailboxAlias: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/create document }
               *
               * 创建公共邮箱别名
               *
               * 创建公共邮箱别名
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/delete document }
               *
               * 删除公共邮箱别名
               *
               * 删除公共邮箱别名
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.alias&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-alias/list document }
               *
               * 获取所有公共邮箱别名
               *
               * 获取所有公共邮箱别名
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 公共邮箱
             */
            publicMailbox: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/create document }
               *
               * 创建公共邮箱
               *
               * 创建一个公共邮箱
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/delete document }
               *
               * 释放公共邮箱地址
               *
               * 该接口会永久删除公共邮箱地址。可用于释放邮箱回收站的公共邮箱地址，一旦删除，该邮箱地址将无法恢复。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/get document }
               *
               * 获取公共邮箱
               *
               * 获取公共邮箱信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/list document }
               *
               * 批量获取公共邮箱
               *
               * 分页批量获取公共邮箱列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/patch document }
               *
               * 修改公共邮箱
               *
               * 更新公共邮箱部分字段，没有填写的字段不会被更新
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=remove_to_recycle_bin&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_to_recycle_bin&project=mail&resource=public_mailbox&version=v1 document }
               */
              removeToRecycleBin: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox/update document }
               *
               * 更新公共邮箱
               *
               * 更新公共邮箱所有信息
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 公共邮箱成员
             */
            publicMailboxMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 document }
               */
              batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 document }
               */
              batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=clear&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/clear document }
               *
               * 清空公共邮箱成员
               *
               * 删除公共邮箱所有成员
               */
              clear: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/create document }
               *
               * 创建公共邮箱成员
               *
               * 向公共邮箱添加单个成员
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/delete document }
               *
               * 删除公共邮箱成员
               *
               * 删除公共邮箱单个成员
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/get document }
               *
               * 获取公共邮箱成员信息
               *
               * 获取公共邮箱单个成员信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/public_mailbox-member/list document }
               *
               * 批量获取公共邮箱成员
               *
               * 分页批量获取公共邮箱成员列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 邮箱地址
             */
            user: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user/query document }
               *
               * 邮箱状态查询
               *
               * 使用邮箱状态查询接口，可以输入邮箱地址，查询出该邮箱地址对应的类型以及状态
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/users/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户邮箱别名
             */
            userMailboxAlias: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/create document }
               *
               * 创建用户邮箱别名
               *
               * 创建用户邮箱别名
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/delete document }
               *
               * 删除用户邮箱别名
               *
               * 删除用户邮箱别名
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.alias&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-alias/list document }
               *
               * 获取用户邮箱所有别名
               *
               * 获取用户邮箱所有别名
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户邮箱
             */
            userMailbox: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox/delete document }
               *
               * 释放用户邮箱地址
               *
               * 该接口会永久删除用户邮箱地址。可用于删除位于邮箱回收站中的用户邮箱地址，一旦删除，将无法恢复。该接口支持邮件的转移，可以将被释放邮箱的邮件转移到另外一个可以使用的邮箱中。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.event
             */
            userMailboxEvent: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=subscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=subscribe&project=mail&resource=user_mailbox.event&version=v1 document }
               */
              subscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=subscription&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=subscription&project=mail&resource=user_mailbox.event&version=v1 document }
               */
              subscription: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.event&apiName=unsubscribe&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=unsubscribe&project=mail&resource=user_mailbox.event&version=v1 document }
               */
              unsubscribe: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.folder
             */
            userMailboxFolder: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.folder&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.folder&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.folder&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.folder&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=mail&resource=user_mailbox.folder&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.mail_contact
             */
            userMailboxMailContact: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.mail_contact&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=mail&resource=user_mailbox.mail_contact&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.message.attachment
             */
            userMailboxMessageAttachment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message.attachment&apiName=download_url&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=download_url&project=mail&resource=user_mailbox.message.attachment&version=v1 document }
               */
              downloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.message
             */
            userMailboxMessage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=mail&resource=user_mailbox.message&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=get_by_card&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get_by_card&project=mail&resource=user_mailbox.message&version=v1 document }
               *
               * 卡片ID获取邮件ID
               */
              getByCard: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.message&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.message&apiName=send&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=send&project=mail&resource=user_mailbox.message&version=v1 document }
               */
              send: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_mailbox.rule
             */
            userMailboxRule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=mail&resource=user_mailbox.rule&version=v1 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=mail&resource=user_mailbox.rule&version=v1 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mail&resource=user_mailbox.rule&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=reorder&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=reorder&project=mail&resource=user_mailbox.rule&version=v1 document }
               */
              reorder: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mail&resource=user_mailbox.rule&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=mail&resource=user_mailbox.rule&version=v1 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$s = class extends Client$t {
      constructor() {
        super(...arguments);
        this.mdm = {
          /**
           * 数据维度
           */
          userAuthDataRelation: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=user_auth_data_relation&apiName=bind&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind document }
             *
             * 用户数据维度绑定
             *
             * 通过该接口，可为指定应用下的用户绑定一类数据维度，支持批量给多个用户同时增量授权。
             */
            bind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=user_auth_data_relation&apiName=unbind&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind document }
             *
             * 用户数据维度解绑
             *
             * 通过该接口，可为指定应用下的指定用户解除一类数据维度。
             */
            unbind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 数据维度
             */
            userAuthDataRelation: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=user_auth_data_relation&apiName=bind&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/bind document }
               *
               * 用户数据维度绑定
               *
               * 通过该接口，可为指定应用下的用户绑定一类数据维度，支持批量给多个用户同时增量授权。
               */
              bind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=user_auth_data_relation&apiName=unbind&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/mdm-v1/user_auth_data_relation/unbind document }
               *
               * 用户数据维度解绑
               *
               * 通过该接口，可为指定应用下的指定用户解除一类数据维度。
               */
              unbind: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v3: {
            /**
             * batch_country_region
             */
            batchCountryRegion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=batch_country_region&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=mdm&resource=batch_country_region&version=v3 document }
               *
               * 查询国家 / 地区
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mdm/v3/batch_country_region`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * country_region
             */
            countryRegion: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=country_region&apiName=list&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mdm&resource=country_region&version=v3 document }
               *
               * 搜索国家 / 地区
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/mdm/v3/country_regions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$r = class extends Client$s {
      constructor() {
        super(...arguments);
        this.meeting_room = {};
      }
    };
    var Client$q = class extends Client$r {
      constructor() {
        super(...arguments);
        this.minutes = {
          v1: {
            /**
             * minute
             */
            minute: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=minutes&resource=minute&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=minutes&resource=minute&version=v1 document }
               *
               * 获取妙记的基础概括信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * minute.media
             */
            minuteMedia: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=minutes&resource=minute.media&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=minutes&resource=minute.media&version=v1 document }
               *
               * 获取妙记的音视频文件
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * minute.statistics
             */
            minuteStatistics: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=minutes&resource=minute.statistics&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=minutes&resource=minute.statistics&version=v1 document }
               *
               * 获取妙记的访问统计数据
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * minute.transcript
             */
            minuteTranscript: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=minutes&resource=minute.transcript&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=minutes&resource=minute.transcript&version=v1 document }
               *
               * 获取妙记的对话文本，成功时返回文件二进制流
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              })
            }
          }
        };
      }
    };
    var Client$p = class extends Client$q {
      constructor() {
        super(...arguments);
        this.moments = {
          /**
           * post
           */
          post: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=moments&resource=post&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=moments&resource=post&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/moments/v1/posts/:post_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * post
             */
            post: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=moments&resource=post&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=moments&resource=post&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/moments/v1/posts/:post_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$o = class extends Client$p {
      constructor() {
        super(...arguments);
        this.okr = {
          /**
           * 图片
           */
          image: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=image&apiName=upload&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload document }
             *
             * 上传图片
             *
             * 上传图片
             */
            upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/images/upload`, path2),
                method: "POST",
                data,
                params,
                headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              return (res === null || res === void 0 ? void 0 : res.data) || null;
            })
          },
          /**
           * OKR
           */
          okr: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=okr&apiName=batch_get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get document }
             *
             * 批量获取OKR
             *
             * 根据OKR id批量获取OKR
             *
             * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
             */
            batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/okrs/batch_get`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * OKR周期
           */
          period: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/create document }
             *
             * 创建 OKR 周期
             *
             * 根据周期规则创建一个 OKR 周期
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list document }
             *
             * 获取OKR周期列表
             *
             * 获取OKR周期列表
             *
             * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/patch document }
             *
             * 修改 OKR 周期状态
             *
             * 修改某个 OKR 周期的状态为「正常」、「失效」或「隐藏」，对租户所有人生效，请谨慎操作
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods/:period_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 周期规则
           */
          periodRule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period_rule&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period_rule/list document }
             *
             * 获取 OKR 周期规则
             *
             * 获取租户的周期规则列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/period_rules`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * OKR进展记录
           */
          progressRecord: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create document }
             *
             * 创建OKR进展记录
             *
             * 创建OKR进展记录
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete document }
             *
             * 删除OKR进展记录
             *
             * 根据ID删除OKR进展记录
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get document }
             *
             * 获取OKR进展记录
             *
             * 根据ID获取OKR进展记录详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update document }
             *
             * 更新OKR进展记录
             *
             * 根据OKR进展记录ID更新进展详情
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 复盘（灰度租户可见）
           */
          review: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=review&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/review/query document }
             *
             * 查询复盘信息
             *
             * 根据周期和用户查询复盘信息。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/reviews/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 用户OKR
           */
          userOkr: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=okr&resource=user.okr&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list document }
             *
             * 获取用户的OKR列表
             *
             * 根据用户的id获取OKR列表
             *
             * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 图片
             */
            image: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=image&apiName=upload&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/image/upload document }
               *
               * 上传图片
               *
               * 上传图片
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/images/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * OKR
             */
            okr: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=okr&apiName=batch_get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/okr/batch_get document }
               *
               * 批量获取OKR
               *
               * 根据OKR id批量获取OKR
               *
               * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
               */
              batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/okrs/batch_get`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * OKR周期
             */
            period: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/create document }
               *
               * 创建 OKR 周期
               *
               * 根据周期规则创建一个 OKR 周期
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/list document }
               *
               * 获取OKR周期列表
               *
               * 获取OKR周期列表
               *
               * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period/patch document }
               *
               * 修改 OKR 周期状态
               *
               * 修改某个 OKR 周期的状态为「正常」、「失效」或「隐藏」，对租户所有人生效，请谨慎操作
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/periods/:period_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 周期规则
             */
            periodRule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=period_rule&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/period_rule/list document }
               *
               * 获取 OKR 周期规则
               *
               * 获取租户的周期规则列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/period_rules`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * OKR进展记录
             */
            progressRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/create document }
               *
               * 创建OKR进展记录
               *
               * 创建OKR进展记录
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/delete document }
               *
               * 删除OKR进展记录
               *
               * 根据ID删除OKR进展记录
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/get document }
               *
               * 获取OKR进展记录
               *
               * 根据ID获取OKR进展记录详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=progress_record&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/progress_record/update document }
               *
               * 更新OKR进展记录
               *
               * 根据OKR进展记录ID更新进展详情
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 复盘（灰度租户可见）
             */
            review: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=review&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/review/query document }
               *
               * 查询复盘信息
               *
               * 根据周期和用户查询复盘信息。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/reviews/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 用户OKR
             */
            userOkr: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=okr&resource=user.okr&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/user-okr/list document }
               *
               * 获取用户的OKR列表
               *
               * 根据用户的id获取OKR列表
               *
               * 使用<md-tag mode="inline" type="token-tenant">tenant_access_token</md-tag>需要额外申请权限<md-perm ;href="https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN">以应用身份访问OKR信息</md-perm>
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$n = class extends Client$o {
      constructor() {
        super(...arguments);
        this.optical_char_recognition = {
          /**
           * 图片识别
           */
          image: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=optical_char_recognition&resource=image&apiName=basic_recognize&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize document }
             *
             * 基础图片识别 (OCR)
             *
             * 可识别图片中的文字，按图片中的区域划分，分段返回文本列表
             *
             * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
             */
            basicRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 图片识别
             */
            image: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=optical_char_recognition&resource=image&apiName=basic_recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize document }
               *
               * 基础图片识别 (OCR)
               *
               * 可识别图片中的文字，按图片中的区域划分，分段返回文本列表
               *
               * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
               */
              basicRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$m = class extends Client$n {
      constructor() {
        super(...arguments);
        this.passport = {
          /**
           * 登录态
           */
          session: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=passport&resource=session&apiName=logout&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=logout&project=passport&resource=session&version=v1 document }
             */
            logout: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/passport/v1/sessions/logout`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=passport&resource=session&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query document }
             *
             * 批量获取用户登录信息（脱敏）
             *
             * 该接口用于查询用户的登录信息
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/passport/v1/sessions/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 登录态
             */
            session: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=passport&resource=session&apiName=logout&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=logout&project=passport&resource=session&version=v1 document }
               */
              logout: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/passport/v1/sessions/logout`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=passport&resource=session&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/passport-v1/session/query document }
               *
               * 批量获取用户登录信息（脱敏）
               *
               * 该接口用于查询用户的登录信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/passport/v1/sessions/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$l = class extends Client$m {
      constructor() {
        super(...arguments);
        this.payroll = {
          v1: {
            /**
             * acct_item
             */
            acctItem: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/acct_items`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=acct_item&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=acct_item&version=v1 document }
               *
               * 批量查询算薪项
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/acct_items`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_allocation_detail
             */
            costAllocationDetail: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=cost_allocation_detail&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=cost_allocation_detail&version=v1 document }
               *
               * 获取成本分摊报表明细数据
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_allocation_plan
             */
            costAllocationPlan: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=cost_allocation_plan&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=cost_allocation_plan&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * cost_allocation_report
             */
            costAllocationReport: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=cost_allocation_report&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=cost_allocation_report&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * datasource
             */
            datasource: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/datasources`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=datasource&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=datasource&version=v1 document }
               *
               * 获取外部数据源设置列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/datasources`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * datasource_record
             */
            datasourceRecord: {
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/datasource_records/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=datasource_record&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=payroll&resource=datasource_record&version=v1 document }
               *
               * 获取外部数据源记录
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/datasource_records/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=datasource_record&apiName=save&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=save&project=payroll&resource=datasource_record&version=v1 document }
               *
               * 外部数据记录批量保存接口
               */
              save: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/datasource_records/save`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * paygroup
             */
            paygroup: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/paygroups`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=paygroup&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=paygroup&version=v1 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/paygroups`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * payment_activity
             */
            paymentActivity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=payment_activity&apiName=archive&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=archive&project=payroll&resource=payment_activity&version=v1 document }
               *
               * 封存发薪活动
               */
              archive: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/payroll/v1/payment_activitys`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=payment_activity&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=payment_activity&version=v1 document }
               *
               * 根据发薪起止日和审批状态分页查询发薪活动列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/payment_activitys`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * payment_activity_detail
             */
            paymentActivityDetail: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=payment_activity_detail&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=payroll&resource=payment_activity_detail&version=v1 document }
               *
               * 根据发薪活动 ID 和分页参数获取发薪活动明细列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/payment_activity_details`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * payment_detail
             */
            paymentDetail: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=payroll&resource=payment_detail&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=payroll&resource=payment_detail&version=v1 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/payroll/v1/payment_detail/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$k = class extends Client$l {
      constructor() {
        super(...arguments);
        this.people_admin = {};
      }
    };
    var Client$j = class extends Client$k {
      constructor() {
        super(...arguments);
        this.people_bytedance = {};
      }
    };
    var Client$i = class extends Client$j {
      constructor() {
        super(...arguments);
        this.performance = {
          v2: {
            /**
             * activity
             */
            activity: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=activity&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=activity&version=v2 document }
               *
               * 获取项目的信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/activity/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * additional_information
             */
            additionalInformation: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=additional_information&apiName=import&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=import&project=performance&resource=additional_information&version=v2 document }
               *
               * 可批量导入被评估人的补充信息作为评估参考（包括新增和更新场景）
               */
              import: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/additional_informations/import`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/performance/v2/additional_informations/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=additional_information&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=additional_information&version=v2 document }
               *
               * 可批量查询被评估人的补充信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/additional_informations/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * additional_informations.batch
             */
            additionalInformationsBatch: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=additional_informations.batch&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=performance&resource=additional_informations.batch&version=v2 document }
               *
               * 批量删除补充信息
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/additional_informations/batch`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * indicator
             */
            indicator: {
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/performance/v2/indicators/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=indicator&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=indicator&version=v2 document }
               *
               * 获取评估题配置
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/indicators/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * metric_detail
             */
            metricDetail: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_detail&apiName=import&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=import&project=performance&resource=metric_detail&version=v2 document }
               *
               * 批量录入指定周期被评估人的关键指标详情
               */
              import: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_details/import`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_detail&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=metric_detail&version=v2 document }
               *
               * 批量获取指定周期中被评估人的关键指标详情
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_details/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * metric_field
             */
            metricField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_field&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=metric_field&version=v2 document }
               *
               * 获取指标的字段基础信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_fields/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * metric_lib
             */
            metricLib: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_lib&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=metric_lib&version=v2 document }
               *
               * 获取指标库的信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_libs/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * metric_tag
             */
            metricTag: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_tags`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_tag&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=performance&resource=metric_tag&version=v2 document }
               *
               * 获取指标标签列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_tags`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * metric_template
             */
            metricTemplate: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=metric_template&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=metric_template&version=v2 document }
               *
               * 获取指标模板的信息
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/metric_templates/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * question
             */
            question: {
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/performance/v2/questions/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=question&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=question&version=v2 document }
               *
               * 获取标签填写题配置
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/questions/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * review_data
             */
            reviewData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=review_data&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=review_data&version=v2 document }
               *
               * 获取绩效详情V2
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/review_datas/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * review_template
             */
            reviewTemplate: {
              queryWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/performance/v2/review_templates/query`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=review_template&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=review_template&version=v2 document }
               *
               * 获取评估模板配置
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/review_templates/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * reviewee
             */
            reviewee: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=reviewee&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=performance&resource=reviewee&version=v2 document }
               *
               * 获取指定周期参与了的被评估人
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/reviewees/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * user_group_user_rel
             */
            userGroupUserRel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=performance&resource=user_group_user_rel&apiName=write&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=write&project=performance&resource=user_group_user_rel&version=v2 document }
               *
               * 写入人员组成员范围
               */
              write: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$h = class extends Client$i {
      constructor() {
        super(...arguments);
        this.personal_settings = {
          /**
           * 系统状态
           */
          systemStatus: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=batch_close&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close document }
             *
             * 批量关闭系统状态
             *
             * 批量关闭用户系统状态可用
             */
            batchClose: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=batch_open&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open document }
             *
             * 批量开启系统状态
             *
             * 批量开启用户系统状态可用
             */
            batchOpen: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create document }
             *
             * 创建系统状态
             *
             * 创建租户维度的系统状态。
             *
             * 注意事项:;- 操作的数据为租户维度数据，请小心操作。;- 每个租户最多创建10个系统状态。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete document }
             *
             * 删除系统状态
             *
             * 删除租户维度的系统状态。
             *
             * 注意事项：;- 操作的数据为租户维度数据，请小心操作。 ;- 删除系统状态后，并不影响正在使用该状态用户下系统状态的客户端展示。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list document }
             *
             * 获取系统状态
             *
             * 获取租户下所有系统状态
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch document }
             *
             * 修改系统状态
             *
             * 修改租户维度系统状态。
             *
             * 注意事项：;- 操作的数据为租户维度数据，请小心操作。 ;- 修改系统状态后，并不影响正在使用的用户。该用户的系统状态可用时间到期后，再次被开启可用的时候，用户客户端才会同步到更新后的系统状态。
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 系统状态
             */
            systemStatus: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=batch_close&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_close document }
               *
               * 批量关闭系统状态
               *
               * 批量关闭用户系统状态可用
               */
              batchClose: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=batch_open&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/batch_open document }
               *
               * 批量开启系统状态
               *
               * 批量开启用户系统状态可用
               */
              batchOpen: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/create document }
               *
               * 创建系统状态
               *
               * 创建租户维度的系统状态。
               *
               * 注意事项:;- 操作的数据为租户维度数据，请小心操作。;- 每个租户最多创建10个系统状态。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/delete document }
               *
               * 删除系统状态
               *
               * 删除租户维度的系统状态。
               *
               * 注意事项：;- 操作的数据为租户维度数据，请小心操作。 ;- 删除系统状态后，并不影响正在使用该状态用户下系统状态的客户端展示。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list document }
               *
               * 获取系统状态
               *
               * 获取租户下所有系统状态
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=personal_settings&resource=system_status&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/patch document }
               *
               * 修改系统状态
               *
               * 修改租户维度系统状态。
               *
               * 注意事项：;- 操作的数据为租户维度数据，请小心操作。 ;- 修改系统状态后，并不影响正在使用的用户。该用户的系统状态可用时间到期后，再次被开启可用的时候，用户客户端才会同步到更新后的系统状态。
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$g = class extends Client$h {
      constructor() {
        super(...arguments);
        this.report = {
          /**
           * 规则
           */
          rule: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=report&resource=rule&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/rule/query document }
             *
             * 规则查询
             *
             * 规则查询
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/report/v1/rules/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 规则看板
           */
          ruleView: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=report&resource=rule.view&apiName=remove&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/rule-view/remove document }
             *
             * 移除规则看板
             *
             * 移除规则看板
             */
            remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 任务
           */
          task: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=report&resource=task&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/task/query document }
             *
             * 任务查询
             *
             * 任务查询
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/report/v1/tasks/query`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 规则
             */
            rule: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=report&resource=rule&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/rule/query document }
               *
               * 规则查询
               *
               * 规则查询
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/report/v1/rules/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 规则看板
             */
            ruleView: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=report&resource=rule.view&apiName=remove&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/rule-view/remove document }
               *
               * 移除规则看板
               *
               * 移除规则看板
               */
              remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 任务
             */
            task: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=report&resource=task&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/report/report-v1/task/query document }
               *
               * 任务查询
               *
               * 任务查询
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/report/v1/tasks/query`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$f = class extends Client$g {
      constructor() {
        super(...arguments);
        this.search_in_app = {};
      }
    };
    var Client$e = class extends Client$f {
      constructor() {
        super(...arguments);
        this.search = {
          /**
           * app
           */
          app: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=app&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/app`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 数据源
           */
          dataSource: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create document }
             *
             * 创建数据源
             *
             * 创建一个数据源
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=delete&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete document }
             *
             * 删除数据源
             *
             * 删除一个已存在的数据源
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=get&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get document }
             *
             * 获取数据源
             *
             * 获取已经创建的数据源
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=list&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list document }
             *
             * 批量获取数据源
             *
             * 批量获取创建的数据源信息
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=patch&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch document }
             *
             * 修改数据源
             *
             * 更新一个已经存在的数据源
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 数据项
           */
          dataSourceItem: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create document }
             *
             * 索引数据项
             *
             * 索引一条数据记录
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=delete&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete document }
             *
             * 删除数据项
             *
             * 删除数据项
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=get&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get document }
             *
             * 获取数据项
             *
             * 获取单个数据记录
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * message
           */
          message: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=message&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 document }
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/message`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 数据范式
           */
          schema: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create document }
             *
             * 创建数据范式
             *
             * 创建一个数据范式
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=delete&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete document }
             *
             * 删除数据范式
             *
             * 删除已存在的数据范式
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=get&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get document }
             *
             * 获取数据范式
             *
             * 获取单个数据范式
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=patch&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch document }
             *
             * 修改数据范式
             *
             * 修改数据范式
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v2: {
            /**
             * app
             */
            app: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=app&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=app&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/app`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 数据源
             */
            dataSource: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/create document }
               *
               * 创建数据源
               *
               * 创建一个数据源
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/delete document }
               *
               * 删除数据源
               *
               * 删除一个已存在的数据源
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/get document }
               *
               * 获取数据源
               *
               * 获取已经创建的数据源
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/list document }
               *
               * 批量获取数据源
               *
               * 批量获取创建的数据源信息
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source/patch document }
               *
               * 修改数据源
               *
               * 更新一个已经存在的数据源
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 数据项
             */
            dataSourceItem: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/create document }
               *
               * 索引数据项
               *
               * 索引一条数据记录
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/delete document }
               *
               * 删除数据项
               *
               * 删除数据项
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=data_source.item&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/data_source-item/get document }
               *
               * 获取数据项
               *
               * 获取单个数据记录
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * message
             */
            message: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=message&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=search&resource=message&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/message`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 数据范式
             */
            schema: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/create document }
               *
               * 创建数据范式
               *
               * 创建一个数据范式
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/delete document }
               *
               * 删除数据范式
               *
               * 删除已存在的数据范式
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/get document }
               *
               * 获取数据范式
               *
               * 获取单个数据范式
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=search&resource=schema&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/search-v2/schema/patch document }
               *
               * 修改数据范式
               *
               * 修改数据范式
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/search/v2/schemas/:schema_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$d = class extends Client$e {
      constructor() {
        super(...arguments);
        this.security_and_compliance = {
          /**
           * openapi_log
           */
          openapiLog: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=openapi_log&apiName=list_data&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 document }
             */
            listData: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * openapi_log
             */
            openapiLog: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=openapi_log&apiName=list_data&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 document }
               */
              listData: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * device_apply_record
             */
            deviceApplyRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_apply_record&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=security_and_compliance&resource=device_apply_record&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * device_record
             */
            deviceRecord: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=mine&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mine&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              mine: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=security_and_compliance&resource=device_record&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=security_and_compliance&resource=device_record&version=v2 document }
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$c = class extends Client$d {
      constructor() {
        super(...arguments);
        this.sheets = {
          /**
           * 表格
           */
          spreadsheet: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create document }
             *
             * 创建表格
             *
             * 在指定目录下创建表格
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get document }
             *
             * 获取电子表格信息
             *
             * 该接口用于获取电子表格的基础信息。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch document }
             *
             * 修改电子表格属性
             *
             * 该接口用于修改电子表格的属性
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 筛选
           */
          spreadsheetSheetFilter: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create document }
             *
             * 创建筛选
             *
             * 在子表内创建筛选。
             *
             * 参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide)
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete document }
             *
             * 删除筛选
             *
             * 删除子表的筛选
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get document }
             *
             * 获取筛选
             *
             * 获取子表的详细筛选信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update document }
             *
             * 更新筛选
             *
             * 更新子表筛选范围中的列筛选条件。
             *
             * 参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide)
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 筛选条件
           */
          spreadsheetSheetFilterViewCondition: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create document }
             *
             * 创建筛选条件
             *
             * 在筛选视图的筛选范围的某一列创建筛选条件。
             *
             * 筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete document }
             *
             * 删除筛选条件
             *
             * 删除筛选视图的筛选范围某一列的筛选条件。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get document }
             *
             * 获取筛选条件
             *
             * 获取筛选视图某列的筛选条件信息。
             *
             * 筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=query&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query document }
             *
             * 查询筛选条件
             *
             * 查询一个筛选视图的所有筛选条件，返回筛选视图的筛选范围内的筛选条件。
             *
             * 筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=update&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update document }
             *
             * 更新筛选条件
             *
             * 更新筛选视图范围的某列的筛选条件，condition id 即为列的字母号。
             *
             * 筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 筛选视图
           */
          spreadsheetSheetFilterView: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create document }
             *
             * 创建筛选视图
             *
             * 根据传入的参数创建一个筛选视图。Id 和 名字可选，不填的话会默认生成；range 必填。Id 长度为10，由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。
             *
             * 筛选范围的设置参考：[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete document }
             *
             * 删除筛选视图
             *
             * 删除指定 id 对应的筛选视图。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get document }
             *
             * 获取筛选视图
             *
             * 获取指定筛选视图 id 的名字和筛选范围。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch document }
             *
             * 更新筛选视图
             *
             * 更新筛选视图的名字或者筛选范围。名字长度不超过100，不能重复即子表内唯一；筛选范围不超过子表的最大范围。
             *
             * 筛选范围的设置参考：[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=query&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query document }
             *
             * 查询筛选视图
             *
             * 查询子表内所有的筛选视图基本信息，包括 id、name 和 range
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 工作表
           */
          spreadsheetSheet: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=find&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find document }
             *
             * 查找单元格
             *
             * 在指定范围内查找符合查找条件的单元格。
             */
            find: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get document }
             *
             * 查询工作表
             *
             * 该接口用于通过工作表ID查询工作表属性信息。
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=move_dimension&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension document }
             *
             * 移动行列
             *
             * 该接口用于移动行列，行列被移动到目标位置后，原本在目标位置的行列会对应右移或下移。
             */
            moveDimension: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=query&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query document }
             *
             * 获取工作表
             *
             * 该接口用于获取电子表格下所有工作表及其属性。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=replace&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace document }
             *
             * 替换单元格
             *
             * 按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值，返回替换成功的单元格位置。一次请求最多允许替换5000个单元格，如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。
             */
            replace: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 浮动图片
           */
          spreadsheetSheetFloatImage: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=create&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create document }
             *
             * 创建浮动图片
             *
             * 根据传入的参数创建一张浮动图片。Float_image_token （[上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all)）和range（只支持一个单元格） 必填。Float_image_id 可选，不填的话会默认生成，长度为10，由 0-9、a-z、A-Z 组合生成。表格内不重复的图片（浮动图片+单元格图片）总数不超过4000。width 和 height 为图片展示的宽高，可选，不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移，可选，默认为 0。
             *
             * 浮动图片的设置参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=delete&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete document }
             *
             * 删除浮动图片
             *
             * 删除 float_image_id 对应的浮动图片。
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=get&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get document }
             *
             * 获取浮动图片
             *
             * 根据 float_image_id 获取对应浮动图片的信息。
             *
             * 浮动图片参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=patch&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch document }
             *
             * 更新浮动图片
             *
             * 更新已有的浮动图片位置和宽高，包括 range、width、height、offset_x 和 offset_y，不包括 float_image_id 和 float_image_token。
             *
             * 浮动图片更新参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=query&version=v3 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query document }
             *
             * 查询浮动图片
             *
             * 返回子表内所有的浮动图片信息。
             *
             * 浮动图片参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v3: {
            /**
             * 表格
             */
            spreadsheet: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create document }
               *
               * 创建表格
               *
               * 在指定目录下创建表格
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/get document }
               *
               * 获取电子表格信息
               *
               * 该接口用于获取电子表格的基础信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/patch document }
               *
               * 修改电子表格属性
               *
               * 该接口用于修改电子表格的属性
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 筛选
             */
            spreadsheetSheetFilter: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/create document }
               *
               * 创建筛选
               *
               * 在子表内创建筛选。
               *
               * 参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide)
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/delete document }
               *
               * 删除筛选
               *
               * 删除子表的筛选
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/get document }
               *
               * 获取筛选
               *
               * 获取子表的详细筛选信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/update document }
               *
               * 更新筛选
               *
               * 更新子表筛选范围中的列筛选条件。
               *
               * 参数值可参考[筛选指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter/filter-user-guide)
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 筛选条件
             */
            spreadsheetSheetFilterViewCondition: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/create document }
               *
               * 创建筛选条件
               *
               * 在筛选视图的筛选范围的某一列创建筛选条件。
               *
               * 筛选条件参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/delete document }
               *
               * 删除筛选条件
               *
               * 删除筛选视图的筛选范围某一列的筛选条件。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/get document }
               *
               * 获取筛选条件
               *
               * 获取筛选视图某列的筛选条件信息。
               *
               * 筛选条件含义参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=query&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/query document }
               *
               * 查询筛选条件
               *
               * 查询一个筛选视图的所有筛选条件，返回筛选视图的筛选范围内的筛选条件。
               *
               * 筛选条件含义可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view.condition&apiName=update&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/update document }
               *
               * 更新筛选条件
               *
               * 更新筛选视图范围的某列的筛选条件，condition id 即为列的字母号。
               *
               * 筛选条件参数可参考 [筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 筛选视图
             */
            spreadsheetSheetFilterView: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/create document }
               *
               * 创建筛选视图
               *
               * 根据传入的参数创建一个筛选视图。Id 和 名字可选，不填的话会默认生成；range 必填。Id 长度为10，由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。
               *
               * 筛选范围的设置参考：[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/delete document }
               *
               * 删除筛选视图
               *
               * 删除指定 id 对应的筛选视图。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/get document }
               *
               * 获取筛选视图
               *
               * 获取指定筛选视图 id 的名字和筛选范围。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/patch document }
               *
               * 更新筛选视图
               *
               * 更新筛选视图的名字或者筛选范围。名字长度不超过100，不能重复即子表内唯一；筛选范围不超过子表的最大范围。
               *
               * 筛选范围的设置参考：[筛选视图的筛选条件指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view-condition/filter-view-condition-user-guide)
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.filter_view&apiName=query&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-filter_view/query document }
               *
               * 查询筛选视图
               *
               * 查询子表内所有的筛选视图基本信息，包括 id、name 和 range
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 工作表
             */
            spreadsheetSheet: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=find&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/find document }
               *
               * 查找单元格
               *
               * 在指定范围内查找符合查找条件的单元格。
               */
              find: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/get document }
               *
               * 查询工作表
               *
               * 该接口用于通过工作表ID查询工作表属性信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=move_dimension&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/move_dimension document }
               *
               * 移动行列
               *
               * 该接口用于移动行列，行列被移动到目标位置后，原本在目标位置的行列会对应右移或下移。
               */
              moveDimension: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=query&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query document }
               *
               * 获取工作表
               *
               * 该接口用于获取电子表格下所有工作表及其属性。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet&apiName=replace&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/replace document }
               *
               * 替换单元格
               *
               * 按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值，返回替换成功的单元格位置。一次请求最多允许替换5000个单元格，如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。
               */
              replace: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 浮动图片
             */
            spreadsheetSheetFloatImage: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=create&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/create document }
               *
               * 创建浮动图片
               *
               * 根据传入的参数创建一张浮动图片。Float_image_token （[上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all)）和range（只支持一个单元格） 必填。Float_image_id 可选，不填的话会默认生成，长度为10，由 0-9、a-z、A-Z 组合生成。表格内不重复的图片（浮动图片+单元格图片）总数不超过4000。width 和 height 为图片展示的宽高，可选，不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移，可选，默认为 0。
               *
               * 浮动图片的设置参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=delete&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/delete document }
               *
               * 删除浮动图片
               *
               * 删除 float_image_id 对应的浮动图片。
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=get&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/get document }
               *
               * 获取浮动图片
               *
               * 根据 float_image_id 获取对应浮动图片的信息。
               *
               * 浮动图片参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=patch&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/patch document }
               *
               * 更新浮动图片
               *
               * 更新已有的浮动图片位置和宽高，包括 range、width、height、offset_x 和 offset_y，不包括 float_image_id 和 float_image_token。
               *
               * 浮动图片更新参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=sheets&resource=spreadsheet.sheet.float_image&apiName=query&version=v3 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/query document }
               *
               * 查询浮动图片
               *
               * 返回子表内所有的浮动图片信息。
               *
               * 浮动图片参考：[浮动图片指南](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-float_image/float-image-user-guide)
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$b = class extends Client$c {
      constructor() {
        super(...arguments);
        this.speech_to_text = {
          /**
           * 语音识别
           */
          speech: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=speech_to_text&resource=speech&apiName=file_recognize&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize document }
             *
             * 语音文件识别 (ASR)
             *
             * 语音文件识别接口，上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别
             *
             * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
             */
            fileRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=speech_to_text&resource=speech&apiName=stream_recognize&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize document }
             *
             * 语音流式识别 (ASR)
             *
             * 语音流式接口，将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms
             *
             * 单租户限流：20 路（一个 stream_id 称为一路会话），同租户下的应用没有限流，共享本租户的 20路限流
             */
            streamRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 语音识别
             */
            speech: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=speech_to_text&resource=speech&apiName=file_recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/file_recognize document }
               *
               * 语音文件识别 (ASR)
               *
               * 语音文件识别接口，上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别
               *
               * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
               */
              fileRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=speech_to_text&resource=speech&apiName=stream_recognize&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/speech_to_text-v1/speech/stream_recognize document }
               *
               * 语音流式识别 (ASR)
               *
               * 语音流式接口，将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms
               *
               * 单租户限流：20 路（一个 stream_id 称为一路会话），同租户下的应用没有限流，共享本租户的 20路限流
               */
              streamRecognize: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$a = class extends Client$b {
      constructor() {
        super(...arguments);
        this.spend = {};
      }
    };
    var Client$9 = class extends Client$a {
      constructor() {
        super(...arguments);
        this.sup_project = {};
      }
    };
    var Client$8 = class extends Client$9 {
      constructor() {
        super(...arguments);
        this.task = {
          /**
           * 任务
           */
          task: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=batch_delete_collaborator&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator document }
             *
             * 批量删除执行者
             *
             * 该接口用于批量删除执行者
             */
            batchDeleteCollaborator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=batch_delete_follower&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower document }
             *
             * 批量删除关注人
             *
             * 该接口用于批量删除关注人
             */
            batchDeleteFollower: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=complete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete document }
             *
             * 完成任务
             *
             * 该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成，而不支持执行者分别完成任务，执行成功后，任务对所有关联用户都变为完成状态。
             */
            complete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create document }
             *
             * 创建任务
             *
             * 该接口可以创建一个任务，支持填写任务的基本信息，包括任务的标题，描述及协作者等。;在此基础上，创建任务时可以设置截止时间和重复规则，将任务设置为定期执行的重复任务。通过添加协作者，则可以让其他用户协同完成该任务。;此外，接口也提供了一些支持自定义内容的字段，调用方可以实现定制化效果，如完成任务后跳转到指定结束界面。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete document }
             *
             * 删除任务
             *
             * 该接口用于删除任务
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get document }
             *
             * 获取任务详情
             *
             * 该接口用于获取任务详情，包括任务标题、描述、时间、来源等信息
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list document }
             *
             * 获取任务列表
             *
             * 以分页的方式获取任务列表。当使用user_access_token时，获取与该用户身份相关的所有任务。当使用tenant_access_token时，获取以该应用身份通过“创建任务“接口创建的所有任务（并非获取该应用所在租户下所有用户创建的任务）。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch document }
             *
             * 更新任务
             *
             * 该接口用于修改任务的标题、描述、时间、来源等相关信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=uncomplete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete document }
             *
             * 取消完成任务
             *
             * 该接口用于取消任务的已完成状态
             */
            uncomplete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 执行者
           */
          taskCollaborator: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create document }
             *
             * 新增执行者
             *
             * 该接口用于新增任务执行者，一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者，关注人无权限添加。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete document }
             *
             * 删除执行者
             *
             * 该接口用于删除任务执行者
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list document }
             *
             * 获取一个任务的执行者列表
             *
             * 该接口用于查询任务执行者列表，支持分页，最大值为50
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 评论
           */
          taskComment: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create document }
             *
             * 创建评论
             *
             * 该接口用于创建和回复任务的评论。当parent_id字段为0时，为创建评论；当parent_id不为0时，为回复某条评论
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete document }
             *
             * 删除评论
             *
             * 该接口用于通过评论ID删除评论
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get document }
             *
             * 获取评论详情
             *
             * 该接口用于通过评论ID获取评论详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list document }
             *
             * 获取评论列表
             *
             * 该接口用于查询任务评论列表，支持分页，最大值为100
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update document }
             *
             * 更新评论
             *
             * 该接口用于更新评论内容
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 关注人
           */
          taskFollower: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create document }
             *
             * 新增关注人
             *
             * 该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete document }
             *
             * 删除关注人
             *
             * 该接口用于删除任务关注人
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list document }
             *
             * 获取任务关注人列表
             *
             * 该接口用于查询任务关注人列表，支持分页，最大值为50
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 提醒
           */
          taskReminder: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create document }
             *
             * 新增提醒时间
             *
             * 该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移，但是偏移后的结果不能早于当前时间。
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete document }
             *
             * 删除提醒时间
             *
             * 删除提醒时间，返回结果状态
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list document }
             *
             * 查询提醒时间列表
             *
             * 返回提醒时间列表，支持分页，最大值为50
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 任务
             */
            task: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=batch_delete_collaborator&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_collaborator document }
               *
               * 批量删除执行者
               *
               * 该接口用于批量删除执行者
               */
              batchDeleteCollaborator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=batch_delete_follower&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/batch_delete_follower document }
               *
               * 批量删除关注人
               *
               * 该接口用于批量删除关注人
               */
              batchDeleteFollower: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=complete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/complete document }
               *
               * 完成任务
               *
               * 该接口用于将任务状态修改为“已完成”。;完成任务是指整个任务全部完成，而不支持执行者分别完成任务，执行成功后，任务对所有关联用户都变为完成状态。
               */
              complete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/create document }
               *
               * 创建任务
               *
               * 该接口可以创建一个任务，支持填写任务的基本信息，包括任务的标题，描述及协作者等。;在此基础上，创建任务时可以设置截止时间和重复规则，将任务设置为定期执行的重复任务。通过添加协作者，则可以让其他用户协同完成该任务。;此外，接口也提供了一些支持自定义内容的字段，调用方可以实现定制化效果，如完成任务后跳转到指定结束界面。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/delete document }
               *
               * 删除任务
               *
               * 该接口用于删除任务
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/get document }
               *
               * 获取任务详情
               *
               * 该接口用于获取任务详情，包括任务标题、描述、时间、来源等信息
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/list document }
               *
               * 获取任务列表
               *
               * 以分页的方式获取任务列表。当使用user_access_token时，获取与该用户身份相关的所有任务。当使用tenant_access_token时，获取以该应用身份通过“创建任务“接口创建的所有任务（并非获取该应用所在租户下所有用户创建的任务）。;本接口支持通过任务创建时间以及任务的完成状态对任务进行过滤。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/patch document }
               *
               * 更新任务
               *
               * 该接口用于修改任务的标题、描述、时间、来源等相关信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=uncomplete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task/uncomplete document }
               *
               * 取消完成任务
               *
               * 该接口用于取消任务的已完成状态
               */
              uncomplete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 执行者
             */
            taskCollaborator: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/create document }
               *
               * 新增执行者
               *
               * 该接口用于新增任务执行者，一次性可以添加多个执行者。;只有任务的创建者和执行者才能添加执行者，关注人无权限添加。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/delete document }
               *
               * 删除执行者
               *
               * 该接口用于删除任务执行者
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.collaborator&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-collaborator/list document }
               *
               * 获取一个任务的执行者列表
               *
               * 该接口用于查询任务执行者列表，支持分页，最大值为50
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 评论
             */
            taskComment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/create document }
               *
               * 创建评论
               *
               * 该接口用于创建和回复任务的评论。当parent_id字段为0时，为创建评论；当parent_id不为0时，为回复某条评论
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/delete document }
               *
               * 删除评论
               *
               * 该接口用于通过评论ID删除评论
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/get document }
               *
               * 获取评论详情
               *
               * 该接口用于通过评论ID获取评论详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/list document }
               *
               * 获取评论列表
               *
               * 该接口用于查询任务评论列表，支持分页，最大值为100
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.comment&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-comment/update document }
               *
               * 更新评论
               *
               * 该接口用于更新评论内容
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 关注人
             */
            taskFollower: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/create document }
               *
               * 新增关注人
               *
               * 该接口用于创建任务关注人。可以一次性添加多位关注人。关注人ID要使用表示用户的ID。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/delete document }
               *
               * 删除关注人
               *
               * 该接口用于删除任务关注人
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.follower&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-follower/list document }
               *
               * 获取任务关注人列表
               *
               * 该接口用于查询任务关注人列表，支持分页，最大值为50
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 提醒
             */
            taskReminder: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/create document }
               *
               * 新增提醒时间
               *
               * 该接口用于创建任务的提醒时间。提醒时间在截止时间基础上做偏移，但是偏移后的结果不能早于当前时间。
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/delete document }
               *
               * 删除提醒时间
               *
               * 删除提醒时间，返回结果状态
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.reminder&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/task-v1/task-reminder/list document }
               *
               * 查询提醒时间列表
               *
               * 返回提醒时间列表，支持分页，最大值为50
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * attachment
             */
            attachment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=attachment&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=attachment&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=attachment&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=attachment&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/attachments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=attachment&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=attachment&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/attachments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=attachment&apiName=upload&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload&project=task&resource=attachment&version=v2 document }
               */
              upload: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/attachments/upload`, path2),
                  method: "POST",
                  data,
                  params,
                  headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                return (res === null || res === void 0 ? void 0 : res.data) || null;
              })
            },
            /**
             * comment
             */
            comment: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=comment&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=comment&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/comments`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=comment&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=comment&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/comments/:comment_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=comment&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=comment&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/comments/:comment_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/comments`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=comment&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=comment&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/comments`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=comment&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=comment&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/comments/:comment_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * custom_field
             */
            customField: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=add&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add&project=task&resource=custom_field&version=v2 document }
               */
              add: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=custom_field&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=custom_field&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field&apiName=remove&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove&project=task&resource=custom_field&version=v2 document }
               */
              remove: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * custom_field.option
             */
            customFieldOption: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field.option&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=custom_field.option&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=custom_field.option&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=custom_field.option&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * section
             */
            section: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=section&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=section&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections/:section_guid`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=section&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections/:section_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/sections`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=section&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=section&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections/:section_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              tasksWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=section&apiName=tasks&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=section&version=v2 document }
               */
              tasks: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * task
             */
            task: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=add_dependencies&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_dependencies&project=task&resource=task&version=v2 document }
               */
              addDependencies: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=add_members&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=task&version=v2 document }
               */
              addMembers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=add_reminders&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_reminders&project=task&resource=task&version=v2 document }
               */
              addReminders: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=add_tasklist&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_tasklist&project=task&resource=task&version=v2 document }
               */
              addTasklist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=task&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=task&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=task&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=remove_dependencies&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_dependencies&project=task&resource=task&version=v2 document }
               */
              removeDependencies: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=remove_members&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=task&version=v2 document }
               */
              removeMembers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=remove_reminders&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_reminders&project=task&resource=task&version=v2 document }
               */
              removeReminders: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=remove_tasklist&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_tasklist&project=task&resource=task&version=v2 document }
               */
              removeTasklist: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task&apiName=tasklists&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasklists&project=task&resource=task&version=v2 document }
               */
              tasklists: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * task.subtask
             */
            taskSubtask: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.subtask&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=task.subtask&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=task.subtask&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=task.subtask&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * tasklist.activity_subscription
             */
            tasklistActivitySubscription: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist.activity_subscription&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist.activity_subscription&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist.activity_subscription&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist.activity_subscription&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist.activity_subscription&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist.activity_subscription&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist.activity_subscription&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist.activity_subscription&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist.activity_subscription&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist.activity_subscription&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * tasklist
             */
            tasklist: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=add_members&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=add_members&project=task&resource=tasklist&version=v2 document }
               */
              addMembers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=task&resource=tasklist&version=v2 document }
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=task&resource=tasklist&version=v2 document }
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=task&resource=tasklist&version=v2 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=task&resource=tasklist&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=patch&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=task&resource=tasklist&version=v2 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=remove_members&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_members&project=task&resource=tasklist&version=v2 document }
               */
              removeMembers: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=task&resource=tasklist&apiName=tasks&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=tasks&project=task&resource=tasklist&version=v2 document }
               */
              tasks: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$7 = class extends Client$8 {
      constructor() {
        super(...arguments);
        this.tenant = {
          /**
           * tenant.product_assign_info
           */
          tenantProductAssignInfo: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=tenant&resource=tenant.product_assign_info&apiName=query&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 document }
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 企业信息
           */
          tenant: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=tenant&resource=tenant&apiName=query&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query document }
             *
             * 获取企业信息
             *
             * 获取企业名称、企业编号等企业信息
             *
             * 如果ISV应用是企业创建时默认安装，并且180天内企业未打开或使用过此应用，则无法通过此接口获取到企业信息。
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/tenant/v2/tenant/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v2: {
            /**
             * tenant.product_assign_info
             */
            tenantProductAssignInfo: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=tenant&resource=tenant.product_assign_info&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=tenant&resource=tenant.product_assign_info&version=v2 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 企业信息
             */
            tenant: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=tenant&resource=tenant&apiName=query&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/tenant-v2/tenant/query document }
               *
               * 获取企业信息
               *
               * 获取企业名称、企业编号等企业信息
               *
               * 如果ISV应用是企业创建时默认安装，并且180天内企业未打开或使用过此应用，则无法通过此接口获取到企业信息。
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/tenant/v2/tenant/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$6 = class extends Client$7 {
      constructor() {
        super(...arguments);
        this.translation = {
          /**
           * 文本
           */
          text: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=translation&resource=text&apiName=detect&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect document }
             *
             * 文本语种识别
             *
             * 机器翻译 (MT)，支持 100 多种语言识别，返回符合 ISO 639-1 标准
             *
             * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
             */
            detect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/translation/v1/text/detect`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=translation&resource=text&apiName=translate&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate document }
             *
             * 文本翻译
             *
             * 机器翻译 (MT)，支持以下语种互译：;"zh": 汉语；;"zh-Hant": 繁体汉语；;"en": 英语；;"ja": 日语；;"ru": 俄语；;"de": 德语；;"fr": 法语；;"it": 意大利语；;"pl": 波兰语；;"th": 泰语；;"hi": 印地语；;"id": 印尼语；;"es": 西班牙语；;"pt": 葡萄牙语；;"ko": 朝鲜语；;"vi": 越南语；
             *
             * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
             */
            translate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/translation/v1/text/translate`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 文本
             */
            text: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=translation&resource=text&apiName=detect&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/detect document }
               *
               * 文本语种识别
               *
               * 机器翻译 (MT)，支持 100 多种语言识别，返回符合 ISO 639-1 标准
               *
               * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
               */
              detect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/translation/v1/text/detect`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=translation&resource=text&apiName=translate&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/translation-v1/text/translate document }
               *
               * 文本翻译
               *
               * 机器翻译 (MT)，支持以下语种互译：;"zh": 汉语；;"zh-Hant": 繁体汉语；;"en": 英语；;"ja": 日语；;"ru": 俄语；;"de": 德语；;"fr": 法语；;"it": 意大利语；;"pl": 波兰语；;"th": 泰语；;"hi": 印地语；;"id": 印尼语；;"es": 西班牙语；;"pt": 葡萄牙语；;"ko": 朝鲜语；;"vi": 越南语；
               *
               * 单租户限流：20QPS，同租户下的应用没有限流，共享本租户的 20QPS 限流
               */
              translate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/translation/v1/text/translate`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$5 = class extends Client$6 {
      constructor() {
        super(...arguments);
        this.unified_kms_log = {};
      }
    };
    var Client$4 = class extends Client$5 {
      constructor() {
        super(...arguments);
        this.vc = {
          /**
           * 告警中心
           */
          alert: {
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=alert&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list document }
             *
             * 获取告警记录
             *
             * 获取特定条件下租户的设备告警记录
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 导出
           */
          export: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=download&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download document }
             *
             * 下载导出文件
             *
             * 下载导出文件
             */
            download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const res = yield this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/download`, path2),
                method: "GET",
                headers,
                data,
                params,
                responseType: "stream",
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                $return_headers: true
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
              const checkIsReadable = () => {
                const consumedError = "The stream has already been consumed";
                if (!res.data.readable) {
                  this.logger.error(consumedError);
                  throw new Error(consumedError);
                }
              };
              return {
                writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                  checkIsReadable();
                  return new Promise((resolve4, reject) => {
                    const writableStream = fs__default["default"].createWriteStream(filePath);
                    writableStream.on("finish", () => {
                      resolve4(filePath);
                    });
                    writableStream.on("error", (e3) => {
                      reject(e3);
                    });
                    res.data.pipe(writableStream);
                  });
                }),
                getReadableStream: () => {
                  checkIsReadable();
                  return res.data;
                },
                headers: res.headers
              };
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get document }
             *
             * 查询导出任务结果
             *
             * 查看异步导出的进度
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/:task_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=meeting_list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list document }
             *
             * 导出会议明细
             *
             * 导出会议明细，具体权限要求请参考「导出概述」
             */
            meetingList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/meeting_list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=participant_list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list document }
             *
             * 导出参会人明细
             *
             * 导出某个会议的参会人详情列表，具体权限要求请参考「导出概述」
             */
            participantList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/participant_list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=participant_quality_list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list document }
             *
             * 导出参会人会议质量数据
             *
             * 导出某场会议某个参会人的音视频&共享质量数据;，具体权限要求请参考「导出概述」
             */
            participantQualityList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=resource_reservation_list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list document }
             *
             * 导出会议室预定数据
             *
             * 导出会议室预定数据，具体权限要求请参考「导出概述」
             */
            resourceReservationList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 会议
           */
          meeting: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=end&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end document }
             *
             * 结束会议
             *
             * 结束一个进行中的会议
             *
             * 会议正在进行中，且操作者须具有相应的权限（如果操作者为用户，必须是会中当前主持人）
             */
            end: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get document }
             *
             * 获取会议详情
             *
             * 获取一个会议的详细数据
             *
             * 只能获取归属于自己的会议，支持查询最近90天内的会议
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=invite&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite document }
             *
             * 邀请参会人
             *
             * 邀请参会人进入会议
             *
             * 发起邀请的操作者必须具有相应的权限（如果操作者为用户，则必须在会中），如果会议被锁定、或参会人数如果达到上限，则会邀请失败
             */
            invite: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=kickout&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout document }
             *
             * 移除参会人
             *
             * 将参会人从会议中移除
             */
            kickout: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listByNoWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=list_by_no&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no document }
             *
             * 获取与会议号相关联的会议列表
             *
             * 获取指定时间范围（90天内)会议号关联的会议简要信息列表
             */
            listByNo: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=set_host&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host document }
             *
             * 设置主持人
             *
             * 设置会议的主持人
             *
             * 发起设置主持人的操作者必须具有相应的权限（如果操作者为用户，必须是会中当前主持人）；该操作使用CAS并发安全机制，需传入会中当前主持人，如果操作失败可使用返回的最新数据重试
             */
            setHost: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 录制
           */
          meetingRecording: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get document }
             *
             * 获取录制文件
             *
             * 获取一个会议的录制文件。
             *
             * 会议结束后并且收到了"录制完成"的事件方可获取录制文件；只有会议owner（通过开放平台预约的会议即为预约人）有权限获取；录制时间太短(&lt;5s)有可能无法生成录制文件
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=set_permission&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission document }
             *
             * 授权录制文件
             *
             * 将一个会议的录制文件授权给组织、用户或公开到公网
             *
             * 会议结束后并且收到了"录制完成"的事件方可进行授权；会议owner（通过开放平台预约的会议即为预约人）才有权限操作
             */
            setPermission: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=start&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start document }
             *
             * 开始录制
             *
             * 在会议中开始录制。
             *
             * 会议正在进行中，且操作者具有相应权限（如果操作者为用户，必须是会中当前主持人）
             */
            start: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=stop&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop document }
             *
             * 停止录制
             *
             * 在会议中停止录制。
             *
             * 会议正在录制中，且操作者具有相应权限（如果操作者为用户，必须是会中当前主持人）
             */
            stop: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * meeting_list
           */
          meetingList: {
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meeting_list`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting_list&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/meeting_list`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * participant_list
           */
          participantList: {
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_list`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=participant_list&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_list`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * participant_quality_list
           */
          participantQualityList: {
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_quality_list`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=participant_quality_list&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_quality_list`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 会议报告
           */
          report: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=report&apiName=get_daily&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily document }
             *
             * 获取会议报告
             *
             * 获取一段时间内组织的每日会议使用报告。
             *
             * 支持最近90天内的数据查询
             */
            getDaily: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reports/get_daily`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=report&apiName=get_top_user&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user document }
             *
             * 获取top用户列表
             *
             * 获取一段时间内组织内会议使用的top用户列表。
             *
             * 支持最近90天内的数据查询；默认返回前10位，最多可查询前100位
             */
            getTopUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reports/get_top_user`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 预约
           */
          reserve: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=apply&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply document }
             *
             * 预约会议
             *
             * 创建一个会议预约。
             *
             * 支持预约最近30天内的会议（到期时间距离当前时间不超过30天），预约到期后会议号将被释放，如需继续使用可通过"更新预约"接口进行续期；预约会议时可配置参会人在会中的权限，以达到控制会议的目的
             */
            apply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/apply`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete document }
             *
             * 删除预约
             *
             * 删除一个预约
             *
             * 只能删除归属于自己的预约；删除后数据不可恢复
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get document }
             *
             * 获取预约
             *
             * 获取一个预约的详情
             *
             * 只能获取归属于自己的预约
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=get_active_meeting&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting document }
             *
             * 获取活跃会议
             *
             * 获取一个预约的当前活跃会议
             *
             * 只能获取归属于自己的预约的活跃会议（一个预约最多有一个正在进行中的会议）
             */
            getActiveMeeting: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=update&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update document }
             *
             * 更新预约
             *
             * 更新一个预约
             *
             * 只能更新归属于自己的预约，不需要更新的字段不传（如果传空则会被更新为空）；可用于续期操作，到期时间距离当前时间不超过30天
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * reserve_config.admin
           */
          reserveConfigAdmin: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.admin&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.admin&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * reserve_config.disable_inform
           */
          reserveConfigDisableInform: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.disable_inform&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.disable_inform&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * reserve_config.form
           */
          reserveConfigForm: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.form&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.form&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 document }
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * reserve_config
           */
          reserveConfig: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch document }
             *
             * 更新会议室预定范围
             *
             * 更新会议室预定范围
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config&apiName=reserve_scope&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope document }
             *
             * 获取会议室预定范围
             *
             * 获取会议室预定范围
             */
            reserveScope: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * resource_reservation_list
           */
          resourceReservationList: {
            getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/resource_reservation_list`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=resource_reservation_list&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 document }
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/resource_reservation_list`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 会议室
           */
          room: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create document }
             *
             * 创建会议室
             *
             * 该接口用于创建会议室
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=delete&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete document }
             *
             * 删除会议室
             *
             * 该接口可以用来删除某个会议室
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get document }
             *
             * 查询会议室详情
             *
             * 该接口可以使用会议室ID查询会议室详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list document }
             *
             * 查询会议室列表
             *
             * 该接口可以用来查询某个会议室层级下会议室列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=mget&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget document }
             *
             * 批量查询会议室详情
             *
             * 该接口可以使用会议室ID批量查询会议室详情
             */
            mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/mget`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch document }
             *
             * 更新会议室
             *
             * 该接口可以用来更新某个会议室的信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search document }
             *
             * 搜索会议室
             *
             * 该接口可以用来搜索会议室，支持使用关键词进行搜索，也支持使用自定义会议室ID进行查询
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * room_config
           */
          roomConfig: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=query&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 document }
             */
            query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/query`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 document }
             */
            set: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set_checkboard_access_code&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 document }
             */
            setCheckboardAccessCode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set_room_access_code&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 document }
             */
            setRoomAccessCode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 会议室层级
           */
          roomLevel: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create document }
             *
             * 创建会议室层级
             *
             * 该接口用于创建会议室层级
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=del&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del document }
             *
             * 删除会议室层级
             *
             * 该接口可以用来删除某个会议室层级
             */
            del: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/del`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get document }
             *
             * 查询会议室层级详情
             *
             * 该接口可以使用会议室层级ID查询会议室层级详情
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=list&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list document }
             *
             * 查询会议室层级列表
             *
             * 该接口用来查询某个会议室层级下的子层级列表
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=mget&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget document }
             *
             * 批量查询会议室层级详情
             *
             * 该接口可以使用会议室层级ID批量查询会议室层级详情
             */
            mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/mget`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=patch&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch document }
             *
             * 更新会议室层级
             *
             * 该接口可以用来更新某个会议室层级的信息
             */
            patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`, path2),
                method: "PATCH",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search document }
             *
             * 搜索会议室层级
             *
             * 该接口可以用来搜索会议室层级，支持使用自定义会议室层级ID进行查询
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/search`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * 会议室配置
           */
          scopeConfig: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=scope_config&apiName=create&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create document }
             *
             * 设置会议室配置
             *
             * 该接口可以用来设置某个会议层级范围下或者某个会议室的配置
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/scope_config`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=vc&resource=scope_config&apiName=get&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get document }
             *
             * 查询会议室配置
             *
             * 该接口可以用来查询某个会议层级范围下或者某个会议室的配置
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/vc/v1/scope_config`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 告警中心
             */
            alert: {
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=alert&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list document }
               *
               * 获取告警记录
               *
               * 获取特定条件下租户的设备告警记录
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 导出
             */
            export: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=download&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/download document }
               *
               * 下载导出文件
               *
               * 下载导出文件
               */
              download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/download`, path2),
                  method: "GET",
                  headers,
                  data,
                  params,
                  responseType: "stream",
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" }),
                  $return_headers: true
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
                const checkIsReadable = () => {
                  const consumedError = "The stream has already been consumed";
                  if (!res.data.readable) {
                    this.logger.error(consumedError);
                    throw new Error(consumedError);
                  }
                };
                return {
                  writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
                    checkIsReadable();
                    return new Promise((resolve4, reject) => {
                      const writableStream = fs__default["default"].createWriteStream(filePath);
                      writableStream.on("finish", () => {
                        resolve4(filePath);
                      });
                      writableStream.on("error", (e3) => {
                        reject(e3);
                      });
                      res.data.pipe(writableStream);
                    });
                  }),
                  getReadableStream: () => {
                    checkIsReadable();
                    return res.data;
                  },
                  headers: res.headers
                };
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/get document }
               *
               * 查询导出任务结果
               *
               * 查看异步导出的进度
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/:task_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=meeting_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/meeting_list document }
               *
               * 导出会议明细
               *
               * 导出会议明细，具体权限要求请参考「导出概述」
               */
              meetingList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/meeting_list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=participant_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_list document }
               *
               * 导出参会人明细
               *
               * 导出某个会议的参会人详情列表，具体权限要求请参考「导出概述」
               */
              participantList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/participant_list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=participant_quality_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/participant_quality_list document }
               *
               * 导出参会人会议质量数据
               *
               * 导出某场会议某个参会人的音视频&共享质量数据;，具体权限要求请参考「导出概述」
               */
              participantQualityList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=resource_reservation_list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/export/resource_reservation_list document }
               *
               * 导出会议室预定数据
               *
               * 导出会议室预定数据，具体权限要求请参考「导出概述」
               */
              resourceReservationList: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 会议
             */
            meeting: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=end&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/end document }
               *
               * 结束会议
               *
               * 结束一个进行中的会议
               *
               * 会议正在进行中，且操作者须具有相应的权限（如果操作者为用户，必须是会中当前主持人）
               */
              end: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/get document }
               *
               * 获取会议详情
               *
               * 获取一个会议的详细数据
               *
               * 只能获取归属于自己的会议，支持查询最近90天内的会议
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=invite&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/invite document }
               *
               * 邀请参会人
               *
               * 邀请参会人进入会议
               *
               * 发起邀请的操作者必须具有相应的权限（如果操作者为用户，则必须在会中），如果会议被锁定、或参会人数如果达到上限，则会邀请失败
               */
              invite: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=kickout&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/kickout document }
               *
               * 移除参会人
               *
               * 将参会人从会议中移除
               */
              kickout: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listByNoWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=list_by_no&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/list_by_no document }
               *
               * 获取与会议号相关联的会议列表
               *
               * 获取指定时间范围（90天内)会议号关联的会议简要信息列表
               */
              listByNo: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting&apiName=set_host&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting/set_host document }
               *
               * 设置主持人
               *
               * 设置会议的主持人
               *
               * 发起设置主持人的操作者必须具有相应的权限（如果操作者为用户，必须是会中当前主持人）；该操作使用CAS并发安全机制，需传入会中当前主持人，如果操作失败可使用返回的最新数据重试
               */
              setHost: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 录制
             */
            meetingRecording: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/get document }
               *
               * 获取录制文件
               *
               * 获取一个会议的录制文件。
               *
               * 会议结束后并且收到了"录制完成"的事件方可获取录制文件；只有会议owner（通过开放平台预约的会议即为预约人）有权限获取；录制时间太短(&lt;5s)有可能无法生成录制文件
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=set_permission&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/set_permission document }
               *
               * 授权录制文件
               *
               * 将一个会议的录制文件授权给组织、用户或公开到公网
               *
               * 会议结束后并且收到了"录制完成"的事件方可进行授权；会议owner（通过开放平台预约的会议即为预约人）才有权限操作
               */
              setPermission: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=start&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/start document }
               *
               * 开始录制
               *
               * 在会议中开始录制。
               *
               * 会议正在进行中，且操作者具有相应权限（如果操作者为用户，必须是会中当前主持人）
               */
              start: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting.recording&apiName=stop&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/meeting-recording/stop document }
               *
               * 停止录制
               *
               * 在会议中停止录制。
               *
               * 会议正在录制中，且操作者具有相应权限（如果操作者为用户，必须是会中当前主持人）
               */
              stop: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * meeting_list
             */
            meetingList: {
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/meeting_list`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=meeting_list&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=meeting_list&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/meeting_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * participant_list
             */
            participantList: {
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_list`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=participant_list&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_list&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * participant_quality_list
             */
            participantQualityList: {
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_quality_list`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=participant_quality_list&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=participant_quality_list&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/participant_quality_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 会议报告
             */
            report: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=report&apiName=get_daily&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_daily document }
               *
               * 获取会议报告
               *
               * 获取一段时间内组织的每日会议使用报告。
               *
               * 支持最近90天内的数据查询
               */
              getDaily: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reports/get_daily`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=report&apiName=get_top_user&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/report/get_top_user document }
               *
               * 获取top用户列表
               *
               * 获取一段时间内组织内会议使用的top用户列表。
               *
               * 支持最近90天内的数据查询；默认返回前10位，最多可查询前100位
               */
              getTopUser: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reports/get_top_user`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 预约
             */
            reserve: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=apply&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/apply document }
               *
               * 预约会议
               *
               * 创建一个会议预约。
               *
               * 支持预约最近30天内的会议（到期时间距离当前时间不超过30天），预约到期后会议号将被释放，如需继续使用可通过"更新预约"接口进行续期；预约会议时可配置参会人在会中的权限，以达到控制会议的目的
               */
              apply: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/apply`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/delete document }
               *
               * 删除预约
               *
               * 删除一个预约
               *
               * 只能删除归属于自己的预约；删除后数据不可恢复
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get document }
               *
               * 获取预约
               *
               * 获取一个预约的详情
               *
               * 只能获取归属于自己的预约
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=get_active_meeting&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/get_active_meeting document }
               *
               * 获取活跃会议
               *
               * 获取一个预约的当前活跃会议
               *
               * 只能获取归属于自己的预约的活跃会议（一个预约最多有一个正在进行中的会议）
               */
              getActiveMeeting: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve&apiName=update&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve/update document }
               *
               * 更新预约
               *
               * 更新一个预约
               *
               * 只能更新归属于自己的预约，不需要更新的字段不传（如果传空则会被更新为空）；可用于续期操作，到期时间距离当前时间不超过30天
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * reserve_config.admin
             */
            reserveConfigAdmin: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.admin&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.admin&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.admin&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.admin&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * reserve_config.disable_inform
             */
            reserveConfigDisableInform: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.disable_inform&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.disable_inform&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.disable_inform&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.disable_inform&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * reserve_config.form
             */
            reserveConfigForm: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.form&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=reserve_config.form&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config.form&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=vc&resource=reserve_config.form&version=v1 document }
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * reserve_config
             */
            reserveConfig: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/patch document }
               *
               * 更新会议室预定范围
               *
               * 更新会议室预定范围
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=reserve_config&apiName=reserve_scope&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/reserve_config/reserve_scope document }
               *
               * 获取会议室预定范围
               *
               * 获取会议室预定范围
               */
              reserveScope: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * resource_reservation_list
             */
            resourceReservationList: {
              getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/resource_reservation_list`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=resource_reservation_list&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=vc&resource=resource_reservation_list&version=v1 document }
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/resource_reservation_list`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 会议室
             */
            room: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/create document }
               *
               * 创建会议室
               *
               * 该接口用于创建会议室
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=delete&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/delete document }
               *
               * 删除会议室
               *
               * 该接口可以用来删除某个会议室
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/get document }
               *
               * 查询会议室详情
               *
               * 该接口可以使用会议室ID查询会议室详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/list document }
               *
               * 查询会议室列表
               *
               * 该接口可以用来查询某个会议室层级下会议室列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=mget&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/mget document }
               *
               * 批量查询会议室详情
               *
               * 该接口可以使用会议室ID批量查询会议室详情
               */
              mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/mget`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/patch document }
               *
               * 更新会议室
               *
               * 该接口可以用来更新某个会议室的信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/:room_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room/search document }
               *
               * 搜索会议室
               *
               * 该接口可以用来搜索会议室，支持使用关键词进行搜索，也支持使用自定义会议室ID进行查询
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/rooms/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * room_config
             */
            roomConfig: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=query&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=vc&resource=room_config&version=v1 document }
               */
              query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/query`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set&project=vc&resource=room_config&version=v1 document }
               */
              set: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set_checkboard_access_code&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_checkboard_access_code&project=vc&resource=room_config&version=v1 document }
               */
              setCheckboardAccessCode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_config&apiName=set_room_access_code&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=set_room_access_code&project=vc&resource=room_config&version=v1 document }
               */
              setRoomAccessCode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 会议室层级
             */
            roomLevel: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/create document }
               *
               * 创建会议室层级
               *
               * 该接口用于创建会议室层级
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=del&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/del document }
               *
               * 删除会议室层级
               *
               * 该接口可以用来删除某个会议室层级
               */
              del: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/del`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/get document }
               *
               * 查询会议室层级详情
               *
               * 该接口可以使用会议室层级ID查询会议室层级详情
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=list&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/list document }
               *
               * 查询会议室层级列表
               *
               * 该接口用来查询某个会议室层级下的子层级列表
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=mget&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/mget document }
               *
               * 批量查询会议室层级详情
               *
               * 该接口可以使用会议室层级ID批量查询会议室层级详情
               */
              mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/mget`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=patch&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/patch document }
               *
               * 更新会议室层级
               *
               * 该接口可以用来更新某个会议室层级的信息
               */
              patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`, path2),
                  method: "PATCH",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=room_level&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/room_level/search document }
               *
               * 搜索会议室层级
               *
               * 该接口可以用来搜索会议室层级，支持使用自定义会议室层级ID进行查询
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/room_levels/search`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 会议室配置
             */
            scopeConfig: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=scope_config&apiName=create&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/create document }
               *
               * 设置会议室配置
               *
               * 该接口可以用来设置某个会议层级范围下或者某个会议室的配置
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/scope_config`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=vc&resource=scope_config&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/scope_config/get document }
               *
               * 查询会议室配置
               *
               * 该接口可以用来查询某个会议层级范围下或者某个会议室的配置
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/vc/v1/scope_config`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$3 = class extends Client$4 {
      constructor() {
        super(...arguments);
        this.verification = {
          v1: {
            /**
             * 认证信息
             */
            verification: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=verification&resource=verification&apiName=get&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/verification-v1/verification/get document }
               *
               * 获取认证信息
               *
               * 获取企业主体名称、是否认证等信息。
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/verification/v1/verification`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$2 = class extends Client$3 {
      constructor() {
        super(...arguments);
        this.wiki = {
          space: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create document }
             *
             * 创建知识空间
             *
             * 此接口用于创建知识空间
             *
             * 此接口不支持tenant access token（应用身份访问）
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=get&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get document }
             *
             * 获取知识空间信息
             *
             * 此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型（type）：;- 个人空间：归个人管理。一人仅可拥有一个个人空间，无法添加其他管理员。;- 团队空间：归团队（多人)管理，可添加多个管理员。;;空间可见性（visibility）：;- 公开空间：租户所有用户可见，默认为成员权限。无法额外添加成员，但可以添加管理员。;- 私有空间：仅对知识空间管理员、成员可见，需要手动添加管理员、成员。
             *
             * 本接口要求知识库权限：;- 需要为知识空间成员（管理员）
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=get_node&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node document }
             *
             * 获取知识空间节点信息
             *
             * 获取知识空间节点信息
             *
             * 知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 节点阅读权限
             */
            getNode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/get_node`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=list&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list document }
             *
             * 获取知识空间列表
             *
             * 此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤，可能返回列表为空，但分页标记（has_more）为true，可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get)
             *
             * 使用tenant access token调用时，请确认应用/机器人拥有部分知识空间的访问权限，否则返回列表容易为空。
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          spaceMember: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create document }
             *
             * 添加知识空间成员
             *
             * 添加知识空间成员或管理员。
             *
             * 知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制：;- 可见性限制：公开知识空间（visibility为public）对租户所有用户可见，因此不支持再添加成员，但可以添加管理员。;- 类型限制：个人知识空间 （type为person）为个人管理的知识空间，不支持添加其他管理员（包括应用/机器人）。但可以添加成员。;;;知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 为知识空间管理员
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=delete&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete document }
             *
             * 删除知识空间成员
             *
             * 此接口用于删除知识空间成员或管理员。
             *
             * 知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制：;- 可见性限制：公开知识空间（visibility为public）对租户所有用户可见，因此不支持再删除成员，但可以删除管理员。;- 类型限制：个人知识空间 （type为person）为个人管理的知识空间，不支持删除管理员。但可以删除成员。;;;知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 为知识空间管理员
             */
            delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`, path2),
                method: "DELETE",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=list&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=wiki&resource=space.member&version=v2 document }
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          spaceNode: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=copy&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy document }
             *
             * 创建知识空间节点副本
             *
             * 此接口用于在知识空间创建节点副本到指定位置。
             */
            copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=create&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create document }
             *
             * 创建知识空间节点
             *
             * 此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。
             *
             * 知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- **父节点**容器编辑权限
             */
            create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                const res = yield this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                  method: "GET",
                  headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                  params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                  data,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                });
                return res;
              });
              const Iterable = {
                [Symbol.asyncIterator]() {
                  return __asyncGenerator(this, arguments, function* _a() {
                    let hasMore = true;
                    let pageToken;
                    while (hasMore) {
                      try {
                        const res = yield __await(sendRequest({
                          headers,
                          params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                          data
                        }));
                        const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                          // @ts-ignore
                          has_more,
                          // @ts-ignore
                          page_token,
                          // @ts-ignore
                          next_page_token
                        } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                        yield yield __await(rest);
                        hasMore = Boolean(has_more);
                        pageToken = page_token || next_page_token;
                      } catch (e3) {
                        yield yield __await(null);
                        break;
                      }
                    }
                  });
                }
              };
              return Iterable;
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=list&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list document }
             *
             * 获取知识空间子节点列表
             *
             * 此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤，可能返回列表为空，但分页标记（has_more）为true，可以继续分页请求。
             *
             * 知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 父节点阅读权限
             */
            list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=move&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move document }
             *
             * 移动知识空间节点
             *
             * 此方法用于在Wiki内移动节点，支持跨知识空间移动。如果有子节点，会携带子节点一起移动。
             *
             * 知识库权限要求：;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限
             */
            move: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=move_docs_to_wiki&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki document }
             *
             * 移动云空间文档至知识空间
             *
             * 该接口允许移动云空间文档至知识空间，并挂载在指定位置
             *
             * 此接口为异步接口。若移动已完成（或文档已在Wiki中），则直接返回结果（Wiki token）。若尚未完成，则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限
             *
             * ### 移动操作 ###;移动后，文档将从“我的空间”或“共享空间”转移至“知识库”后，无法从下列入口查看到文档：;- 云空间主页：快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后，文档会向所有可查看“页面树”的用户显示，默认继承父页面的权限设置。;</md-alert
             */
            moveDocsToWiki: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            }),
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=update_title&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title document }
             *
             * 更新知识空间节点标题
             *
             * 此接口用于更新节点标题
             *
             * 此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。
             */
            updateTitle: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          spaceSetting: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.setting&apiName=update&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update document }
             *
             * 更新知识空间设置
             *
             * 根据space_id更新知识空间公共设置
             *
             * 知识库权限要求：;- 为知识空间管理员
             */
            update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`, path2),
                method: "PUT",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          task: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=task&apiName=get&version=v2 click to debug }
             *
             * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get document }
             *
             * 获取任务结果
             *
             * 该方法用于获取wiki异步任务的结果
             *
             * 知识库权限要求，当前 access token 所代表的用户或应用（机器人）：;- 为任务创建者
             */
            get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`, path2),
                method: "GET",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * 知识库
             */
            node: {
              searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path2),
                    method: "POST",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=node&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uEzN0YjLxcDN24SM3QjN/search_wiki document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          },
          v2: {
            /**
             * 知识空间
             */
            space: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/create document }
               *
               * 创建知识空间
               *
               * 此接口用于创建知识空间
               *
               * 此接口不支持tenant access token（应用身份访问）
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get document }
               *
               * 获取知识空间信息
               *
               * 此接口用于根据知识空间ID来查询知识空间的信息。;;空间类型（type）：;- 个人空间：归个人管理。一人仅可拥有一个个人空间，无法添加其他管理员。;- 团队空间：归团队（多人)管理，可添加多个管理员。;;空间可见性（visibility）：;- 公开空间：租户所有用户可见，默认为成员权限。无法额外添加成员，但可以添加管理员。;- 私有空间：仅对知识空间管理员、成员可见，需要手动添加管理员、成员。
               *
               * 本接口要求知识库权限：;- 需要为知识空间成员（管理员）
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=get_node&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get_node document }
               *
               * 获取知识空间节点信息
               *
               * 获取知识空间节点信息
               *
               * 知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 节点阅读权限
               */
              getNode: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/get_node`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/list document }
               *
               * 获取知识空间列表
               *
               * 此接口用于获取有权限访问的知识空间列表。;;此接口为分页接口。由于权限过滤，可能返回列表为空，但分页标记（has_more）为true，可以继续分页请求。;;对于知识空间各项属性描述请参阅[获取知识空间信息](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space/get)
               *
               * 使用tenant access token调用时，请确认应用/机器人拥有部分知识空间的访问权限，否则返回列表容易为空。
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 空间成员
             */
            spaceMember: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/create document }
               *
               * 添加知识空间成员
               *
               * 添加知识空间成员或管理员。
               *
               * 知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制：;- 可见性限制：公开知识空间（visibility为public）对租户所有用户可见，因此不支持再添加成员，但可以添加管理员。;- 类型限制：个人知识空间 （type为person）为个人管理的知识空间，不支持添加其他管理员（包括应用/机器人）。但可以添加成员。;;;知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 为知识空间管理员
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=delete&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-member/delete document }
               *
               * 删除知识空间成员
               *
               * 此接口用于删除知识空间成员或管理员。
               *
               * 知识空间具有[类型](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)和[可见性](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)的概念。不同的类型或可见性可以对本操作做出限制：;- 可见性限制：公开知识空间（visibility为public）对租户所有用户可见，因此不支持再删除成员，但可以删除管理员。;- 类型限制：个人知识空间 （type为person）为个人管理的知识空间，不支持删除管理员。但可以删除成员。;;;知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 为知识空间管理员
               */
              delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`, path2),
                  method: "DELETE",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=wiki&resource=space.member&version=v2 document }
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 节点
             */
            spaceNode: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=copy&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/copy document }
               *
               * 创建知识空间节点副本
               *
               * 此接口用于在知识空间创建节点副本到指定位置。
               */
              copy: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=create&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/create document }
               *
               * 创建知识空间节点
               *
               * 此接口用于在知识节点里创建[节点](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-overview)到指定位置。
               *
               * 知识空间权限要求，当前使用的 access token 所代表的应用或用户拥有：;- **父节点**容器编辑权限
               */
              create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
                  const res = yield this.httpInstance.request({
                    url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                    method: "GET",
                    headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
                    params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
                    data,
                    paramsSerializer: (params2) => qs.stringify(params2, {
                      arrayFormat: "repeat"
                    })
                  }).catch((e3) => {
                    this.logger.error(formatErrors(e3));
                  });
                  return res;
                });
                const Iterable = {
                  [Symbol.asyncIterator]() {
                    return __asyncGenerator(this, arguments, function* _a() {
                      let hasMore = true;
                      let pageToken;
                      while (hasMore) {
                        try {
                          const res = yield __await(sendRequest({
                            headers,
                            params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
                            data
                          }));
                          const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
                            // @ts-ignore
                            has_more,
                            // @ts-ignore
                            page_token,
                            // @ts-ignore
                            next_page_token
                          } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
                          yield yield __await(rest);
                          hasMore = Boolean(has_more);
                          pageToken = page_token || next_page_token;
                        } catch (e3) {
                          yield yield __await(null);
                          break;
                        }
                      }
                    });
                  }
                };
                return Iterable;
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=list&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/list document }
               *
               * 获取知识空间子节点列表
               *
               * 此接口用于分页获取Wiki节点的子节点列表。;;此接口为分页接口。由于权限过滤，可能返回列表为空，但分页标记（has_more）为true，可以继续分页请求。
               *
               * 知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 父节点阅读权限
               */
              list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=move&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move document }
               *
               * 移动知识空间节点
               *
               * 此方法用于在Wiki内移动节点，支持跨知识空间移动。如果有子节点，会携带子节点一起移动。
               *
               * 知识库权限要求：;- 节点编辑权限;- 原父节点容器编辑权限;- 目的父节点容器编辑权限
               */
              move: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=move_docs_to_wiki&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/move_docs_to_wiki document }
               *
               * 移动云空间文档至知识空间
               *
               * 该接口允许移动云空间文档至知识空间，并挂载在指定位置
               *
               * 此接口为异步接口。若移动已完成（或文档已在Wiki中），则直接返回结果（Wiki token）。若尚未完成，则返回task id。请使用[获取任务结果](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get)接口进行查询。;;知识库权限要求，当前使用的 access token 所代表的应用或用户拥有：;- 文档可管理权限;- 原文件夹编辑权限;- 目标父节点容器编辑权限
               *
               * ### 移动操作 ###;移动后，文档将从“我的空间”或“共享空间”转移至“知识库”后，无法从下列入口查看到文档：;- 云空间主页：快速访问;- 我的空间;- 共享空间;;### 权限变更 ###;移动后，文档会向所有可查看“页面树”的用户显示，默认继承父页面的权限设置。;</md-alert
               */
              moveDocsToWiki: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              }),
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=update_title&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-node/update_title document }
               *
               * 更新知识空间节点标题
               *
               * 此接口用于更新节点标题
               *
               * 此接口目前仅支持文档(doc)、新版文档(docx)和快捷方式。
               */
              updateTitle: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 空间设置
             */
            spaceSetting: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.setting&apiName=update&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/space-setting/update document }
               *
               * 更新知识空间设置
               *
               * 根据space_id更新知识空间公共设置
               *
               * 知识库权限要求：;- 为知识空间管理员
               */
              update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`, path2),
                  method: "PUT",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * 云文档
             */
            task: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=task&apiName=get&version=v2 click to debug }
               *
               * {@link https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/wiki-v2/task/get document }
               *
               * 获取任务结果
               *
               * 该方法用于获取wiki异步任务的结果
               *
               * 知识库权限要求，当前 access token 所代表的用户或应用（机器人）：;- 为任务创建者
               */
              get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`, path2),
                  method: "GET",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var Client$1 = class extends Client$2 {
      constructor() {
        super(...arguments);
        this.workplace = {
          /**
           * custom_workplace_access_data
           */
          customWorkplaceAccessData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=custom_workplace_access_data&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * workplace_access_data
           */
          workplaceAccessData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=workplace_access_data&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          /**
           * workplace_block_access_data
           */
          workplaceBlockAccessData: {
            /**
             * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=workplace_block_access_data&apiName=search&version=v1 click to debug }
             *
             * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 document }
             */
            search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
              const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
              return this.httpInstance.request({
                url: fillApiPath(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`, path2),
                method: "POST",
                data,
                params,
                headers,
                paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
              }).catch((e3) => {
                this.logger.error(formatErrors(e3));
                throw e3;
              });
            })
          },
          v1: {
            /**
             * custom_workplace_access_data
             */
            customWorkplaceAccessData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=custom_workplace_access_data&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=custom_workplace_access_data&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workplace_access_data
             */
            workplaceAccessData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=workplace_access_data&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_access_data&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            },
            /**
             * workplace_block_access_data
             */
            workplaceBlockAccessData: {
              /**
               * {@link https://open.feishu.cn/api-explorer?project=workplace&resource=workplace_block_access_data&apiName=search&version=v1 click to debug }
               *
               * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=workplace&resource=workplace_block_access_data&version=v1 document }
               */
              search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
                const { headers, params, data, path: path2 } = yield this.formatPayload(payload, options);
                return this.httpInstance.request({
                  url: fillApiPath(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`, path2),
                  method: "POST",
                  data,
                  params,
                  headers,
                  paramsSerializer: (params2) => qs.stringify(params2, { arrayFormat: "repeat" })
                }).catch((e3) => {
                  this.logger.error(formatErrors(e3));
                  throw e3;
                });
              })
            }
          }
        };
      }
    };
    var defaultLogger = {
      error: (...msg) => {
        console.log("[error]:", ...msg);
      },
      warn: (...msg) => {
        console.warn("[warn]:", ...msg);
      },
      info: (...msg) => {
        console.info("[info]:", ...msg);
      },
      debug: (...msg) => {
        console.debug("[debug]:", ...msg);
      },
      trace: (...msg) => {
        console.trace("[trace]:", ...msg);
      }
    };
    var LoggerProxy = class {
      constructor(level, logger18) {
        this.level = level;
        this.logger = logger18;
      }
      error(...msg) {
        if (this.level >= exports2.LoggerLevel.error) {
          this.logger.error(msg);
        }
      }
      warn(...msg) {
        if (this.level >= exports2.LoggerLevel.warn) {
          this.logger.warn(msg);
        }
      }
      info(...msg) {
        if (this.level >= exports2.LoggerLevel.info) {
          this.logger.info(msg);
        }
      }
      debug(...msg) {
        if (this.level >= exports2.LoggerLevel.debug) {
          this.logger.debug(msg);
        }
      }
      trace(...msg) {
        if (this.level >= exports2.LoggerLevel.trace) {
          this.logger.trace(msg);
        }
      }
    };
    var AppTicketManager = class {
      constructor(params) {
        this.appId = params.appId;
        this.appSecret = params.appSecret;
        this.cache = params.cache;
        this.domain = params.domain;
        this.logger = params.logger;
        this.appType = params.appType;
        this.httpInstance = params.httpInstance;
        this.logger.debug("app ticket manager is ready");
        this.checkAppTicket();
      }
      checkAppTicket() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          if (this.appType === exports2.AppType.ISV) {
            const appTicket = yield (_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket, {
              namespace: this.appId
            });
            if (!appTicket) {
              this.requestAppTicket();
            }
          }
        });
      }
      requestAppTicket() {
        return __awaiter(this, void 0, void 0, function* () {
          this.logger.debug("request app ticket");
          yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`, {
            app_id: this.appId,
            app_secret: this.appSecret
          }).catch((e3) => {
            this.logger.error(e3);
          });
        });
      }
      getAppTicket() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          const appTicket = yield (_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket, {
            namespace: this.appId
          });
          if (appTicket) {
            this.logger.debug("use cache app ticket");
            return appTicket;
          }
          yield this.requestAppTicket();
          return void 0;
        });
      }
    };
    var TokenManager = class {
      constructor(params) {
        this.appId = params.appId;
        this.appSecret = params.appSecret;
        this.cache = params.cache;
        this.domain = params.domain;
        this.logger = params.logger;
        this.appType = params.appType;
        this.httpInstance = params.httpInstance;
        this.appTicketManager = new AppTicketManager({
          appId: this.appId,
          appSecret: this.appSecret,
          cache: this.cache,
          domain: this.domain,
          logger: this.logger,
          appType: this.appType,
          httpInstance: this.httpInstance
        });
        this.logger.debug("token manager is ready");
      }
      getCustomTenantAccessToken() {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
          const cachedTenantAccessToken = yield (_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CTenantAccessToken, {
            namespace: this.appId
          });
          if (cachedTenantAccessToken) {
            this.logger.debug("use cache token");
            return cachedTenantAccessToken;
          }
          this.logger.debug("request token");
          const { tenant_access_token, expire } = yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`, {
            app_id: this.appId,
            app_secret: this.appSecret
          }).catch((e3) => {
            this.logger.error(e3);
          });
          yield (_b = this.cache) === null || _b === void 0 ? void 0 : _b.set(
            CTenantAccessToken,
            tenant_access_token,
            // Due to the time-consuming network, the expiration time needs to be 3 minutes earlier
            (/* @__PURE__ */ new Date()).getTime() + expire * 1e3 - 3 * 60 * 1e3,
            {
              namespace: this.appId
            }
          );
          return tenant_access_token;
        });
      }
      getMarketTenantAccessToken(tenantKey) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          if (!tenantKey) {
            this.logger.error("market app request need tenant key");
            return void 0;
          }
          const tenantAccessToken = yield (_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(`larkMarketAccessToken${tenantKey}`, {
            namespace: this.appId
          });
          if (tenantAccessToken) {
            this.logger.debug("use cache token");
            return tenantAccessToken;
          }
          this.logger.debug("get app ticket");
          const appTicket = yield this.appTicketManager.getAppTicket();
          if (!appTicket) {
            this.logger.warn("no app ticket");
            return void 0;
          }
          this.logger.debug("get app access token");
          const { app_access_token } = yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_access_token`, {
            app_id: this.appId,
            app_secret: this.appSecret,
            app_ticket: appTicket
          }).catch((e3) => {
            this.logger.error(e3);
          });
          this.logger.debug("get tenant access token");
          const { tenant_access_token, expire } = yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/tenant_access_token`, {
            app_access_token,
            tenant_key: tenantKey
          }).catch((e3) => {
            this.logger.error(e3);
          });
          yield this.cache.set(
            `larkMarketAccessToken${tenantKey}`,
            tenant_access_token,
            // Due to the time-consuming network, the expiration time needs to be 3 minutes earlier
            (/* @__PURE__ */ new Date()).getTime() + expire * 1e3 - 3 * 60 * 1e3,
            {
              namespace: this.appId
            }
          );
          return tenant_access_token;
        });
      }
      getTenantAccessToken(params) {
        return __awaiter(this, void 0, void 0, function* () {
          assert(this.appType === exports2.AppType.SelfBuild, () => __awaiter(this, void 0, void 0, function* () {
            this.logger.debug("get custom app token");
          }));
          assert(this.appType === exports2.AppType.ISV, () => __awaiter(this, void 0, void 0, function* () {
            this.logger.debug("get market app token ");
          }));
          const tenantAccessToken = this.appType === exports2.AppType.SelfBuild ? yield this.getCustomTenantAccessToken() : yield this.getMarketTenantAccessToken(params === null || params === void 0 ? void 0 : params[CTenantKey]);
          return tenantAccessToken;
        });
      }
    };
    var mergeObject = (obj1, obj2) => {
      const mergedObject = Object.assign({}, obj1);
      for (let [key, value] of Object.entries(obj2)) {
        if (value !== void 0) {
          mergedObject[key] = value;
        }
      }
      return mergedObject;
    };
    var UserAccessToken = class {
      constructor(params) {
        this.client = params.client;
      }
      getCacheKey(key, options) {
        const namespace = (options === null || options === void 0 ? void 0 : options.namespace) || this.client.appId;
        return `${namespace}/${CUserAccessToken.toString()}/${key}`;
      }
      // the unit of time is seconds
      calibrateTime(time) {
        return (/* @__PURE__ */ new Date()).getTime() + (time || 0) * 1e3 - 3 * 60 * 1e3;
      }
      initWithCode(key2Code, options) {
        return __awaiter(this, void 0, void 0, function* () {
          const key2Info = {};
          for (const [key, code] of Object.entries(key2Code)) {
            const oidcAccessInfo = yield this.client.authen.oidcAccessToken.create({
              data: {
                grant_type: "authorization_code",
                code
              }
            });
            if (oidcAccessInfo.code !== 0) {
              this.client.logger.error("init user access token error", key, oidcAccessInfo.msg || oidcAccessInfo.message);
              continue;
            }
            if (!oidcAccessInfo.data) {
              this.client.logger.error("user access code expired", key, code);
              continue;
            }
            key2Info[key] = {
              code,
              token: oidcAccessInfo.data.access_token,
              refreshToken: oidcAccessInfo.data.refresh_token,
              expiredTime: this.calibrateTime(oidcAccessInfo.data.expires_in)
            };
          }
          yield this.update(key2Info, { namespace: options === null || options === void 0 ? void 0 : options.namespace });
          return key2Info;
        });
      }
      update(key2Info, options) {
        return __awaiter(this, void 0, void 0, function* () {
          for (const [key, info] of Object.entries(key2Info)) {
            const cacheKey = this.getCacheKey(key, { namespace: options === null || options === void 0 ? void 0 : options.namespace });
            const cacheValue = (yield this.client.cache.get(cacheKey)) || {};
            const { code, token: token2, refreshToken, expiredTime } = info;
            const targetValue = mergeObject(cacheValue, { code, token: token2, refreshToken, expiredTime });
            yield this.client.cache.set(cacheKey, targetValue, Infinity);
          }
        });
      }
      get(key, options) {
        return __awaiter(this, void 0, void 0, function* () {
          const cacheKey = this.getCacheKey(key, { namespace: options === null || options === void 0 ? void 0 : options.namespace });
          const cacheInfo = yield this.client.cache.get(cacheKey);
          if (!cacheInfo) {
            this.client.logger.error("user access token needs to be initialized or updated first");
            return;
          }
          const { token: token2, code, refreshToken, expiredTime } = cacheInfo;
          if (token2 && expiredTime && expiredTime - (/* @__PURE__ */ new Date()).getTime() > 0) {
            return token2;
          }
          if (refreshToken) {
            const refreshAccessInfo = yield this.client.authen.oidcRefreshAccessToken.create({
              data: {
                grant_type: "refresh_token",
                refresh_token: refreshToken
              }
            });
            if (refreshAccessInfo.code === 0 && refreshAccessInfo.data) {
              yield this.update({
                [key]: {
                  token: refreshAccessInfo.data.access_token,
                  refreshToken: refreshAccessInfo.data.refresh_token,
                  expiredTime: this.calibrateTime(refreshAccessInfo.data.expires_in)
                }
              });
              return refreshAccessInfo.data.access_token;
            } else {
              this.client.logger.error("get user access token by refresh token failed.", refreshAccessInfo.msg);
              return;
            }
          }
          if (code) {
            const oidcAccessInfo = yield this.client.authen.oidcAccessToken.create({
              data: {
                grant_type: "authorization_code",
                code
              }
            });
            if (oidcAccessInfo.code === 0 && oidcAccessInfo.data) {
              yield this.update({
                [key]: {
                  token: oidcAccessInfo.data.access_token,
                  refreshToken: oidcAccessInfo.data.refresh_token,
                  expiredTime: this.calibrateTime(oidcAccessInfo.data.expires_in)
                }
              });
            } else {
              this.client.logger.error("get user access token by code failed.", oidcAccessInfo.msg);
            }
          }
          return;
        });
      }
    };
    var Client = class extends Client$1 {
      constructor(params) {
        super();
        this.appId = "";
        this.appSecret = "";
        this.helpDeskId = "";
        this.helpDeskToken = "";
        this.appType = exports2.AppType.SelfBuild;
        this.logger = new LoggerProxy(params.loggerLevel || exports2.LoggerLevel.info, params.logger || defaultLogger);
        this.appId = params.appId;
        this.appSecret = params.appSecret;
        this.disableTokenCache = params.disableTokenCache;
        assert(!this.appId, () => this.logger.error("appId is needed"));
        assert(!this.appSecret, () => this.logger.error("appSecret is needed"));
        this.helpDeskId = params.helpDeskId;
        this.helpDeskToken = params.helpDeskToken;
        this.appType = (params === null || params === void 0 ? void 0 : params.appType) || exports2.AppType.SelfBuild;
        this.domain = formatDomain(params.domain || exports2.Domain.Feishu);
        this.logger.debug(`use domain url: ${this.domain}`);
        this.cache = params.cache || internalCache;
        this.httpInstance = params.httpInstance || defaultHttpInstance;
        this.tokenManager = new TokenManager({
          appId: this.appId,
          appSecret: this.appSecret,
          cache: this.cache,
          domain: this.domain,
          logger: this.logger,
          appType: this.appType,
          httpInstance: this.httpInstance
        });
        this.userAccessToken = new UserAccessToken({ client: this });
        this.logger.info("client ready");
      }
      formatPayload(payload, options) {
        var _a, _b, _c;
        return __awaiter(this, void 0, void 0, function* () {
          const targetOptions = [
            "lark",
            "params",
            "data",
            "headers",
            "path"
          ].reduce((acc, key) => {
            acc[key] = (options === null || options === void 0 ? void 0 : options[key]) || {};
            return acc;
          }, {});
          const userAccessToken = (_a = targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.lark) === null || _a === void 0 ? void 0 : _a[CWithUserAccessToken];
          if (userAccessToken) {
            this.logger.debug("use passed token");
            targetOptions.headers.Authorization = `Bearer ${userAccessToken}`;
          } else if (!this.disableTokenCache) {
            const tenantAccessToken = yield this.tokenManager.getTenantAccessToken({
              [CTenantKey]: (_b = targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.lark) === null || _b === void 0 ? void 0 : _b[CTenantKey]
            });
            if (tenantAccessToken) {
              targetOptions.headers.Authorization = `Bearer ${tenantAccessToken}`;
            } else {
              this.logger.warn("failed to obtain token");
            }
          }
          const withHelpDeskCredential2 = (_c = targetOptions === null || targetOptions === void 0 ? void 0 : targetOptions.lark) === null || _c === void 0 ? void 0 : _c[CWithHelpdeskAuthorization];
          if (withHelpDeskCredential2) {
            this.logger.debug("generate help desk credential");
            const helpDeskCredential = string2Base64(`${this.helpDeskId}:${this.helpDeskToken}`);
            targetOptions.headers["X-Lark-Helpdesk-Authorization"] = `Bearer ${helpDeskCredential}`;
          }
          return {
            params: Object.assign(Object.assign({}, (payload === null || payload === void 0 ? void 0 : payload.params) || {}), targetOptions.params),
            headers: Object.assign(Object.assign({ "User-Agent": "oapi-node-sdk/1.0.0" }, (payload === null || payload === void 0 ? void 0 : payload.headers) || {}), targetOptions.headers),
            data: Object.assign(Object.assign({}, (payload === null || payload === void 0 ? void 0 : payload.data) || {}), targetOptions.data),
            path: Object.assign(Object.assign({}, (payload === null || payload === void 0 ? void 0 : payload.path) || {}), targetOptions.path)
          };
        });
      }
      request(payload, options) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          const { data, params, headers, url } = payload, rest = __rest(payload, ["data", "params", "headers", "url"]);
          const formatPayload = yield this.formatPayload({
            data,
            params,
            headers
          }, options);
          const targetData = ((_a = payload.method) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "get" && Object.keys(formatPayload.data).length === 0 ? void 0 : formatPayload.data;
          this.logger.trace(`send request [${payload.method}]: ${payload.url}`);
          const res = yield this.httpInstance.request(Object.assign(Object.assign({}, rest), {
            url: /^http/.test(url) ? url : `${this.domain}/${formatUrl(url)}`,
            headers: formatPayload.headers,
            data: targetData,
            params: formatPayload.params
          })).catch((e3) => {
            this.logger.error(e3);
            throw e3;
          });
          return res;
        });
      }
    };
    var withAll = (withList) => withList.reduce((acc, cur) => merge__default["default"](acc, cur), {});
    var withTenantKey = (tenantKey) => ({
      lark: {
        [CTenantKey]: tenantKey
      }
    });
    var withHelpDeskCredential = () => ({
      lark: {
        [CWithHelpdeskAuthorization]: true
      }
    });
    var withTenantToken = (tenantAccessToken) => ({
      headers: {
        Authorization: `Bearer ${tenantAccessToken}`
      }
    });
    var withUserAccessToken = (userAccessToken) => ({
      lark: {
        [CWithUserAccessToken]: userAccessToken
      }
    });
    var RequestHandle = class {
      constructor(params) {
        const { encryptKey, verificationToken, logger: logger18 } = params;
        this.verificationToken = verificationToken;
        this.encryptKey = encryptKey;
        this.logger = logger18;
        if (encryptKey) {
          this.aesCipher = new AESCipher(encryptKey);
        }
      }
      parse(data) {
        var _a, _b;
        const targetData = (() => {
          var _a2;
          const _b2 = data || {}, { encrypt } = _b2, rest2 = __rest(_b2, ["encrypt"]);
          if (encrypt) {
            try {
              return Object.assign(Object.assign({}, JSON.parse((_a2 = this.aesCipher) === null || _a2 === void 0 ? void 0 : _a2.decrypt(encrypt))), rest2);
            } catch (e3) {
              this.logger.error("parse encrypt data failed");
              return {};
            }
          }
          return rest2;
        })();
        if ("schema" in targetData) {
          const { header, event: event2 } = targetData, rest2 = __rest(targetData, ["header", "event"]);
          return Object.assign(Object.assign(Object.assign({ [CEventType]: (_a = targetData === null || targetData === void 0 ? void 0 : targetData.header) === null || _a === void 0 ? void 0 : _a.event_type }, rest2), header), event2);
        }
        const { event } = targetData, rest = __rest(targetData, ["event"]);
        return Object.assign(Object.assign({ [CEventType]: (_b = targetData === null || targetData === void 0 ? void 0 : targetData.event) === null || _b === void 0 ? void 0 : _b.type }, event), rest);
      }
      checkIsCardEventValidated(data) {
        if ("encrypt" in data || "schema" in data) {
          return this.checkIsEventValidated(data);
        }
        const { "x-lark-request-timestamp": timestamp, "x-lark-request-nonce": nonce, "x-lark-signature": signature } = data.headers;
        if (!this.verificationToken) {
          return true;
        }
        const computedSignature = crypto__default["default"].createHash("sha1").update(timestamp + nonce + this.verificationToken + JSON.stringify(data)).digest("hex");
        return computedSignature === signature;
      }
      checkIsEventValidated(data) {
        if (!this.encryptKey) {
          return true;
        }
        const { "x-lark-request-timestamp": timestamp, "x-lark-request-nonce": nonce, "x-lark-signature": signature } = data.headers;
        const content = timestamp + nonce + this.encryptKey + JSON.stringify(data);
        const computedSignature = crypto__default["default"].createHash("sha256").update(content).digest("hex");
        return computedSignature === signature;
      }
    };
    var CAppTicketHandle = "app_ticket";
    var EventDispatcher = class {
      constructor(params) {
        this.verificationToken = "";
        this.encryptKey = "";
        this.handles = /* @__PURE__ */ new Map();
        const { encryptKey, verificationToken } = params;
        this.encryptKey = encryptKey || "";
        this.verificationToken = verificationToken || "";
        this.logger = new LoggerProxy(params.loggerLevel || exports2.LoggerLevel.info, params.logger || defaultLogger);
        this.requestHandle = new RequestHandle({
          encryptKey,
          verificationToken,
          logger: this.logger
        });
        this.cache = params.cache || internalCache;
        this.registerAppTicketHandle();
        this.logger.info("event-dispatch is ready");
      }
      registerAppTicketHandle() {
        this.register({
          app_ticket: (data) => __awaiter(this, void 0, void 0, function* () {
            const { app_ticket, app_id } = data;
            if (app_ticket) {
              yield this.cache.set(CAppTicket, app_ticket, void 0, {
                namespace: app_id
              });
              this.logger.debug("set app ticket");
            } else {
              this.logger.warn("response not include app ticket");
            }
          })
        });
      }
      register(handles) {
        Object.keys(handles).forEach((key) => {
          if (this.handles.has(key) && key !== CAppTicketHandle) {
            this.logger.error(`this ${key} handle is registered`);
          }
          this.handles.set(key, handles[key]);
          this.logger.debug(`register ${key} handle`);
        });
        return this;
      }
      invoke(data, params) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
          const needCheck = (params === null || params === void 0 ? void 0 : params.needCheck) === false ? false : true;
          if (needCheck && !((_a = this.requestHandle) === null || _a === void 0 ? void 0 : _a.checkIsEventValidated(data))) {
            this.logger.warn("verification failed event");
            return void 0;
          }
          const targetData = (_b = this.requestHandle) === null || _b === void 0 ? void 0 : _b.parse(data);
          const type = targetData[CEventType];
          if (this.handles.has(type)) {
            const ret = yield this.handles.get(type)(targetData);
            this.logger.debug(`execute ${type} handle`);
            return ret;
          }
          this.logger.warn(`no ${type} handle`);
          return `no ${type} event handle`;
        });
      }
    };
    var CardActionHandler = class {
      constructor(params, cardHandler) {
        this.verificationToken = "";
        this.encryptKey = "";
        this.handles = /* @__PURE__ */ new Map();
        const { verificationToken, encryptKey } = params;
        this.encryptKey = encryptKey || "";
        this.verificationToken = verificationToken || "";
        this.cardHandler = cardHandler;
        this.logger = new LoggerProxy(params.loggerLevel || exports2.LoggerLevel.info, params.logger || defaultLogger);
        this.requestHandle = new RequestHandle({
          encryptKey,
          verificationToken,
          logger: this.logger
        });
        this.cache = params.cache || internalCache;
        this.registerAppTicketHandle();
        this.logger.info("card-action-handle is ready");
      }
      registerAppTicketHandle() {
        this.register({
          app_ticket: (data) => __awaiter(this, void 0, void 0, function* () {
            const { app_ticket, app_id } = data;
            if (app_ticket) {
              yield this.cache.set(CAppTicket, app_ticket, void 0, {
                namespace: app_id
              });
              this.logger.debug("set app ticket");
            } else {
              this.logger.warn("response not include app ticket");
            }
          })
        });
      }
      register(handles) {
        Object.keys(handles).forEach((key) => {
          this.handles.set(key, handles[key]);
          this.logger.debug(`register ${key} handle`);
        });
        return this;
      }
      invoke(data) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
          if (!((_a = this.requestHandle) === null || _a === void 0 ? void 0 : _a.checkIsCardEventValidated(data))) {
            this.logger.warn("verification failed event");
            return void 0;
          }
          const targetData = (_b = this.requestHandle) === null || _b === void 0 ? void 0 : _b.parse(data);
          const type = targetData[CEventType];
          if (this.handles.has(type)) {
            try {
              const ret = yield this.handles.get(type)(targetData);
              return ret;
            } catch (e3) {
              this.logger.error(e3);
              return void 0;
            }
          }
          try {
            const result = yield this.cardHandler(targetData);
            this.logger.debug("execute card handle");
            return result;
          } catch (e3) {
            this.logger.error(e3);
          }
          return void 0;
        });
      }
    };
    var pickRequestData = (req) => new Promise((resolve4) => {
      let chunks = "";
      req.on("data", (chunk) => {
        chunks += chunk;
      });
      req.on("end", () => {
        try {
          const data = JSON.parse(chunks);
          resolve4(data);
        } catch (e3) {
          resolve4("");
        }
      });
    });
    var generateChallenge = (data, options) => {
      if ("encrypt" in data && !options.encryptKey) {
        throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");
      }
      const targetData = "encrypt" in data ? JSON.parse(new AESCipher(options.encryptKey).decrypt(data.encrypt)) : data;
      return {
        isChallenge: targetData.type === "url_verification",
        challenge: {
          challenge: targetData.challenge
        }
      };
    };
    var adaptDefault = (path2, dispatcher, options) => (req, res) => __awaiter(void 0, void 0, void 0, function* () {
      if (req.url !== path2) {
        return;
      }
      const data = Object.assign(/* @__PURE__ */ Object.create({
        headers: req.headers
      }), yield pickRequestData(req));
      const autoChallenge = (options === null || options === void 0 ? void 0 : options.autoChallenge) || false;
      if (autoChallenge) {
        const { isChallenge, challenge } = generateChallenge(data, {
          encryptKey: dispatcher.encryptKey
        });
        if (isChallenge) {
          res.end(JSON.stringify(challenge));
          return;
        }
      }
      const value = yield dispatcher.invoke(data);
      res.end(JSON.stringify(value));
    });
    var adaptExpress = (dispatcher, options) => (req, res) => __awaiter(void 0, void 0, void 0, function* () {
      const reqData = yield (() => __awaiter(void 0, void 0, void 0, function* () {
        if (req.body) {
          return req.body;
        }
        if (!req.complete) {
          const incomingdata = yield pickRequestData(req);
          return incomingdata;
        }
        ((options === null || options === void 0 ? void 0 : options.logger) || defaultLogger).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body");
        return null;
      }))();
      const data = Object.assign(/* @__PURE__ */ Object.create({
        headers: req.headers
      }), reqData);
      const autoChallenge = (options === null || options === void 0 ? void 0 : options.autoChallenge) || false;
      if (autoChallenge) {
        const { isChallenge, challenge } = generateChallenge(data, {
          encryptKey: dispatcher.encryptKey
        });
        if (isChallenge) {
          res.json(challenge);
          return;
        }
      }
      const value = yield dispatcher.invoke(data);
      res.json(value);
    });
    var adaptKoa = (path2, dispatcher, options) => (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
      const { originalUrl, req, request } = ctx;
      if (originalUrl === path2) {
        const reqData = yield (() => __awaiter(void 0, void 0, void 0, function* () {
          if (request.body) {
            return request.body;
          }
          if (!req.complete) {
            const incomingdata = yield pickRequestData(req);
            return incomingdata;
          }
          ((options === null || options === void 0 ? void 0 : options.logger) || defaultLogger).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body");
          return null;
        }))();
        const data = Object.assign(/* @__PURE__ */ Object.create({
          headers: req.headers
        }), reqData);
        const autoChallenge = (options === null || options === void 0 ? void 0 : options.autoChallenge) || false;
        if (autoChallenge) {
          const { isChallenge, challenge } = generateChallenge(data, {
            encryptKey: dispatcher.encryptKey
          });
          if (isChallenge) {
            ctx.body = challenge;
            yield next();
            return;
          }
        }
        const value = yield dispatcher.invoke(data);
        ctx.body = JSON.stringify(value);
      }
      yield next();
    });
    var adaptKoaRouter = (dispatcher, options) => (ctx, next) => __awaiter(void 0, void 0, void 0, function* () {
      const { req, request } = ctx;
      const reqData = yield (() => __awaiter(void 0, void 0, void 0, function* () {
        if (request.body) {
          return request.body;
        }
        if (!req.complete) {
          const incomingdata = yield pickRequestData(req);
          return incomingdata;
        }
        ((options === null || options === void 0 ? void 0 : options.logger) || defaultLogger).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body");
        return null;
      }))();
      const data = Object.assign(/* @__PURE__ */ Object.create({
        headers: req.headers
      }), reqData);
      const autoChallenge = (options === null || options === void 0 ? void 0 : options.autoChallenge) || false;
      if (autoChallenge) {
        const { isChallenge, challenge } = generateChallenge(data, {
          encryptKey: dispatcher.encryptKey
        });
        if (isChallenge) {
          ctx.body = challenge;
          yield next();
          return;
        }
      }
      const value = yield dispatcher.invoke(data);
      ctx.body = JSON.stringify(value);
      yield next();
    });
    var defaultCard = (variables) => {
      const { title, content } = variables;
      return JSON.stringify({
        "config": {
          "wide_screen_mode": true
        },
        "elements": [
          {
            "tag": "markdown",
            "content": content
          }
        ],
        "header": {
          "template": "blue",
          "title": {
            "content": title,
            "tag": "plain_text"
          }
        }
      });
    };
    var messageCard = /* @__PURE__ */ Object.freeze({
      __proto__: null,
      defaultCard
    });
    var $protobuf = require_minimal2();
    $protobuf.util.Long = void 0;
    $protobuf.configure();
    var $Reader = $protobuf.Reader;
    var $Writer = $protobuf.Writer;
    var $util = $protobuf.util;
    var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
    var pbbp2 = $root.pbbp2 = (() => {
      const pbbp22 = {};
      pbbp22.Header = function() {
        function Header(properties) {
          if (properties) {
            for (let keys = Object.keys(properties), i3 = 0; i3 < keys.length; ++i3)
              if (properties[keys[i3]] != null)
                this[keys[i3]] = properties[keys[i3]];
          }
        }
        Header.prototype.key = "";
        Header.prototype.value = "";
        Header.create = function create(properties) {
          return new Header(properties);
        };
        Header.encode = function encode(message, writer) {
          if (!writer)
            writer = $Writer.create();
          writer.uint32(
            /* id 1, wireType 2 =*/
            10
          ).string(message.key);
          writer.uint32(
            /* id 2, wireType 2 =*/
            18
          ).string(message.value);
          return writer;
        };
        Header.encodeDelimited = function encodeDelimited(message, writer) {
          return this.encode(message, writer).ldelim();
        };
        Header.decode = function decode2(reader, length) {
          if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
          let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.pbbp2.Header();
          while (reader.pos < end) {
            let tag = reader.uint32();
            switch (tag >>> 3) {
              case 1: {
                message.key = reader.string();
                break;
              }
              case 2: {
                message.value = reader.string();
                break;
              }
              default:
                reader.skipType(tag & 7);
                break;
            }
          }
          if (!message.hasOwnProperty("key"))
            throw $util.ProtocolError("missing required 'key'", { instance: message });
          if (!message.hasOwnProperty("value"))
            throw $util.ProtocolError("missing required 'value'", { instance: message });
          return message;
        };
        Header.decodeDelimited = function decodeDelimited(reader) {
          if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
          return this.decode(reader, reader.uint32());
        };
        Header.verify = function verify(message) {
          if (typeof message !== "object" || message === null)
            return "object expected";
          if (!$util.isString(message.key))
            return "key: string expected";
          if (!$util.isString(message.value))
            return "value: string expected";
          return null;
        };
        Header.fromObject = function fromObject(object) {
          if (object instanceof $root.pbbp2.Header)
            return object;
          let message = new $root.pbbp2.Header();
          if (object.key != null)
            message.key = String(object.key);
          if (object.value != null)
            message.value = String(object.value);
          return message;
        };
        Header.toObject = function toObject(message, options) {
          if (!options)
            options = {};
          let object = {};
          if (options.defaults) {
            object.key = "";
            object.value = "";
          }
          if (message.key != null && message.hasOwnProperty("key"))
            object.key = message.key;
          if (message.value != null && message.hasOwnProperty("value"))
            object.value = message.value;
          return object;
        };
        Header.prototype.toJSON = function toJSON() {
          return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };
        Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
          if (typeUrlPrefix === void 0) {
            typeUrlPrefix = "type.googleapis.com";
          }
          return typeUrlPrefix + "/pbbp2.Header";
        };
        return Header;
      }();
      pbbp22.Frame = function() {
        function Frame(properties) {
          this.headers = [];
          if (properties) {
            for (let keys = Object.keys(properties), i3 = 0; i3 < keys.length; ++i3)
              if (properties[keys[i3]] != null)
                this[keys[i3]] = properties[keys[i3]];
          }
        }
        Frame.prototype.SeqID = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
        Frame.prototype.LogID = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
        Frame.prototype.service = 0;
        Frame.prototype.method = 0;
        Frame.prototype.headers = $util.emptyArray;
        Frame.prototype.payloadEncoding = "";
        Frame.prototype.payloadType = "";
        Frame.prototype.payload = $util.newBuffer([]);
        Frame.prototype.LogIDNew = "";
        Frame.create = function create(properties) {
          return new Frame(properties);
        };
        Frame.encode = function encode(message, writer) {
          if (!writer)
            writer = $Writer.create();
          writer.uint32(
            /* id 1, wireType 0 =*/
            8
          ).uint64(message.SeqID);
          writer.uint32(
            /* id 2, wireType 0 =*/
            16
          ).uint64(message.LogID);
          writer.uint32(
            /* id 3, wireType 0 =*/
            24
          ).int32(message.service);
          writer.uint32(
            /* id 4, wireType 0 =*/
            32
          ).int32(message.method);
          if (message.headers != null && message.headers.length)
            for (let i3 = 0; i3 < message.headers.length; ++i3)
              $root.pbbp2.Header.encode(message.headers[i3], writer.uint32(
                /* id 5, wireType 2 =*/
                42
              ).fork()).ldelim();
          if (message.payloadEncoding != null && Object.hasOwnProperty.call(message, "payloadEncoding"))
            writer.uint32(
              /* id 6, wireType 2 =*/
              50
            ).string(message.payloadEncoding);
          if (message.payloadType != null && Object.hasOwnProperty.call(message, "payloadType"))
            writer.uint32(
              /* id 7, wireType 2 =*/
              58
            ).string(message.payloadType);
          if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
            writer.uint32(
              /* id 8, wireType 2 =*/
              66
            ).bytes(message.payload);
          if (message.LogIDNew != null && Object.hasOwnProperty.call(message, "LogIDNew"))
            writer.uint32(
              /* id 9, wireType 2 =*/
              74
            ).string(message.LogIDNew);
          return writer;
        };
        Frame.encodeDelimited = function encodeDelimited(message, writer) {
          return this.encode(message, writer).ldelim();
        };
        Frame.decode = function decode2(reader, length) {
          if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
          let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.pbbp2.Frame();
          while (reader.pos < end) {
            let tag = reader.uint32();
            switch (tag >>> 3) {
              case 1: {
                message.SeqID = reader.uint64();
                break;
              }
              case 2: {
                message.LogID = reader.uint64();
                break;
              }
              case 3: {
                message.service = reader.int32();
                break;
              }
              case 4: {
                message.method = reader.int32();
                break;
              }
              case 5: {
                if (!(message.headers && message.headers.length))
                  message.headers = [];
                message.headers.push($root.pbbp2.Header.decode(reader, reader.uint32()));
                break;
              }
              case 6: {
                message.payloadEncoding = reader.string();
                break;
              }
              case 7: {
                message.payloadType = reader.string();
                break;
              }
              case 8: {
                message.payload = reader.bytes();
                break;
              }
              case 9: {
                message.LogIDNew = reader.string();
                break;
              }
              default:
                reader.skipType(tag & 7);
                break;
            }
          }
          if (!message.hasOwnProperty("SeqID"))
            throw $util.ProtocolError("missing required 'SeqID'", { instance: message });
          if (!message.hasOwnProperty("LogID"))
            throw $util.ProtocolError("missing required 'LogID'", { instance: message });
          if (!message.hasOwnProperty("service"))
            throw $util.ProtocolError("missing required 'service'", { instance: message });
          if (!message.hasOwnProperty("method"))
            throw $util.ProtocolError("missing required 'method'", { instance: message });
          return message;
        };
        Frame.decodeDelimited = function decodeDelimited(reader) {
          if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
          return this.decode(reader, reader.uint32());
        };
        Frame.verify = function verify(message) {
          if (typeof message !== "object" || message === null)
            return "object expected";
          if (!$util.isInteger(message.SeqID) && !(message.SeqID && $util.isInteger(message.SeqID.low) && $util.isInteger(message.SeqID.high)))
            return "SeqID: integer|Long expected";
          if (!$util.isInteger(message.LogID) && !(message.LogID && $util.isInteger(message.LogID.low) && $util.isInteger(message.LogID.high)))
            return "LogID: integer|Long expected";
          if (!$util.isInteger(message.service))
            return "service: integer expected";
          if (!$util.isInteger(message.method))
            return "method: integer expected";
          if (message.headers != null && message.hasOwnProperty("headers")) {
            if (!Array.isArray(message.headers))
              return "headers: array expected";
            for (let i3 = 0; i3 < message.headers.length; ++i3) {
              let error = $root.pbbp2.Header.verify(message.headers[i3]);
              if (error)
                return "headers." + error;
            }
          }
          if (message.payloadEncoding != null && message.hasOwnProperty("payloadEncoding")) {
            if (!$util.isString(message.payloadEncoding))
              return "payloadEncoding: string expected";
          }
          if (message.payloadType != null && message.hasOwnProperty("payloadType")) {
            if (!$util.isString(message.payloadType))
              return "payloadType: string expected";
          }
          if (message.payload != null && message.hasOwnProperty("payload")) {
            if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
              return "payload: buffer expected";
          }
          if (message.LogIDNew != null && message.hasOwnProperty("LogIDNew")) {
            if (!$util.isString(message.LogIDNew))
              return "LogIDNew: string expected";
          }
          return null;
        };
        Frame.fromObject = function fromObject(object) {
          if (object instanceof $root.pbbp2.Frame)
            return object;
          let message = new $root.pbbp2.Frame();
          if (object.SeqID != null) {
            if ($util.Long)
              (message.SeqID = $util.Long.fromValue(object.SeqID)).unsigned = true;
            else if (typeof object.SeqID === "string")
              message.SeqID = parseInt(object.SeqID, 10);
            else if (typeof object.SeqID === "number")
              message.SeqID = object.SeqID;
            else if (typeof object.SeqID === "object")
              message.SeqID = new $util.LongBits(object.SeqID.low >>> 0, object.SeqID.high >>> 0).toNumber(true);
          }
          if (object.LogID != null) {
            if ($util.Long)
              (message.LogID = $util.Long.fromValue(object.LogID)).unsigned = true;
            else if (typeof object.LogID === "string")
              message.LogID = parseInt(object.LogID, 10);
            else if (typeof object.LogID === "number")
              message.LogID = object.LogID;
            else if (typeof object.LogID === "object")
              message.LogID = new $util.LongBits(object.LogID.low >>> 0, object.LogID.high >>> 0).toNumber(true);
          }
          if (object.service != null)
            message.service = object.service | 0;
          if (object.method != null)
            message.method = object.method | 0;
          if (object.headers) {
            if (!Array.isArray(object.headers))
              throw TypeError(".pbbp2.Frame.headers: array expected");
            message.headers = [];
            for (let i3 = 0; i3 < object.headers.length; ++i3) {
              if (typeof object.headers[i3] !== "object")
                throw TypeError(".pbbp2.Frame.headers: object expected");
              message.headers[i3] = $root.pbbp2.Header.fromObject(object.headers[i3]);
            }
          }
          if (object.payloadEncoding != null)
            message.payloadEncoding = String(object.payloadEncoding);
          if (object.payloadType != null)
            message.payloadType = String(object.payloadType);
          if (object.payload != null) {
            if (typeof object.payload === "string")
              $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
            else if (object.payload.length >= 0)
              message.payload = object.payload;
          }
          if (object.LogIDNew != null)
            message.LogIDNew = String(object.LogIDNew);
          return message;
        };
        Frame.toObject = function toObject(message, options) {
          if (!options)
            options = {};
          let object = {};
          if (options.arrays || options.defaults)
            object.headers = [];
          if (options.defaults) {
            if ($util.Long) {
              let long = new $util.Long(0, 0, true);
              object.SeqID = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
              object.SeqID = options.longs === String ? "0" : 0;
            if ($util.Long) {
              let long = new $util.Long(0, 0, true);
              object.LogID = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
              object.LogID = options.longs === String ? "0" : 0;
            object.service = 0;
            object.method = 0;
            object.payloadEncoding = "";
            object.payloadType = "";
            if (options.bytes === String)
              object.payload = "";
            else {
              object.payload = [];
              if (options.bytes !== Array)
                object.payload = $util.newBuffer(object.payload);
            }
            object.LogIDNew = "";
          }
          if (message.SeqID != null && message.hasOwnProperty("SeqID"))
            if (typeof message.SeqID === "number")
              object.SeqID = options.longs === String ? String(message.SeqID) : message.SeqID;
            else
              object.SeqID = options.longs === String ? $util.Long.prototype.toString.call(message.SeqID) : options.longs === Number ? new $util.LongBits(message.SeqID.low >>> 0, message.SeqID.high >>> 0).toNumber(true) : message.SeqID;
          if (message.LogID != null && message.hasOwnProperty("LogID"))
            if (typeof message.LogID === "number")
              object.LogID = options.longs === String ? String(message.LogID) : message.LogID;
            else
              object.LogID = options.longs === String ? $util.Long.prototype.toString.call(message.LogID) : options.longs === Number ? new $util.LongBits(message.LogID.low >>> 0, message.LogID.high >>> 0).toNumber(true) : message.LogID;
          if (message.service != null && message.hasOwnProperty("service"))
            object.service = message.service;
          if (message.method != null && message.hasOwnProperty("method"))
            object.method = message.method;
          if (message.headers && message.headers.length) {
            object.headers = [];
            for (let j3 = 0; j3 < message.headers.length; ++j3)
              object.headers[j3] = $root.pbbp2.Header.toObject(message.headers[j3], options);
          }
          if (message.payloadEncoding != null && message.hasOwnProperty("payloadEncoding"))
            object.payloadEncoding = message.payloadEncoding;
          if (message.payloadType != null && message.hasOwnProperty("payloadType"))
            object.payloadType = message.payloadType;
          if (message.payload != null && message.hasOwnProperty("payload"))
            object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;
          if (message.LogIDNew != null && message.hasOwnProperty("LogIDNew"))
            object.LogIDNew = message.LogIDNew;
          return object;
        };
        Frame.prototype.toJSON = function toJSON() {
          return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };
        Frame.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
          if (typeUrlPrefix === void 0) {
            typeUrlPrefix = "type.googleapis.com";
          }
          return typeUrlPrefix + "/pbbp2.Frame";
        };
        return Frame;
      }();
      return pbbp22;
    })();
    var decode = (buffer) => {
      return pbbp2.Frame.decode(buffer);
    };
    var WSConfig = class {
      constructor() {
        this.client = {
          appId: "",
          appSecret: "",
          domain: exports2.Domain.Feishu
        };
        this.ws = {
          connectUrl: "",
          pingInterval: 120 * 1e3,
          reconnectCount: -1,
          reconnectInterval: 120 * 1e3,
          reconnectNonce: 30 * 1e3,
          deviceId: "",
          serviceId: "",
          autoReconnect: true
        };
        this.wsInstance = null;
      }
      updateClient(clientConfig) {
        Object.assign(this.client, clientConfig);
      }
      updateWs(WSConfig2) {
        Object.assign(this.ws, WSConfig2);
      }
      getClient(key) {
        if (key === void 0) {
          return this.client;
        }
        return this.client[key];
      }
      getWS(key) {
        if (key === void 0) {
          return this.ws;
        }
        return this.ws[key];
      }
      get wsConfigUrl() {
        return `${this.getClient("domain")}/callback/ws/endpoint`;
      }
      setWSInstance(wsInstance) {
        this.wsInstance = wsInstance;
      }
      getWSInstance() {
        return this.wsInstance;
      }
    };
    var DataCache = class {
      constructor(params) {
        this.cache = /* @__PURE__ */ new Map();
        this.logger = params.logger;
        this.clearAtInterval();
      }
      mergeData(params) {
        const { message_id, sum, seq, trace_id, data } = params;
        const cache = this.cache.get(message_id);
        if (!cache) {
          const buffer = new Array(sum).fill(void 0);
          buffer[seq] = data;
          this.cache.set(message_id, {
            buffer,
            trace_id,
            message_id,
            create_time: Date.now()
          });
        } else {
          cache.buffer[seq] = data;
        }
        const mergedCache = this.cache.get(message_id);
        if (mergedCache === null || mergedCache === void 0 ? void 0 : mergedCache.buffer.every((item) => !!item)) {
          const mergedBuffer = mergedCache.buffer.reduce((acc, cur) => {
            const combined = new Uint8Array(acc.byteLength + cur.byteLength);
            combined.set(acc, 0);
            combined.set(cur, acc.length);
            return combined;
          }, new Uint8Array([]));
          const string = new TextDecoder("utf-8").decode(mergedBuffer);
          const data2 = JSON.parse(string);
          this.deleteCache(message_id);
          return data2;
        }
        return null;
      }
      deleteCache(message_id) {
        this.cache.delete(message_id);
      }
      clearAtInterval() {
        const clearIntervalMs = 1e4;
        setInterval(() => {
          const now = Date.now();
          this.cache.forEach((value, key) => {
            var _a;
            const { create_time, trace_id, message_id } = value;
            if (now - create_time > clearIntervalMs) {
              (_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug(`${message_id} event data is deleted as expired, trace_id: ${trace_id}`);
              this.deleteCache(key);
            }
          });
        }, clearIntervalMs);
      }
    };
    var ErrorCode;
    (function(ErrorCode2) {
      ErrorCode2[ErrorCode2["ok"] = 0] = "ok";
      ErrorCode2[ErrorCode2["system_busy"] = 1] = "system_busy";
      ErrorCode2[ErrorCode2["forbidden"] = 403] = "forbidden";
      ErrorCode2[ErrorCode2["auth_failed"] = 514] = "auth_failed";
      ErrorCode2[ErrorCode2["internal_error"] = 1000040343] = "internal_error";
      ErrorCode2[ErrorCode2["exceed_conn_limit"] = 1000040350] = "exceed_conn_limit";
    })(ErrorCode || (ErrorCode = {}));
    var FrameType;
    (function(FrameType2) {
      FrameType2[FrameType2["control"] = 0] = "control";
      FrameType2[FrameType2["data"] = 1] = "data";
    })(FrameType || (FrameType = {}));
    var HeaderKey;
    (function(HeaderKey2) {
      HeaderKey2["type"] = "type";
      HeaderKey2["message_id"] = "message_id";
      HeaderKey2["sum"] = "sum";
      HeaderKey2["seq"] = "seq";
      HeaderKey2["trace_id"] = "trace_id";
      HeaderKey2["biz_rt"] = "biz_rt";
      HeaderKey2["handshake_status"] = "handshake-status";
      HeaderKey2["handshake_msg"] = "handshake-msg";
      HeaderKey2["handshake_autherrcode"] = "handshake-autherrcode";
    })(HeaderKey || (HeaderKey = {}));
    var MessageType;
    (function(MessageType2) {
      MessageType2["event"] = "event";
      MessageType2["card"] = "card";
      MessageType2["ping"] = "ping";
      MessageType2["pong"] = "pong";
    })(MessageType || (MessageType = {}));
    var HttpStatusCode;
    (function(HttpStatusCode2) {
      HttpStatusCode2[HttpStatusCode2["ok"] = 200] = "ok";
      HttpStatusCode2[HttpStatusCode2["internal_server_error"] = 500] = "internal_server_error";
    })(HttpStatusCode || (HttpStatusCode = {}));
    var WSClient = class {
      constructor(params) {
        this.wsConfig = new WSConfig();
        this.isConnecting = false;
        this.reconnectInfo = {
          lastConnectTime: 0,
          nextConnectTime: 0
        };
        const { appId, appSecret, agent, domain = exports2.Domain.Feishu, httpInstance = defaultHttpInstance, loggerLevel = exports2.LoggerLevel.info, logger: logger18 = defaultLogger, autoReconnect = true } = params;
        this.logger = new LoggerProxy(loggerLevel, logger18);
        assert(!appId, () => this.logger.error("appId is needed"));
        assert(!appSecret, () => this.logger.error("appSecret is needed"));
        this.agent = agent;
        this.dataCache = new DataCache({ logger: this.logger });
        this.httpInstance = httpInstance;
        this.wsConfig.updateClient({
          appId,
          appSecret,
          domain: formatDomain(domain)
        });
        this.wsConfig.updateWs({
          autoReconnect
        });
      }
      pullConnectConfig() {
        return __awaiter(this, void 0, void 0, function* () {
          const { appId, appSecret } = this.wsConfig.getClient();
          try {
            const { code, data: { URL: URL2, ClientConfig }, msg } = yield this.httpInstance.request({
              method: "post",
              url: this.wsConfig.wsConfigUrl,
              data: {
                AppID: appId,
                AppSecret: appSecret
              },
              // consumed by gateway
              headers: {
                "locale": "zh"
              },
              timeout: 15e3
            });
            if (code !== ErrorCode.ok) {
              this.logger.error("[ws]", `code: ${code}, ${code === ErrorCode.system_busy ? msg : "system busy"}`);
              if (code === ErrorCode.system_busy || code === ErrorCode.internal_error) {
                return false;
              }
            }
            const { device_id, service_id } = qs__default["default"].parse(URL2);
            this.wsConfig.updateWs({
              connectUrl: URL2,
              deviceId: device_id,
              serviceId: service_id,
              pingInterval: ClientConfig.PingInterval * 1e3,
              reconnectCount: ClientConfig.ReconnectCount,
              reconnectInterval: ClientConfig.ReconnectInterval * 1e3,
              reconnectNonce: ClientConfig.ReconnectNonce * 1e3
            });
            this.logger.debug("[ws]", `get connect config success, ws url: ${URL2}`);
            return true;
          } catch (e3) {
            this.logger.error("[ws]", (e3 === null || e3 === void 0 ? void 0 : e3.message) || "system busy");
            return false;
          }
        });
      }
      connect() {
        const connectUrl = this.wsConfig.getWS("connectUrl");
        let wsInstance;
        try {
          const { agent } = this;
          wsInstance = new WebSocket__default["default"](connectUrl, { agent });
        } catch (e3) {
          this.logger.error("[ws]", "new WebSocket error");
        }
        if (!wsInstance) {
          return Promise.resolve(false);
        }
        return new Promise((resolve4) => {
          wsInstance.on("open", () => {
            this.logger.debug("[ws]", "ws connect success");
            this.wsConfig.setWSInstance(wsInstance);
            this.pingLoop();
            resolve4(true);
          });
          wsInstance.on("error", () => {
            this.logger.error("[ws]", "ws connect failed");
            resolve4(false);
          });
        });
      }
      reConnect(isStart = false) {
        return __awaiter(this, void 0, void 0, function* () {
          if (this.isConnecting) {
            this.logger.debug("[ws]", "repeat connection");
            return;
          }
          this.isConnecting = true;
          const tryConnect = () => {
            this.reconnectInfo.lastConnectTime = Date.now();
            return this.pullConnectConfig().then((isSuccess) => isSuccess ? this.connect() : Promise.resolve(false)).then((isSuccess) => {
              if (isSuccess) {
                this.communicate();
                return Promise.resolve(true);
              }
              return Promise.resolve(false);
            });
          };
          if (this.pingInterval) {
            clearTimeout(this.pingInterval);
          }
          const wsInstance = this.wsConfig.getWSInstance();
          if (isStart) {
            if (wsInstance) {
              wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.terminate();
            }
            if (this.reconnectInterval) {
              clearTimeout(this.reconnectInterval);
            }
            let isSuccess = false;
            try {
              isSuccess = yield tryConnect();
            } finally {
              this.isConnecting = false;
            }
            if (!isSuccess) {
              this.logger.error("[ws]", "connect failed");
              yield this.reConnect();
            }
            this.logger.info("[ws]", "ws client ready");
            return;
          }
          const { autoReconnect, reconnectNonce, reconnectCount, reconnectInterval } = this.wsConfig.getWS();
          if (!autoReconnect) {
            return;
          }
          this.logger.info("[ws]", "reconnect");
          if (wsInstance) {
            wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.terminate();
          }
          this.wsConfig.setWSInstance(null);
          const reconnectNonceTime = reconnectNonce ? reconnectNonce * Math.random() : 0;
          this.reconnectInterval = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
            (function loopReConnect(count) {
              return __awaiter(this, void 0, void 0, function* () {
                count++;
                const isSuccess = yield tryConnect();
                if (isSuccess) {
                  this.logger.debug("[ws]", "reconnect success");
                  this.isConnecting = false;
                  return;
                }
                this.logger.info("ws", `unable to connect to the server after trying ${count} times")`);
                if (reconnectCount >= 0 && count >= reconnectCount) {
                  this.isConnecting = false;
                  return;
                }
                this.reconnectInterval = setTimeout(() => {
                  loopReConnect.bind(this)(count);
                }, reconnectInterval);
                this.reconnectInfo.nextConnectTime = Date.now() + reconnectInterval;
              });
            }).bind(this)(0);
          }), reconnectNonceTime);
          this.reconnectInfo.nextConnectTime = Date.now() + reconnectNonceTime;
        });
      }
      pingLoop() {
        const { serviceId, pingInterval } = this.wsConfig.getWS();
        const wsInstance = this.wsConfig.getWSInstance();
        if ((wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.readyState) === WebSocket__default["default"].OPEN) {
          const frame = {
            headers: [{
              key: HeaderKey.type,
              value: MessageType.ping
            }],
            service: Number(serviceId),
            method: FrameType.control,
            SeqID: 0,
            LogID: 0
          };
          this.sendMessage(frame);
          this.logger.trace("[ws]", "ping success");
        }
        this.pingInterval = setTimeout(this.pingLoop.bind(this), pingInterval);
      }
      communicate() {
        const wsInstance = this.wsConfig.getWSInstance();
        wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.on("message", (buffer) => __awaiter(this, void 0, void 0, function* () {
          const data = decode(buffer);
          const { method } = data;
          if (method === FrameType.control) {
            yield this.handleControlData(data);
          }
          if (method === FrameType.data) {
            yield this.handleEventData(data);
          }
        }));
        wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.on("error", (e3) => {
          this.logger.error("[ws]", "ws error");
        });
        wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.on("close", () => {
          this.logger.debug("[ws]", "client closed");
          this.reConnect();
        });
      }
      handleControlData(data) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          const type = (_a = data.headers.find((item) => item.key === HeaderKey.type)) === null || _a === void 0 ? void 0 : _a.value;
          const payload = data.payload;
          if (type === MessageType.ping) {
            return;
          }
          if (type === MessageType.pong && payload) {
            this.logger.trace("[ws]", "receive pong");
            const dataString = new TextDecoder("utf-8").decode(payload);
            const { PingInterval, ReconnectCount, ReconnectInterval, ReconnectNonce } = JSON.parse(dataString);
            this.wsConfig.updateWs({
              pingInterval: PingInterval * 1e3,
              reconnectCount: ReconnectCount,
              reconnectInterval: ReconnectInterval * 1e3,
              reconnectNonce: ReconnectNonce * 1e3
            });
            this.logger.trace("[ws]", "update wsConfig with pong data");
          }
        });
      }
      handleEventData(data) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          const headers = data.headers.reduce((acc, cur) => {
            acc[cur.key] = cur.value;
            return acc;
          }, {});
          const { message_id, sum, seq, type, trace_id } = headers;
          const payload = data.payload;
          if (type !== MessageType.event) {
            return;
          }
          const mergedData = this.dataCache.mergeData({
            message_id,
            sum: Number(sum),
            seq: Number(seq),
            trace_id,
            data: payload
          });
          if (!mergedData) {
            return;
          }
          this.logger.debug("[ws]", `receive message, message_type: ${type}; message_id: ${message_id}; trace_id: ${trace_id}; data: ${mergedData.data}`);
          const respPayload = {
            code: HttpStatusCode.ok
          };
          const startTime = Date.now();
          try {
            const result = yield (_a = this.eventDispatcher) === null || _a === void 0 ? void 0 : _a.invoke(mergedData, { needCheck: false });
            if (result) {
              respPayload.data = Buffer.from(JSON.stringify(result)).toString("base64");
            }
          } catch (error) {
            respPayload.code = HttpStatusCode.internal_server_error;
            this.logger.error("[ws]", `invoke event failed, message_type: ${type}; message_id: ${message_id}; trace_id: ${trace_id}; error: ${error}`);
          }
          const endTime = Date.now();
          this.sendMessage(Object.assign(Object.assign({}, data), { headers: [...data.headers, { key: HeaderKey.biz_rt, value: String(startTime - endTime) }], payload: new TextEncoder().encode(JSON.stringify(respPayload)) }));
        });
      }
      sendMessage(data) {
        var _a;
        const wsInstance = this.wsConfig.getWSInstance();
        if ((wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.readyState) === WebSocket__default["default"].OPEN) {
          const resp = pbbp2.Frame.encode(data).finish();
          (_a = this.wsConfig.getWSInstance()) === null || _a === void 0 ? void 0 : _a.send(resp, (err) => {
            if (err) {
              this.logger.error("[ws]", "send data failed");
            }
          });
        }
      }
      getReconnectInfo() {
        return this.reconnectInfo;
      }
      /**
       * close connection
       * @param params close params
       * @param params.force whether force close (use terminate instead of close)
       */
      close(params = {}) {
        const { force = false } = params;
        if (this.pingInterval) {
          clearTimeout(this.pingInterval);
          this.pingInterval = void 0;
        }
        if (this.reconnectInterval) {
          clearTimeout(this.reconnectInterval);
          this.reconnectInterval = void 0;
        }
        this.isConnecting = false;
        const wsInstance = this.wsConfig.getWSInstance();
        if (wsInstance) {
          wsInstance.removeAllListeners();
          if (force) {
            wsInstance.terminate();
          } else {
            wsInstance.close();
          }
          this.wsConfig.setWSInstance(null);
        }
        this.logger.info("[ws]", `ws client closed manually${force ? " (force)" : ""}`);
      }
      start(params) {
        return __awaiter(this, void 0, void 0, function* () {
          this.logger.info("[ws]", `receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in:
        Developer Console(\u5F00\u53D1\u8005\u540E\u53F0) 
          ->
        Events and Callbacks(\u4E8B\u4EF6\u4E0E\u56DE\u8C03)
          -> 
        Mode of event/callback subscription(\u8BA2\u9605\u65B9\u5F0F)
          -> 
        Receive events/callbacks through persistent connection(\u4F7F\u7528 \u957F\u8FDE\u63A5 \u63A5\u6536\u4E8B\u4EF6/\u56DE\u8C03)`);
          const { eventDispatcher } = params;
          if (!eventDispatcher) {
            this.logger.warn("[ws]", "client need to start with a eventDispatcher");
            return;
          }
          this.eventDispatcher = eventDispatcher;
          this.reConnect(true);
        });
      }
    };
    var SessionCache = class {
      constructor() {
        this.sessions = /* @__PURE__ */ new Map();
      }
      set(key, value) {
        return __awaiter(this, void 0, void 0, function* () {
          const sessions = this.sessions.get(key.toString()) || {};
          const mergedSessions = mergeObject(sessions, value);
          this.sessions.set(key.toString(), mergedSessions);
          return true;
        });
      }
      get(key) {
        return __awaiter(this, void 0, void 0, function* () {
          return this.sessions.get(key.toString());
        });
      }
    };
    var EExecStatus;
    (function(EExecStatus2) {
      EExecStatus2[EExecStatus2["ERROR"] = -1] = "ERROR";
      EExecStatus2[EExecStatus2["SUCCESS"] = 0] = "SUCCESS";
      EExecStatus2[EExecStatus2["EXPIRED"] = 1] = "EXPIRED";
      EExecStatus2[EExecStatus2["CANCELLED"] = 2] = "CANCELLED";
      EExecStatus2[EExecStatus2["FAILED"] = 3] = "FAILED";
      EExecStatus2[EExecStatus2["OTHER"] = 4] = "OTHER";
    })(EExecStatus || (EExecStatus = {}));
    var Aily = class {
      constructor(params) {
        this.completions = {
          create: this.create.bind(this),
          createWithStream: this.createWithStream.bind(this),
          sessionRecords: {
            get: this.getRecords.bind(this),
            update: this.updateRecords.bind(this)
          }
        };
        this.client = params.client;
        this.logger = params.client.logger;
        this.cache = params.cache || new SessionCache();
      }
      getSessionId(params) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
          const { sessionId, payload, options } = params;
          const records = yield this.getRecords();
          if (sessionId && sessionId in records) {
            return records[sessionId];
          }
          const ailySession = yield this.client.aily.v1.ailySession.create({ data: payload }, options);
          if (ailySession.code === 0 && ailySession.data) {
            const ailySessionId = (_a = ailySession.data.session) === null || _a === void 0 ? void 0 : _a.id;
            if (sessionId) {
              yield this.updateRecords({ [sessionId]: ailySessionId });
            }
            return ailySessionId;
          } else {
            this.logger.error("get aily session id error", ailySession.msg);
            return void 0;
          }
        });
      }
      waitReply(params, options) {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
          const { sessionId, ailyAppId, message, sessionInfo, messageInfo, runInfo, skillId } = params;
          const ailySessionId = yield this.getSessionId({ sessionId, payload: sessionInfo, options });
          if (!ailySessionId) {
            throw EExecStatus.ERROR;
          }
          const ailySessionMessage = yield this.client.aily.v1.ailySessionAilyMessage.create({
            path: {
              aily_session_id: ailySessionId
            },
            data: Object.assign(Object.assign({}, messageInfo), { content: message, idempotent_id: `${Date.now()}`, content_type: "MDX" })
          }, options);
          if (!(ailySessionMessage.code === 0 && ailySessionMessage.data)) {
            this.logger.error("create aily message error", ailySessionMessage.msg);
            throw EExecStatus.ERROR;
          }
          const messageId = (_a = ailySessionMessage.data.message) === null || _a === void 0 ? void 0 : _a.id;
          const ailySessionRun = yield this.client.aily.v1.ailySessionRun.create({
            path: {
              aily_session_id: ailySessionId
            },
            data: Object.assign({ app_id: ailyAppId, skill_id: skillId }, runInfo)
          }, options);
          if (!(ailySessionRun.code === 0 && ailySessionRun.data)) {
            this.logger.error("create aily session run error", ailySessionRun.msg);
            throw EExecStatus.ERROR;
          }
          const runId = (_b = ailySessionRun.data.run) === null || _b === void 0 ? void 0 : _b.id;
          if (!runId) {
            this.logger.error("run id is empty");
            throw EExecStatus.ERROR;
          }
          const polling = () => __awaiter(this, void 0, void 0, function* () {
            return new Promise((resolve4) => {
              setTimeout(() => __awaiter(this, void 0, void 0, function* () {
                var _a2, _b2;
                const runStatusInfo = yield this.client.aily.v1.ailySessionRun.get({
                  path: {
                    aily_session_id: ailySessionId,
                    run_id: runId
                  }
                }, options);
                if (!(runStatusInfo.code === 0 && runStatusInfo.data)) {
                  resolve4(3);
                  return;
                }
                const status = (_b2 = (_a2 = runStatusInfo.data) === null || _a2 === void 0 ? void 0 : _a2.run) === null || _b2 === void 0 ? void 0 : _b2.status;
                switch (status) {
                  case "QUEUED":
                  case "IN_PROGRESS":
                    yield (() => __awaiter(this, void 0, void 0, function* () {
                      const ret = yield polling();
                      resolve4(ret);
                    }))();
                  case "COMPLETED":
                    resolve4(EExecStatus.SUCCESS);
                  case "EXPIRED":
                    resolve4(EExecStatus.EXPIRED);
                  case "CANCELLED":
                    resolve4(EExecStatus.CANCELLED);
                  case "FAILED":
                    resolve4(EExecStatus.FAILED);
                  default:
                    resolve4(EExecStatus.OTHER);
                }
              }), 500);
            });
          });
          const pollingRet = yield polling();
          if (pollingRet !== EExecStatus.SUCCESS) {
            this.logger.error("aily run error");
            throw pollingRet;
          }
          return {
            ailySessionId,
            runId,
            messageId
          };
        });
      }
      create(params, options) {
        var _a, e_1, _b, _c;
        var _d;
        return __awaiter(this, void 0, void 0, function* () {
          const { ailySessionId, runId } = yield this.waitReply(params, options);
          let reply;
          try {
            for (var _e = true, _f = __asyncValues(yield this.client.aily.v1.ailySessionAilyMessage.listWithIterator({
              path: {
                aily_session_id: ailySessionId
              },
              params: {
                run_id: runId,
                with_partial_message: false
              }
            }, options)), _g; _g = yield _f.next(), _a = _g.done, !_a; ) {
              _c = _g.value;
              _e = false;
              try {
                const items = _c;
                if (!items) {
                  continue;
                }
                (_d = items === null || items === void 0 ? void 0 : items.messages) === null || _d === void 0 ? void 0 : _d.forEach((message) => {
                  var _a2;
                  if (((_a2 = message.sender) === null || _a2 === void 0 ? void 0 : _a2.sender_type) === "ASSISTANT") {
                    reply = message;
                  }
                });
              } finally {
                _e = true;
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
            } finally {
              if (e_1) throw e_1.error;
            }
          }
          if (!reply) {
            this.logger.error("no aily reply");
            throw EExecStatus.ERROR;
          }
          return reply;
        });
      }
      createWithStream(params, options) {
        return __awaiter(this, void 0, void 0, function* () {
          const { ailySessionId, runId, messageId } = yield this.waitReply(params, options);
          const listMessages = () => this.client.aily.v1.ailySessionAilyMessage.listWithIterator({
            path: {
              aily_session_id: ailySessionId
            },
            params: {
              run_id: runId,
              with_partial_message: true
            }
          }, options);
          let startOutput = false;
          const Iterable = {
            [Symbol.asyncIterator]() {
              return __asyncGenerator(this, arguments, function* _a() {
                var _b, e_2, _c, _d;
                try {
                  for (var _e = true, _f = __asyncValues(yield __await(listMessages())), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; ) {
                    _d = _g.value;
                    _e = false;
                    try {
                      const items = _d;
                      if (!items) {
                        continue;
                      }
                      for (const message of items.messages || []) {
                        if (startOutput) {
                          yield yield __await(message);
                          if (message.status === "COMPLETED") {
                            return yield __await(void 0);
                          }
                        } else if (message.id === messageId && message.status === "COMPLETED") {
                          startOutput = true;
                        }
                      }
                    } finally {
                      _e = true;
                    }
                  }
                } catch (e_2_1) {
                  e_2 = { error: e_2_1 };
                } finally {
                  try {
                    if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
                  } finally {
                    if (e_2) throw e_2.error;
                  }
                }
              });
            }
          };
          return Iterable;
        });
      }
      getRecords() {
        return __awaiter(this, void 0, void 0, function* () {
          const sessions = (yield this.cache.get(CAilySessionRecord)) || {};
          return sessions;
        });
      }
      updateRecords(records) {
        return __awaiter(this, void 0, void 0, function* () {
          yield this.cache.set(CAilySessionRecord, records);
        });
      }
    };
    exports2.AESCipher = AESCipher;
    exports2.Aily = Aily;
    exports2.CAppTicket = CAppTicket;
    exports2.CTenantAccessToken = CTenantAccessToken;
    exports2.CardActionHandler = CardActionHandler;
    exports2.Client = Client;
    exports2.EventDispatcher = EventDispatcher;
    exports2.WSClient = WSClient;
    exports2.adaptDefault = adaptDefault;
    exports2.adaptExpress = adaptExpress;
    exports2.adaptKoa = adaptKoa;
    exports2.adaptKoaRouter = adaptKoaRouter;
    exports2.defaultHttpInstance = defaultHttpInstance;
    exports2.generateChallenge = generateChallenge;
    exports2.messageCard = messageCard;
    exports2.withAll = withAll;
    exports2.withHelpDeskCredential = withHelpDeskCredential;
    exports2.withTenantKey = withTenantKey;
    exports2.withTenantToken = withTenantToken;
    exports2.withUserAccessToken = withUserAccessToken;
  }
});

// ../../../packages/types/dist/src/agentx/index.js
function hasSubscriptions(response) {
  return Array.isArray(response.__subscriptions) && response.__subscriptions.length > 0;
}
function isRemoteConfig(config) {
  return "serverUrl" in config && typeof config.serverUrl === "string";
}

// ../../../node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs
var import_stream = __toESM(require_stream(), 1);
var import_receiver = __toESM(require_receiver(), 1);
var import_sender = __toESM(require_sender(), 1);
var import_websocket = __toESM(require_websocket(), 1);
var import_websocket_server = __toESM(require_websocket_server(), 1);

// ../../../packages/network/dist/index.js
init_dist();
init_dist();
var import_reconnecting_websocket = __toESM(require_reconnecting_websocket_cjs(), 1);
function isAckMessage(data) {
  return typeof data === "object" && data !== null && "__ack" in data;
}
function isReliableWrapper(data) {
  return typeof data === "object" && data !== null && "__msgId" in data && "__payload" in data;
}
var logger = createLogger("network/WebSocketServer");
var WebSocketConnection = class {
  id;
  ws;
  messageHandlers = /* @__PURE__ */ new Set();
  closeHandlers = /* @__PURE__ */ new Set();
  errorHandlers = /* @__PURE__ */ new Set();
  heartbeatInterval;
  isAlive = true;
  pendingAcks = /* @__PURE__ */ new Map();
  constructor(ws, options) {
    this.ws = ws;
    this.id = `conn_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
    if (options.heartbeat !== false) {
      const interval = options.heartbeatInterval || 3e4;
      ws.on("pong", () => {
        this.isAlive = true;
        logger.debug("Heartbeat pong received", { id: this.id });
      });
      this.heartbeatInterval = setInterval(() => {
        if (!this.isAlive) {
          logger.warn("Client heartbeat timeout, terminating connection", { id: this.id });
          clearInterval(this.heartbeatInterval);
          ws.terminate();
          return;
        }
        this.isAlive = false;
        ws.ping();
        logger.debug("Heartbeat ping sent", { id: this.id });
      }, interval);
    }
    ws.on("message", (data) => {
      const message = data.toString();
      try {
        const parsed = JSON.parse(message);
        if (isAckMessage(parsed)) {
          const pending = this.pendingAcks.get(parsed.__ack);
          if (pending) {
            clearTimeout(pending.timer);
            this.pendingAcks.delete(parsed.__ack);
            pending.onAck();
          }
          return;
        }
      } catch {
      }
      for (const handler of this.messageHandlers) {
        handler(message);
      }
    });
    ws.on("close", () => {
      if (this.heartbeatInterval) {
        clearInterval(this.heartbeatInterval);
      }
      for (const [, pending] of this.pendingAcks) {
        clearTimeout(pending.timer);
      }
      this.pendingAcks.clear();
      for (const handler of this.closeHandlers) {
        handler();
      }
    });
    ws.on("error", (err) => {
      if (this.heartbeatInterval) {
        clearInterval(this.heartbeatInterval);
      }
      for (const handler of this.errorHandlers) {
        handler(err);
      }
    });
  }
  send(message) {
    if (this.ws.readyState === 1) {
      this.ws.send(message);
    }
  }
  sendReliable(message, options) {
    if (this.ws.readyState !== 1)
      return;
    const msgId = `msg_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
    const wrapper = JSON.stringify({ __msgId: msgId, __payload: message });
    const timer = setTimeout(() => {
      this.pendingAcks.delete(msgId);
      options.onTimeout?.();
    }, options.timeout ?? 1e4);
    this.pendingAcks.set(msgId, { timer, onAck: options.onAck });
    this.ws.send(wrapper);
  }
  onMessage(handler) {
    this.messageHandlers.add(handler);
    return () => {
      this.messageHandlers.delete(handler);
    };
  }
  onClose(handler) {
    this.closeHandlers.add(handler);
    return () => {
      this.closeHandlers.delete(handler);
    };
  }
  onError(handler) {
    this.errorHandlers.add(handler);
    return () => {
      this.errorHandlers.delete(handler);
    };
  }
  close() {
    if (this.heartbeatInterval) {
      clearInterval(this.heartbeatInterval);
    }
    this.ws.close();
  }
};
var WebSocketServer2 = class {
  wss = null;
  connections = /* @__PURE__ */ new Set();
  connectionHandlers = /* @__PURE__ */ new Set();
  options;
  attachedToServer = false;
  constructor(options = {}) {
    this.options = options;
  }
  async listen(port, host = "0.0.0.0") {
    if (this.wss) {
      throw new Error("Server already listening");
    }
    if (this.attachedToServer) {
      throw new Error("Cannot listen when attached to existing server. The server should call listen() instead.");
    }
    this.wss = new import_websocket_server.default({ port, host });
    this.wss.on("connection", (ws) => {
      this.handleConnection(ws);
    });
    logger.info("WebSocket server listening", { port, host });
  }
  attach(server, path2 = "/ws") {
    if (this.wss) {
      throw new Error("Server already initialized");
    }
    this.wss = new import_websocket_server.default({ noServer: true });
    server.on("upgrade", (request, socket, head) => {
      const url = new URL(request.url || "", `http://${request.headers.host}`);
      if (url.pathname === path2) {
        this.wss.handleUpgrade(request, socket, head, (ws) => {
          this.wss.emit("connection", ws, request);
        });
      } else {
        socket.destroy();
      }
    });
    this.wss.on("connection", (ws) => {
      this.handleConnection(ws);
    });
    this.attachedToServer = true;
    logger.info("WebSocket attached to existing HTTP server", { path: path2 });
  }
  handleConnection(ws) {
    const connection = new WebSocketConnection(ws, this.options);
    this.connections.add(connection);
    logger.info("Client connected", {
      connectionId: connection.id,
      totalConnections: this.connections.size
    });
    connection.onClose(() => {
      this.connections.delete(connection);
      logger.info("Client disconnected", {
        connectionId: connection.id,
        totalConnections: this.connections.size
      });
    });
    for (const handler of this.connectionHandlers) {
      handler(connection);
    }
  }
  onConnection(handler) {
    this.connectionHandlers.add(handler);
    return () => {
      this.connectionHandlers.delete(handler);
    };
  }
  broadcast(message) {
    for (const connection of this.connections) {
      connection.send(message);
    }
  }
  async close() {
    if (!this.wss)
      return;
    for (const connection of this.connections) {
      connection.close();
    }
    this.connections.clear();
    if (!this.attachedToServer) {
      await new Promise((resolve4) => {
        this.wss.close(() => resolve4());
      });
    }
    this.wss = null;
  }
  async dispose() {
    await this.close();
    this.connectionHandlers.clear();
  }
};
var logger2 = createLogger("network/WebSocketClient");
var isBrowser = typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined" && typeof globalThis.window.WebSocket !== "undefined";
var WebSocketClient = class {
  ws = null;
  serverUrl;
  headers;
  messageHandlers = /* @__PURE__ */ new Set();
  openHandlers = /* @__PURE__ */ new Set();
  closeHandlers = /* @__PURE__ */ new Set();
  errorHandlers = /* @__PURE__ */ new Set();
  constructor(options) {
    if (isBrowser) {
      throw new Error("Use createBrowserWebSocketClient() in browser environment for auto-reconnect support");
    }
    this.serverUrl = options.serverUrl;
    this.headers = options.headers;
  }
  get readyState() {
    if (!this.ws)
      return "closed";
    const state = this.ws.readyState;
    if (state === 0)
      return "connecting";
    if (state === 1)
      return "open";
    if (state === 2)
      return "closing";
    return "closed";
  }
  async connect() {
    if (this.ws) {
      throw new Error("Already connected or connecting");
    }
    const wsOptions = this.headers ? { headers: this.headers } : void 0;
    this.ws = new import_websocket.default(this.serverUrl, wsOptions);
    if (this.headers) {
      logger2.debug("WebSocket connecting with custom headers", {
        serverUrl: this.serverUrl,
        headerKeys: Object.keys(this.headers)
      });
    }
    return new Promise((resolve4, reject) => {
      const onOpen = () => {
        logger2.info("WebSocket connected", { serverUrl: this.serverUrl });
        for (const handler of this.openHandlers) {
          handler();
        }
        resolve4();
      };
      const onError = (err) => {
        logger2.error("WebSocket connection failed", {
          serverUrl: this.serverUrl,
          error: err?.message
        });
        reject(err || new Error("WebSocket connection failed"));
      };
      this.ws.once("open", onOpen);
      this.ws.once("error", onError);
      this.ws.on("message", (data) => {
        const message = data.toString();
        try {
          const parsed = JSON.parse(message);
          if (isReliableWrapper(parsed)) {
            this.ws.send(JSON.stringify({ __ack: parsed.__msgId }));
            for (const handler of this.messageHandlers) {
              handler(parsed.__payload);
            }
            return;
          }
        } catch {
        }
        for (const handler of this.messageHandlers) {
          handler(message);
        }
      });
      this.ws.on("close", () => {
        logger2.warn("WebSocket closed");
        for (const handler of this.closeHandlers) {
          handler();
        }
      });
      this.ws.on("error", (err) => {
        logger2.error("WebSocket error", { error: err.message });
        for (const handler of this.errorHandlers) {
          handler(err);
        }
      });
    });
  }
  send(message) {
    if (!this.ws || this.ws.readyState !== 1) {
      throw new Error("WebSocket is not open");
    }
    this.ws.send(message);
  }
  onMessage(handler) {
    this.messageHandlers.add(handler);
    return () => {
      this.messageHandlers.delete(handler);
    };
  }
  onOpen(handler) {
    this.openHandlers.add(handler);
    return () => {
      this.openHandlers.delete(handler);
    };
  }
  onClose(handler) {
    this.closeHandlers.add(handler);
    return () => {
      this.closeHandlers.delete(handler);
    };
  }
  onError(handler) {
    this.errorHandlers.add(handler);
    return () => {
      this.errorHandlers.delete(handler);
    };
  }
  close() {
    if (this.ws) {
      this.ws.close();
      this.ws = null;
    }
  }
  dispose() {
    this.close();
    this.messageHandlers.clear();
    this.openHandlers.clear();
    this.closeHandlers.clear();
    this.errorHandlers.clear();
  }
};
var BrowserWebSocketClient = class {
  ws = null;
  serverUrl;
  options;
  messageHandlers = /* @__PURE__ */ new Set();
  openHandlers = /* @__PURE__ */ new Set();
  closeHandlers = /* @__PURE__ */ new Set();
  errorHandlers = /* @__PURE__ */ new Set();
  hasConnectedBefore = false;
  constructor(options) {
    if (!isBrowser) {
      throw new Error("BrowserWebSocketClient can only be used in browser environment");
    }
    this.serverUrl = options.serverUrl;
    this.options = {
      autoReconnect: true,
      minReconnectionDelay: 1e3,
      maxReconnectionDelay: 1e4,
      maxRetries: Infinity,
      connectionTimeout: 4e3,
      debug: false,
      ...options
    };
  }
  get readyState() {
    if (!this.ws)
      return "closed";
    const state = this.ws.readyState;
    if (state === 0)
      return "connecting";
    if (state === 1)
      return "open";
    if (state === 2)
      return "closing";
    return "closed";
  }
  async connect() {
    if (this.ws) {
      throw new Error("Already connected or connecting");
    }
    if (this.options.autoReconnect) {
      this.ws = new import_reconnecting_websocket.default(this.serverUrl, [], {
        maxReconnectionDelay: this.options.maxReconnectionDelay,
        minReconnectionDelay: this.options.minReconnectionDelay,
        reconnectionDelayGrowFactor: 1.3,
        connectionTimeout: this.options.connectionTimeout,
        maxRetries: this.options.maxRetries,
        debug: this.options.debug
      });
    } else {
      this.ws = new WebSocket(this.serverUrl);
    }
    return new Promise((resolve4, reject) => {
      const onOpen = () => {
        if (this.hasConnectedBefore) {
          logger2.info("WebSocket reconnected successfully", { serverUrl: this.serverUrl });
        } else {
          logger2.info("WebSocket connected", { serverUrl: this.serverUrl });
          this.hasConnectedBefore = true;
        }
        for (const handler of this.openHandlers) {
          handler();
        }
        resolve4();
      };
      const onError = (_event) => {
        logger2.error("WebSocket connection failed", { serverUrl: this.serverUrl });
        const error = new Error("WebSocket connection failed");
        for (const handler of this.errorHandlers) {
          handler(error);
        }
        reject(error);
      };
      this.ws.addEventListener("open", onOpen, { once: true });
      this.ws.addEventListener("error", onError, { once: true });
      this.ws.addEventListener("message", (event) => {
        const message = event.data;
        try {
          const parsed = JSON.parse(message);
          if (isReliableWrapper(parsed)) {
            this.ws.send(JSON.stringify({ __ack: parsed.__msgId }));
            for (const handler of this.messageHandlers) {
              handler(parsed.__payload);
            }
            return;
          }
        } catch {
        }
        for (const handler of this.messageHandlers) {
          handler(message);
        }
      });
      this.ws.addEventListener("close", () => {
        logger2.info("WebSocket closed, attempting to reconnect...");
        for (const handler of this.closeHandlers) {
          handler();
        }
      });
      this.ws.addEventListener("error", (_event) => {
        logger2.error("WebSocket error");
        const error = new Error("WebSocket error");
        for (const handler of this.errorHandlers) {
          handler(error);
        }
      });
    });
  }
  send(message) {
    if (!this.ws || this.ws.readyState !== 1) {
      throw new Error("WebSocket is not open");
    }
    this.ws.send(message);
  }
  onMessage(handler) {
    this.messageHandlers.add(handler);
    return () => {
      this.messageHandlers.delete(handler);
    };
  }
  onOpen(handler) {
    this.openHandlers.add(handler);
    return () => {
      this.openHandlers.delete(handler);
    };
  }
  onClose(handler) {
    this.closeHandlers.add(handler);
    return () => {
      this.closeHandlers.delete(handler);
    };
  }
  onError(handler) {
    this.errorHandlers.add(handler);
    return () => {
      this.errorHandlers.delete(handler);
    };
  }
  close() {
    if (this.ws) {
      this.ws.close();
      this.ws = null;
    }
  }
  dispose() {
    this.close();
    this.messageHandlers.clear();
    this.openHandlers.clear();
    this.closeHandlers.clear();
    this.errorHandlers.clear();
  }
};
async function createWebSocketClient(options) {
  if (isBrowser) {
    const client = new BrowserWebSocketClient(options);
    await client.connect();
    return client;
  } else {
    const client = new WebSocketClient(options);
    await client.connect();
    return client;
  }
}

// ../../../packages/agentx/dist/index.js
init_dist();
init_dist();
init_dist();
var logger16 = createLogger("agentx/LocalAgentX");
async function createLocalAgentX(config) {
  if (config.logger) {
    const { LoggerFactoryImpl: LoggerFactoryImpl2, setLoggerFactory: setLoggerFactory2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
    LoggerFactoryImpl2.configure({
      defaultLevel: config.logger.level,
      consoleOptions: config.logger.console
    });
    if (config.logger.factory) {
      setLoggerFactory2(config.logger.factory);
    }
  }
  const { createRuntime: createRuntime2, RuntimeEnvironment: RuntimeEnvironment2 } = await Promise.resolve().then(() => (init_dist4(), dist_exports3));
  const { createPersistence: createPersistence2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports2));
  const { sqliteDriver: sqliteDriver2 } = await Promise.resolve().then(() => (init_sqlite(), sqlite_exports));
  const { homedir: homedir4 } = await import("node:os");
  const { join: join6 } = await import("node:path");
  if (config.environment?.claudeCodePath) {
    RuntimeEnvironment2.setClaudeCodePath(config.environment.claudeCodePath);
  }
  if (config.environment?.nodePath) {
    RuntimeEnvironment2.setNodePath(config.environment.nodePath);
  }
  if (config.environment?.gitBashPath) {
    RuntimeEnvironment2.setGitBashPath(config.environment.gitBashPath);
  }
  const basePath = config.agentxDir ?? join6(homedir4(), ".agentx");
  const storagePath = join6(basePath, "data", "agentx.db");
  const persistence = await createPersistence2(sqliteDriver2({ path: storagePath }));
  const { createQueue } = await import("@agentxjs/queue");
  const queuePath = join6(basePath, "data", "queue.db");
  const eventQueue = createQueue({ path: queuePath });
  const runtime = createRuntime2({
    persistence,
    basePath,
    llmProvider: {
      name: "claude",
      provide: () => ({
        apiKey: config.llm?.apiKey ?? "",
        baseUrl: config.llm?.baseUrl,
        model: config.llm?.model
      })
    },
    defaultAgent: config.defaultAgent
  });
  const wsServer = new WebSocketServer2({
    heartbeat: true,
    heartbeatInterval: 3e4,
    debug: false
  });
  const connections = /* @__PURE__ */ new Map();
  function subscribeConnectionToTopic(connectionId, topic) {
    const connState = connections.get(connectionId);
    if (!connState)
      return;
    if (connState.subscribedSessions.has(topic))
      return;
    connState.subscribedSessions.add(topic);
    const unsubscribe = eventQueue.subscribe(topic, (entry) => {
      const event = entry.event;
      const message = JSON.stringify(event);
      connState.connection.sendReliable(message, {
        onAck: () => {
          eventQueue.ack(connectionId, topic, entry.cursor).catch((err) => {
            logger16.error("Failed to ack", { error: err.message });
          });
          persistMessage(event);
        },
        timeout: 1e4,
        onTimeout: () => {
          logger16.warn("ACK timeout for event", {
            connectionId,
            eventType: event.type,
            topic
          });
        }
      });
    });
    connState.connection.onClose(() => {
      unsubscribe();
    });
    logger16.debug("Connection subscribed to queue topic", { connectionId, topic });
  }
  wsServer.onConnection((connection) => {
    connections.set(connection.id, {
      connection,
      subscribedSessions: /* @__PURE__ */ new Set()
    });
    logger16.info("Client connected", { connectionId: connection.id });
    subscribeConnectionToTopic(connection.id, "global");
    connection.onMessage((message) => {
      try {
        const parsed = JSON.parse(message);
        if (parsed.type === "subscribe" && parsed.sessionId) {
          subscribeConnectionToTopic(connection.id, parsed.sessionId);
          const lastCursor = parsed.afterCursor;
          if (lastCursor) {
            eventQueue.recover(parsed.sessionId, lastCursor).then((entries) => {
              for (const entry of entries) {
                connection.send(JSON.stringify(entry.event));
              }
            }).catch((err) => {
              logger16.error("Failed to recover history", { error: err.message });
            });
          }
          return;
        }
        let event = parsed;
        if (config.onClientMessage) {
          const result = config.onClientMessage(event);
          if (result === null || result === void 0) {
            logger16.debug("Message dropped by interceptor", { type: event.type });
            return;
          }
          event = result;
        }
        if (event.type === "message_send_request") {
          const data = event.data;
          const content = data.content;
          if (Array.isArray(content)) {
            logger16.info("Received message_send_request with multimodal content", {
              imageId: data.imageId,
              partsCount: content.length,
              partTypes: content.map((p) => p.type),
              partDetails: content.map((p, i3) => ({
                index: i3,
                type: p.type,
                hasData: "data" in p ? !!p.data : void 0,
                dataType: "data" in p ? typeof p.data : void 0,
                dataLength: "data" in p && typeof p.data === "string" ? p.data.length : void 0,
                dataPreview: "data" in p && typeof p.data === "string" ? p.data.substring(0, 100) : void 0
              }))
            });
          } else {
            logger16.debug("Received message_send_request with text content", {
              imageId: data.imageId,
              contentType: typeof content,
              contentPreview: typeof content === "string" ? content.substring(0, 100) : void 0
            });
          }
        } else {
          logger16.debug("Received client message", {
            type: event.type,
            category: event.category
          });
        }
        runtime.emit(event);
      } catch {
      }
    });
    connection.onClose(() => {
      connections.delete(connection.id);
      logger16.info("Client disconnected", { connectionId: connection.id });
    });
  });
  function shouldEnqueue(event) {
    if (event.source === "environment")
      return false;
    if (event.intent === "request")
      return false;
    return true;
  }
  function persistMessage(event) {
    if (event.category !== "message" || !event.data)
      return;
    const sessionId = event.context?.sessionId;
    if (!sessionId)
      return;
    const message = event.data;
    logger16.debug("Persisting message on ACK", {
      sessionId,
      messageType: event.type,
      messageId: message.id
    });
    persistence.sessions.addMessage(sessionId, message).catch((err) => {
      logger16.error("Failed to persist message", {
        sessionId,
        error: err.message
      });
    });
  }
  runtime.onAny((event) => {
    if (!shouldEnqueue(event)) {
      return;
    }
    const topic = event.context?.sessionId ?? "global";
    eventQueue.publish(topic, event);
  });
  if (config.server) {
    wsServer.attach(config.server, "/ws");
  }
  return {
    request: (type, data, options) => {
      const timeout = typeof options === "number" ? options : options?.timeout;
      return runtime.request(type, data, timeout);
    },
    on: (type, handler) => {
      return runtime.on(type, (event) => {
        if (!shouldEnqueue(event)) {
          return;
        }
        handler(event);
      });
    },
    onCommand: (type, handler) => runtime.onCommand(type, handler),
    emitCommand: (type, data) => runtime.emitCommand(type, data),
    async listen(port, host) {
      if (config.server) {
        throw new Error("Cannot listen when attached to existing server. The server should call listen() instead.");
      }
      await wsServer.listen(port, host);
    },
    async close() {
      await wsServer.close();
    },
    async dispose() {
      await wsServer.dispose();
      await runtime.dispose();
      await eventQueue.close();
    }
  };
}
var remoteLogger = createLogger("agentx/RemoteClient");
async function resolveHeaders(provider) {
  if (!provider)
    return {};
  if (typeof provider === "function") {
    return await provider();
  }
  return provider;
}
async function resolveContext(provider) {
  if (!provider)
    return;
  if (typeof provider === "function") {
    return await provider();
  }
  return provider;
}
async function createRemoteAgentX(config) {
  const connectionHeaders = await resolveHeaders(config.headers);
  const reconnectConfig = config.reconnect ?? {};
  const autoReconnect = reconnectConfig.enabled !== false;
  const maxRetries = reconnectConfig.maxAttempts ?? 5;
  const reconnectDelay = reconnectConfig.delay ?? 1e3;
  remoteLogger.debug("Creating WebSocket client", {
    serverUrl: config.serverUrl,
    hasHeaders: Object.keys(connectionHeaders).length > 0,
    hasContext: !!config.context,
    autoReconnect
  });
  const client = await createWebSocketClient({
    serverUrl: config.serverUrl,
    autoReconnect,
    minReconnectionDelay: reconnectDelay,
    maxReconnectionDelay: reconnectDelay * 10,
    connectionTimeout: 4e3,
    maxRetries: autoReconnect ? maxRetries === Infinity ? Infinity : maxRetries : 0,
    debug: false,
    headers: connectionHeaders
  });
  const handlers = /* @__PURE__ */ new Map();
  const pendingRequests = /* @__PURE__ */ new Map();
  const subscribedSessions = /* @__PURE__ */ new Set(["global"]);
  function subscribeToSession(sessionId) {
    if (subscribedSessions.has(sessionId)) {
      return;
    }
    client.send(JSON.stringify({
      type: "subscribe",
      sessionId
    }));
    subscribedSessions.add(sessionId);
    remoteLogger.debug("Subscribed to session", { sessionId });
  }
  client.onMessage((message) => {
    try {
      const event = JSON.parse(message);
      remoteLogger.info("Received event", {
        type: event.type,
        category: event.category,
        requestId: event.data?.requestId
      });
      if (event.type === "system_error") {
        const errorData = event.data;
        remoteLogger.error(errorData.message, {
          severity: errorData.severity,
          requestId: event.data?.requestId,
          details: errorData.details
        });
      }
      const requestId = event.data?.requestId;
      if (event.category === "response" && requestId && pendingRequests.has(requestId)) {
        remoteLogger.info("Resolving pending request", { requestId, eventType: event.type });
        const pending = pendingRequests.get(requestId);
        clearTimeout(pending.timer);
        pendingRequests.delete(requestId);
        pending.resolve(event);
        return;
      }
      remoteLogger.info("Dispatching to handlers", { type: event.type });
      const typeHandlers = handlers.get(event.type);
      if (typeHandlers) {
        for (const handler of typeHandlers) {
          handler(event);
        }
      }
      const allHandlers = handlers.get("*");
      if (allHandlers) {
        for (const handler of allHandlers) {
          handler(event);
        }
      }
    } catch {
    }
  });
  client.onClose(() => {
    remoteLogger.warn("WebSocket closed");
  });
  client.onError((error) => {
    remoteLogger.error("WebSocket error", { error: error.message });
  });
  client.onOpen(() => {
    if (subscribedSessions.size > 1) {
      remoteLogger.info("Reconnected, re-subscribing to sessions", {
        sessions: Array.from(subscribedSessions)
      });
      for (const sessionId of subscribedSessions) {
        if (sessionId !== "global") {
          client.send(JSON.stringify({
            type: "subscribe",
            sessionId
          }));
        }
      }
    }
  });
  function subscribe(type, handler) {
    if (!handlers.has(type)) {
      handlers.set(type, /* @__PURE__ */ new Set());
    }
    handlers.get(type).add(handler);
    return () => {
      handlers.get(type)?.delete(handler);
    };
  }
  return {
    async request(type, data, options) {
      const opts = typeof options === "number" ? { timeout: options } : options ?? {};
      const timeout = opts.timeout ?? 3e4;
      const defaultContext = await resolveContext(config.context);
      const context = defaultContext || opts.context ? { ...defaultContext, ...opts.context } : void 0;
      remoteLogger.debug("Context resolved", {
        hasConfigContext: !!config.context,
        defaultContext,
        optsContext: opts.context,
        finalContext: context
      });
      const response = await new Promise((resolve4, reject) => {
        const requestId = `req_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
        const timer = setTimeout(() => {
          pendingRequests.delete(requestId);
          reject(new Error(`Request timeout: ${type}`));
        }, timeout);
        pendingRequests.set(requestId, {
          resolve: resolve4,
          reject,
          timer
        });
        const eventData = context ? { ...data, requestId, userContext: context } : { ...data, requestId };
        const event = {
          type,
          timestamp: Date.now(),
          data: eventData,
          source: "command",
          category: "request",
          intent: "request"
        };
        remoteLogger.debug("Sending request", {
          type,
          requestId,
          hasContext: !!context
        });
        client.send(JSON.stringify(event));
      });
      const responseData = response.data;
      if (hasSubscriptions(responseData)) {
        for (const sessionId of responseData.__subscriptions) {
          subscribeToSession(sessionId);
        }
        remoteLogger.debug("Auto-subscribed to sessions from response", {
          type,
          sessionIds: responseData.__subscriptions
        });
      }
      return response;
    },
    on(type, handler) {
      return subscribe(type, handler);
    },
    onCommand(type, handler) {
      return subscribe(type, handler);
    },
    emitCommand(type, data) {
      const event = {
        type,
        timestamp: Date.now(),
        data,
        source: "command",
        category: type.toString().endsWith("_response") ? "response" : "request",
        intent: type.toString().endsWith("_response") ? "result" : "request"
      };
      client.send(JSON.stringify(event));
    },
    async listen() {
      throw new Error("Cannot listen in remote mode");
    },
    async close() {
    },
    async dispose() {
      for (const pending of pendingRequests.values()) {
        clearTimeout(pending.timer);
        pending.reject(new Error("AgentX disposed"));
      }
      pendingRequests.clear();
      handlers.clear();
      subscribedSessions.clear();
      client.dispose();
    }
  };
}
async function createAgentX(config) {
  if (config && isRemoteConfig(config)) {
    return createRemoteAgentX(config);
  }
  return createLocalAgentX(config ?? {});
}

// ../../../packages/logger/dist/index.js
var import_os2 = require("os");
var import_path5 = require("path");
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
  get: (a, b3) => (typeof require !== "undefined" ? require : a)[b3]
}) : x3)(function(x3) {
  if (typeof require !== "undefined") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + x3 + '" is not supported');
});
var __esm2 = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
};
var __commonJS2 = (cb, mod2) => function __require2() {
  return mod2 || (0, cb[__getOwnPropNames2(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
};
var __export2 = (target, all) => {
  for (var name in all)
    __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames2(from))
      if (!__hasOwnProp2.call(to, key) && key !== except)
        __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps2(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  __defProp2(target, "default", { value: mod2, enumerable: true }),
  mod2
));
var __toCommonJS = (mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2);
var require_format = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/format.js"(exports$1, module2) {
    var InvalidFormatError = class _InvalidFormatError extends Error {
      constructor(formatFn) {
        super(`Format functions must be synchronous taking a two arguments: (info, opts)
Found: ${formatFn.toString().split("\n")[0]}
`);
        Error.captureStackTrace(this, _InvalidFormatError);
      }
    };
    module2.exports = (formatFn) => {
      if (formatFn.length > 2) {
        throw new InvalidFormatError(formatFn);
      }
      function Format(options = {}) {
        this.options = options;
      }
      Format.prototype.transform = formatFn;
      function createFormatWrap(opts) {
        return new Format(opts);
      }
      createFormatWrap.Format = Format;
      return createFormatWrap;
    };
  }
});
var require_styles = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/styles.js"(exports$1, module2) {
    var styles = {};
    module2["exports"] = styles;
    var codes = {
      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(codes).forEach(function(key) {
      var val = codes[key];
      var style = styles[key] = [];
      style.open = "\x1B[" + val[0] + "m";
      style.close = "\x1B[" + val[1] + "m";
    });
  }
});
var require_has_flag = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/has-flag.js"(exports$1, module2) {
    module2.exports = function(flag, argv) {
      argv = argv || process.argv || [];
      var terminatorPos = argv.indexOf("--");
      var prefix = /^-{1,2}/.test(flag) ? "" : "--";
      var pos = argv.indexOf(prefix + flag);
      return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
    };
  }
});
var require_supports_colors = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports$1, module2) {
    var os2 = __require("os");
    var hasFlag = require_has_flag();
    var env = process.env;
    var forceColor = void 0;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
      forceColor = false;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      forceColor = true;
    }
    if ("FORCE_COLOR" in env) {
      forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(stream) {
      if (forceColor === false) {
        return 0;
      }
      if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
        return 3;
      }
      if (hasFlag("color=256")) {
        return 2;
      }
      if (stream && !stream.isTTY && forceColor !== true) {
        return 0;
      }
      var min = forceColor ? 1 : 0;
      if (process.platform === "win32") {
        var osRelease = os2.release().split(".");
        if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
          return sign in env;
        }) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if ("TERM_PROGRAM" in env) {
        var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version >= 3 ? 3 : 2;
          case "Hyper":
            return 3;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      if (env.TERM === "dumb") {
        return min;
      }
      return min;
    }
    function getSupportLevel(stream) {
      var level = supportsColor(stream);
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel(process.stdout),
      stderr: getSupportLevel(process.stderr)
    };
  }
});
var require_trap = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/trap.js"(exports$1, module2) {
    module2["exports"] = function runTheTrap(text, options) {
      var result = "";
      text = text || "Run the trap, drop the bass";
      text = text.split("");
      var trap = {
        a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"],
        b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"],
        c: ["\xA9", "\u023B", "\u03FE"],
        d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"],
        e: [
          "\xCB",
          "\u0115",
          "\u018E",
          "\u0258",
          "\u03A3",
          "\u03BE",
          "\u04BC",
          "\u0A6C"
        ],
        f: ["\u04FA"],
        g: ["\u0262"],
        h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"],
        i: ["\u0F0F"],
        j: ["\u0134"],
        k: ["\u0138", "\u04A0", "\u04C3", "\u051E"],
        l: ["\u0139"],
        m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"],
        n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"],
        o: [
          "\xD8",
          "\xF5",
          "\xF8",
          "\u01FE",
          "\u0298",
          "\u047A",
          "\u05DD",
          "\u06DD",
          "\u0E4F"
        ],
        p: ["\u01F7", "\u048E"],
        q: ["\u09CD"],
        r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"],
        s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"],
        t: ["\u0141", "\u0166", "\u0373"],
        u: ["\u01B1", "\u054D"],
        v: ["\u05D8"],
        w: ["\u0428", "\u0460", "\u047C", "\u0D70"],
        x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"],
        y: ["\xA5", "\u04B0", "\u04CB"],
        z: ["\u01B5", "\u0240"]
      };
      text.forEach(function(c3) {
        c3 = c3.toLowerCase();
        var chars = trap[c3] || [" "];
        var rand = Math.floor(Math.random() * chars.length);
        if (typeof trap[c3] !== "undefined") {
          result += trap[c3][rand];
        } else {
          result += c3;
        }
      });
      return result;
    };
  }
});
var require_zalgo = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/zalgo.js"(exports$1, module2) {
    module2["exports"] = function zalgo(text, options) {
      text = text || "   he is here   ";
      var soul = {
        "up": [
          "\u030D",
          "\u030E",
          "\u0304",
          "\u0305",
          "\u033F",
          "\u0311",
          "\u0306",
          "\u0310",
          "\u0352",
          "\u0357",
          "\u0351",
          "\u0307",
          "\u0308",
          "\u030A",
          "\u0342",
          "\u0313",
          "\u0308",
          "\u034A",
          "\u034B",
          "\u034C",
          "\u0303",
          "\u0302",
          "\u030C",
          "\u0350",
          "\u0300",
          "\u0301",
          "\u030B",
          "\u030F",
          "\u0312",
          "\u0313",
          "\u0314",
          "\u033D",
          "\u0309",
          "\u0363",
          "\u0364",
          "\u0365",
          "\u0366",
          "\u0367",
          "\u0368",
          "\u0369",
          "\u036A",
          "\u036B",
          "\u036C",
          "\u036D",
          "\u036E",
          "\u036F",
          "\u033E",
          "\u035B",
          "\u0346",
          "\u031A"
        ],
        "down": [
          "\u0316",
          "\u0317",
          "\u0318",
          "\u0319",
          "\u031C",
          "\u031D",
          "\u031E",
          "\u031F",
          "\u0320",
          "\u0324",
          "\u0325",
          "\u0326",
          "\u0329",
          "\u032A",
          "\u032B",
          "\u032C",
          "\u032D",
          "\u032E",
          "\u032F",
          "\u0330",
          "\u0331",
          "\u0332",
          "\u0333",
          "\u0339",
          "\u033A",
          "\u033B",
          "\u033C",
          "\u0345",
          "\u0347",
          "\u0348",
          "\u0349",
          "\u034D",
          "\u034E",
          "\u0353",
          "\u0354",
          "\u0355",
          "\u0356",
          "\u0359",
          "\u035A",
          "\u0323"
        ],
        "mid": [
          "\u0315",
          "\u031B",
          "\u0300",
          "\u0301",
          "\u0358",
          "\u0321",
          "\u0322",
          "\u0327",
          "\u0328",
          "\u0334",
          "\u0335",
          "\u0336",
          "\u035C",
          "\u035D",
          "\u035E",
          "\u035F",
          "\u0360",
          "\u0362",
          "\u0338",
          "\u0337",
          "\u0361",
          " \u0489"
        ]
      };
      var all = [].concat(soul.up, soul.down, soul.mid);
      function randomNumber(range) {
        var r3 = Math.floor(Math.random() * range);
        return r3;
      }
      function isChar(character) {
        var bool = false;
        all.filter(function(i3) {
          bool = i3 === character;
        });
        return bool;
      }
      function heComes(text2, options2) {
        var result = "";
        var counts;
        var l3;
        options2 = options2 || {};
        options2["up"] = typeof options2["up"] !== "undefined" ? options2["up"] : true;
        options2["mid"] = typeof options2["mid"] !== "undefined" ? options2["mid"] : true;
        options2["down"] = typeof options2["down"] !== "undefined" ? options2["down"] : true;
        options2["size"] = typeof options2["size"] !== "undefined" ? options2["size"] : "maxi";
        text2 = text2.split("");
        for (l3 in text2) {
          if (isChar(l3)) {
            continue;
          }
          result = result + text2[l3];
          counts = { "up": 0, "down": 0, "mid": 0 };
          switch (options2.size) {
            case "mini":
              counts.up = randomNumber(8);
              counts.mid = randomNumber(2);
              counts.down = randomNumber(8);
              break;
            case "maxi":
              counts.up = randomNumber(16) + 3;
              counts.mid = randomNumber(4) + 1;
              counts.down = randomNumber(64) + 3;
              break;
            default:
              counts.up = randomNumber(8) + 1;
              counts.mid = randomNumber(6) / 2;
              counts.down = randomNumber(8) + 1;
              break;
          }
          var arr = ["up", "mid", "down"];
          for (var d3 in arr) {
            var index = arr[d3];
            for (var i3 = 0; i3 <= counts[index]; i3++) {
              if (options2[index]) {
                result = result + soul[index][randomNumber(soul[index].length)];
              }
            }
          }
        }
        return result;
      }
      return heComes(text, options);
    };
  }
});
var require_america = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/america.js"(exports$1, module2) {
    module2["exports"] = function(colors) {
      return function(letter, i3, exploded) {
        if (letter === " ") return letter;
        switch (i3 % 3) {
          case 0:
            return colors.red(letter);
          case 1:
            return colors.white(letter);
          case 2:
            return colors.blue(letter);
        }
      };
    };
  }
});
var require_zebra = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/zebra.js"(exports$1, module2) {
    module2["exports"] = function(colors) {
      return function(letter, i3, exploded) {
        return i3 % 2 === 0 ? letter : colors.inverse(letter);
      };
    };
  }
});
var require_rainbow = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/rainbow.js"(exports$1, module2) {
    module2["exports"] = function(colors) {
      var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
      return function(letter, i3, exploded) {
        if (letter === " ") {
          return letter;
        } else {
          return colors[rainbowColors[i3++ % rainbowColors.length]](letter);
        }
      };
    };
  }
});
var require_random = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/random.js"(exports$1, module2) {
    module2["exports"] = function(colors) {
      var available = [
        "underline",
        "inverse",
        "grey",
        "yellow",
        "red",
        "green",
        "blue",
        "white",
        "cyan",
        "magenta",
        "brightYellow",
        "brightRed",
        "brightGreen",
        "brightBlue",
        "brightWhite",
        "brightCyan",
        "brightMagenta"
      ];
      return function(letter, i3, exploded) {
        return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter);
      };
    };
  }
});
var require_colors = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/colors.js"(exports$1, module2) {
    var colors = {};
    module2["exports"] = colors;
    colors.themes = {};
    var util = __require("util");
    var ansiStyles = colors.styles = require_styles();
    var defineProps = Object.defineProperties;
    var newLineRegex = new RegExp(/[\r\n]+/g);
    colors.supportsColor = require_supports_colors().supportsColor;
    if (typeof colors.enabled === "undefined") {
      colors.enabled = colors.supportsColor() !== false;
    }
    colors.enable = function() {
      colors.enabled = true;
    };
    colors.disable = function() {
      colors.enabled = false;
    };
    colors.stripColors = colors.strip = function(str) {
      return ("" + str).replace(/\x1B\[\d+m/g, "");
    };
    colors.stylize = function stylize2(str, style) {
      if (!colors.enabled) {
        return str + "";
      }
      var styleMap = ansiStyles[style];
      if (!styleMap && style in colors) {
        return colors[style](str);
      }
      return styleMap.open + str + styleMap.close;
    };
    var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
    var escapeStringRegexp = function(str) {
      if (typeof str !== "string") {
        throw new TypeError("Expected a string");
      }
      return str.replace(matchOperatorsRe, "\\$&");
    };
    function build(_styles) {
      var builder = function builder2() {
        return applyStyle.apply(builder2, arguments);
      };
      builder._styles = _styles;
      builder.__proto__ = proto;
      return builder;
    }
    var styles = function() {
      var ret = {};
      ansiStyles.grey = ansiStyles.gray;
      Object.keys(ansiStyles).forEach(function(key) {
        ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
        ret[key] = {
          get: function() {
            return build(this._styles.concat(key));
          }
        };
      });
      return ret;
    }();
    var proto = defineProps(function colors2() {
    }, styles);
    function applyStyle() {
      var args = Array.prototype.slice.call(arguments);
      var str = args.map(function(arg) {
        if (arg != null && arg.constructor === String) {
          return arg;
        } else {
          return util.inspect(arg);
        }
      }).join(" ");
      if (!colors.enabled || !str) {
        return str;
      }
      var newLinesPresent = str.indexOf("\n") != -1;
      var nestedStyles = this._styles;
      var i3 = nestedStyles.length;
      while (i3--) {
        var code = ansiStyles[nestedStyles[i3]];
        str = code.open + str.replace(code.closeRe, code.open) + code.close;
        if (newLinesPresent) {
          str = str.replace(newLineRegex, function(match) {
            return code.close + match + code.open;
          });
        }
      }
      return str;
    }
    colors.setTheme = function(theme) {
      if (typeof theme === "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 style in theme) {
        (function(style2) {
          colors[style2] = function(str) {
            if (typeof theme[style2] === "object") {
              var out = str;
              for (var i3 in theme[style2]) {
                out = colors[theme[style2][i3]](out);
              }
              return out;
            }
            return colors[theme[style2]](str);
          };
        })(style);
      }
    };
    function init() {
      var ret = {};
      Object.keys(styles).forEach(function(name) {
        ret[name] = {
          get: function() {
            return build([name]);
          }
        };
      });
      return ret;
    }
    var sequencer = function sequencer2(map2, str) {
      var exploded = str.split("");
      exploded = exploded.map(map2);
      return exploded.join("");
    };
    colors.trap = require_trap();
    colors.zalgo = require_zalgo();
    colors.maps = {};
    colors.maps.america = require_america()(colors);
    colors.maps.zebra = require_zebra()(colors);
    colors.maps.rainbow = require_rainbow()(colors);
    colors.maps.random = require_random()(colors);
    for (map in colors.maps) {
      (function(map2) {
        colors[map2] = function(str) {
          return sequencer(colors.maps[map2], str);
        };
      })(map);
    }
    var map;
    defineProps(colors, init());
  }
});
var require_safe = __commonJS2({
  "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/safe.js"(exports$1, module2) {
    var colors = require_colors();
    module2["exports"] = colors;
  }
});
var require_cli = __commonJS2({
  "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/cli.js"(exports$1) {
    exports$1.levels = {
      error: 0,
      warn: 1,
      help: 2,
      data: 3,
      info: 4,
      debug: 5,
      prompt: 6,
      verbose: 7,
      input: 8,
      silly: 9
    };
    exports$1.colors = {
      error: "red",
      warn: "yellow",
      help: "cyan",
      data: "grey",
      info: "green",
      debug: "blue",
      prompt: "grey",
      verbose: "cyan",
      input: "grey",
      silly: "magenta"
    };
  }
});
var require_npm = __commonJS2({
  "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/npm.js"(exports$1) {
    exports$1.levels = {
      error: 0,
      warn: 1,
      info: 2,
      http: 3,
      verbose: 4,
      debug: 5,
      silly: 6
    };
    exports$1.colors = {
      error: "red",
      warn: "yellow",
      info: "green",
      http: "green",
      verbose: "cyan",
      debug: "blue",
      silly: "magenta"
    };
  }
});
var require_syslog = __commonJS2({
  "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/syslog.js"(exports$1) {
    exports$1.levels = {
      emerg: 0,
      alert: 1,
      crit: 2,
      error: 3,
      warning: 4,
      notice: 5,
      info: 6,
      debug: 7
    };
    exports$1.colors = {
      emerg: "red",
      alert: "yellow",
      crit: "red",
      error: "red",
      warning: "red",
      notice: "yellow",
      info: "green",
      debug: "blue"
    };
  }
});
var require_config2 = __commonJS2({
  "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/index.js"(exports$1) {
    Object.defineProperty(exports$1, "cli", {
      value: require_cli()
    });
    Object.defineProperty(exports$1, "npm", {
      value: require_npm()
    });
    Object.defineProperty(exports$1, "syslog", {
      value: require_syslog()
    });
  }
});
var require_triple_beam = __commonJS2({
  "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/index.js"(exports$1) {
    Object.defineProperty(exports$1, "LEVEL", {
      value: /* @__PURE__ */ Symbol.for("level")
    });
    Object.defineProperty(exports$1, "MESSAGE", {
      value: /* @__PURE__ */ Symbol.for("message")
    });
    Object.defineProperty(exports$1, "SPLAT", {
      value: /* @__PURE__ */ Symbol.for("splat")
    });
    Object.defineProperty(exports$1, "configs", {
      value: require_config2()
    });
  }
});
var require_colorize = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/colorize.js"(exports$1, module2) {
    var colors = require_safe();
    var { LEVEL, MESSAGE } = require_triple_beam();
    colors.enabled = true;
    var hasSpace = /\s+/;
    var Colorizer = class _Colorizer {
      constructor(opts = {}) {
        if (opts.colors) {
          this.addColors(opts.colors);
        }
        this.options = opts;
      }
      /*
       * Adds the colors Object to the set of allColors
       * known by the Colorizer
       *
       * @param {Object} colors Set of color mappings to add.
       */
      static addColors(clrs) {
        const nextColors = Object.keys(clrs).reduce((acc, level) => {
          acc[level] = hasSpace.test(clrs[level]) ? clrs[level].split(hasSpace) : clrs[level];
          return acc;
        }, {});
        _Colorizer.allColors = Object.assign({}, _Colorizer.allColors || {}, nextColors);
        return _Colorizer.allColors;
      }
      /*
       * Adds the colors Object to the set of allColors
       * known by the Colorizer
       *
       * @param {Object} colors Set of color mappings to add.
       */
      addColors(clrs) {
        return _Colorizer.addColors(clrs);
      }
      /*
       * function colorize (lookup, level, message)
       * Performs multi-step colorization using @colors/colors/safe
       */
      colorize(lookup, level, message) {
        if (typeof message === "undefined") {
          message = level;
        }
        if (!Array.isArray(_Colorizer.allColors[lookup])) {
          return colors[_Colorizer.allColors[lookup]](message);
        }
        for (let i3 = 0, len = _Colorizer.allColors[lookup].length; i3 < len; i3++) {
          message = colors[_Colorizer.allColors[lookup][i3]](message);
        }
        return message;
      }
      /*
       * function transform (info, opts)
       * Attempts to colorize the { level, message } of the given
       * `logform` info object.
       */
      transform(info, opts) {
        if (opts.all && typeof info[MESSAGE] === "string") {
          info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]);
        }
        if (opts.level || opts.all || !opts.message) {
          info.level = this.colorize(info[LEVEL], info.level);
        }
        if (opts.all || opts.message) {
          info.message = this.colorize(info[LEVEL], info.level, info.message);
        }
        return info;
      }
    };
    module2.exports = (opts) => new Colorizer(opts);
    module2.exports.Colorizer = module2.exports.Format = Colorizer;
  }
});
var require_levels = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/levels.js"(exports$1, module2) {
    var { Colorizer } = require_colorize();
    module2.exports = (config) => {
      Colorizer.addColors(config.colors || config);
      return config;
    };
  }
});
var require_align = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/align.js"(exports$1, module2) {
    var format2 = require_format();
    module2.exports = format2((info) => {
      info.message = `	${info.message}`;
      return info;
    });
  }
});
var require_errors = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/errors.js"(exports$1, module2) {
    var format2 = require_format();
    var { LEVEL, MESSAGE } = require_triple_beam();
    module2.exports = format2((einfo, { stack, cause }) => {
      if (einfo instanceof Error) {
        const info = Object.assign({}, einfo, {
          level: einfo.level,
          [LEVEL]: einfo[LEVEL] || einfo.level,
          message: einfo.message,
          [MESSAGE]: einfo[MESSAGE] || einfo.message
        });
        if (stack) info.stack = einfo.stack;
        if (cause) info.cause = einfo.cause;
        return info;
      }
      if (!(einfo.message instanceof Error)) return einfo;
      const err = einfo.message;
      Object.assign(einfo, err);
      einfo.message = err.message;
      einfo[MESSAGE] = err.message;
      if (stack) einfo.stack = err.stack;
      if (cause) einfo.cause = err.cause;
      return einfo;
    });
  }
});
var require_pad_levels = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/pad-levels.js"(exports$1, module2) {
    var { configs, LEVEL, MESSAGE } = require_triple_beam();
    var Padder = class _Padder {
      constructor(opts = { levels: configs.npm.levels }) {
        this.paddings = _Padder.paddingForLevels(opts.levels, opts.filler);
        this.options = opts;
      }
      /**
       * Returns the maximum length of keys in the specified `levels` Object.
       * @param  {Object} levels Set of all levels to calculate longest level against.
       * @returns {Number} Maximum length of the longest level string.
       */
      static getLongestLevel(levels) {
        const lvls = Object.keys(levels).map((level) => level.length);
        return Math.max(...lvls);
      }
      /**
       * 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`
       */
      static paddingForLevel(level, filler, maxLength) {
        const targetLen = maxLength + 1 - level.length;
        const rep = Math.floor(targetLen / filler.length);
        const padding = `${filler}${filler.repeat(rep)}`;
        return padding.slice(0, targetLen);
      }
      /**
       * 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.
       */
      static paddingForLevels(levels, filler = " ") {
        const maxLength = _Padder.getLongestLevel(levels);
        return Object.keys(levels).reduce((acc, level) => {
          acc[level] = _Padder.paddingForLevel(level, filler, maxLength);
          return acc;
        }, {});
      }
      /**
       * 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.
       */
      transform(info, opts) {
        info.message = `${this.paddings[info[LEVEL]]}${info.message}`;
        if (info[MESSAGE]) {
          info[MESSAGE] = `${this.paddings[info[LEVEL]]}${info[MESSAGE]}`;
        }
        return info;
      }
    };
    module2.exports = (opts) => new Padder(opts);
    module2.exports.Padder = module2.exports.Format = Padder;
  }
});
var require_cli2 = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/cli.js"(exports$1, module2) {
    var { Colorizer } = require_colorize();
    var { Padder } = require_pad_levels();
    var { configs, MESSAGE } = require_triple_beam();
    var CliFormat = class {
      constructor(opts = {}) {
        if (!opts.levels) {
          opts.levels = configs.cli.levels;
        }
        this.colorizer = new Colorizer(opts);
        this.padder = new Padder(opts);
        this.options = opts;
      }
      /*
       * function transform (info, opts)
       * Attempts to both:
       * 1. Pad the { level }
       * 2. Colorize the { level, message }
       * of the given `logform` info object depending on the `opts`.
       */
      transform(info, opts) {
        this.colorizer.transform(
          this.padder.transform(info, opts),
          opts
        );
        info[MESSAGE] = `${info.level}:${info.message}`;
        return info;
      }
    };
    module2.exports = (opts) => new CliFormat(opts);
    module2.exports.Format = CliFormat;
  }
});
var require_combine = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/combine.js"(exports$1, module2) {
    var format2 = require_format();
    function cascade(formats) {
      if (!formats.every(isValidFormat)) {
        return;
      }
      return (info) => {
        let obj = info;
        for (let i3 = 0; i3 < formats.length; i3++) {
          obj = formats[i3].transform(obj, formats[i3].options);
          if (!obj) {
            return false;
          }
        }
        return obj;
      };
    }
    function isValidFormat(fmt) {
      if (typeof fmt.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("\n"));
      }
      return true;
    }
    module2.exports = (...formats) => {
      const combinedFormat = format2(cascade(formats));
      const instance = combinedFormat();
      instance.Format = combinedFormat.Format;
      return instance;
    };
    module2.exports.cascade = cascade;
  }
});
var require_safe_stable_stringify = __commonJS2({
  "../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports$1, module2) {
    var { hasOwnProperty } = Object.prototype;
    var stringify3 = configure();
    stringify3.configure = configure;
    stringify3.stringify = stringify3;
    stringify3.default = stringify3;
    exports$1.stringify = stringify3;
    exports$1.configure = configure;
    module2.exports = stringify3;
    var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
    function strEscape(str) {
      if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) {
        return `"${str}"`;
      }
      return JSON.stringify(str);
    }
    function sort(array, comparator) {
      if (array.length > 200 || comparator) {
        return array.sort(comparator);
      }
      for (let i3 = 1; i3 < array.length; i3++) {
        const currentValue = array[i3];
        let position = i3;
        while (position !== 0 && array[position - 1] > currentValue) {
          array[position] = array[position - 1];
          position--;
        }
        array[position] = currentValue;
      }
      return array;
    }
    var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
      Object.getPrototypeOf(
        Object.getPrototypeOf(
          new Int8Array()
        )
      ),
      Symbol.toStringTag
    ).get;
    function isTypedArrayWithEntries(value) {
      return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0;
    }
    function stringifyTypedArray(array, separator, maximumBreadth) {
      if (array.length < maximumBreadth) {
        maximumBreadth = array.length;
      }
      const whitespace = separator === "," ? "" : " ";
      let res = `"0":${whitespace}${array[0]}`;
      for (let i3 = 1; i3 < maximumBreadth; i3++) {
        res += `${separator}"${i3}":${whitespace}${array[i3]}`;
      }
      return res;
    }
    function getCircularValueOption(options) {
      if (hasOwnProperty.call(options, "circularValue")) {
        const circularValue = options.circularValue;
        if (typeof circularValue === "string") {
          return `"${circularValue}"`;
        }
        if (circularValue == null) {
          return circularValue;
        }
        if (circularValue === Error || circularValue === 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 getDeterministicOption(options) {
      let value;
      if (hasOwnProperty.call(options, "deterministic")) {
        value = options.deterministic;
        if (typeof value !== "boolean" && typeof value !== "function") {
          throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
        }
      }
      return value === void 0 ? true : value;
    }
    function getBooleanOption(options, key) {
      let value;
      if (hasOwnProperty.call(options, key)) {
        value = options[key];
        if (typeof value !== "boolean") {
          throw new TypeError(`The "${key}" argument must be of type boolean`);
        }
      }
      return value === void 0 ? true : value;
    }
    function getPositiveIntegerOption(options, key) {
      let value;
      if (hasOwnProperty.call(options, key)) {
        value = options[key];
        if (typeof value !== "number") {
          throw new TypeError(`The "${key}" argument must be of type number`);
        }
        if (!Number.isInteger(value)) {
          throw new TypeError(`The "${key}" argument must be an integer`);
        }
        if (value < 1) {
          throw new RangeError(`The "${key}" argument must be >= 1`);
        }
      }
      return value === void 0 ? Infinity : value;
    }
    function getItemCount(number) {
      if (number === 1) {
        return "1 item";
      }
      return `${number} items`;
    }
    function getUniqueReplacerSet(replacerArray) {
      const replacerSet = /* @__PURE__ */ new Set();
      for (const value of replacerArray) {
        if (typeof value === "string" || typeof value === "number") {
          replacerSet.add(String(value));
        }
      }
      return replacerSet;
    }
    function getStrictOption(options) {
      if (hasOwnProperty.call(options, "strict")) {
        const value = options.strict;
        if (typeof value !== "boolean") {
          throw new TypeError('The "strict" argument must be of type boolean');
        }
        if (value) {
          return (value2) => {
            let message = `Object can not safely be stringified. Received type ${typeof value2}`;
            if (typeof value2 !== "function") message += ` (${value2.toString()})`;
            throw new Error(message);
          };
        }
      }
    }
    function configure(options) {
      options = { ...options };
      const fail = getStrictOption(options);
      if (fail) {
        if (options.bigint === void 0) {
          options.bigint = false;
        }
        if (!("circularValue" in options)) {
          options.circularValue = Error;
        }
      }
      const circularValue = getCircularValueOption(options);
      const bigint = getBooleanOption(options, "bigint");
      const deterministic = getDeterministicOption(options);
      const comparator = typeof deterministic === "function" ? deterministic : void 0;
      const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
      const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
      function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
        let value = parent[key];
        if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
          value = value.toJSON(key);
        }
        value = replacer.call(parent, key, value);
        switch (typeof value) {
          case "string":
            return strEscape(value);
          case "object": {
            if (value === null) {
              return "null";
            }
            if (stack.indexOf(value) !== -1) {
              return circularValue;
            }
            let res = "";
            let join22 = ",";
            const originalIndentation = indentation;
            if (Array.isArray(value)) {
              if (value.length === 0) {
                return "[]";
              }
              if (maximumDepth < stack.length + 1) {
                return '"[Array]"';
              }
              stack.push(value);
              if (spacer !== "") {
                indentation += spacer;
                res += `
${indentation}`;
                join22 = `,
${indentation}`;
              }
              const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
              let i3 = 0;
              for (; i3 < maximumValuesToStringify - 1; i3++) {
                const tmp2 = stringifyFnReplacer(String(i3), value, stack, replacer, spacer, indentation);
                res += tmp2 !== void 0 ? tmp2 : "null";
                res += join22;
              }
              const tmp = stringifyFnReplacer(String(i3), value, stack, replacer, spacer, indentation);
              res += tmp !== void 0 ? tmp : "null";
              if (value.length - 1 > maximumBreadth) {
                const removedKeys = value.length - maximumBreadth - 1;
                res += `${join22}"... ${getItemCount(removedKeys)} not stringified"`;
              }
              if (spacer !== "") {
                res += `
${originalIndentation}`;
              }
              stack.pop();
              return `[${res}]`;
            }
            let keys = Object.keys(value);
            const keyLength = keys.length;
            if (keyLength === 0) {
              return "{}";
            }
            if (maximumDepth < stack.length + 1) {
              return '"[Object]"';
            }
            let whitespace = "";
            let separator = "";
            if (spacer !== "") {
              indentation += spacer;
              join22 = `,
${indentation}`;
              whitespace = " ";
            }
            const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
            if (deterministic && !isTypedArrayWithEntries(value)) {
              keys = sort(keys, comparator);
            }
            stack.push(value);
            for (let i3 = 0; i3 < maximumPropertiesToStringify; i3++) {
              const key2 = keys[i3];
              const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
              if (tmp !== void 0) {
                res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
                separator = join22;
              }
            }
            if (keyLength > maximumBreadth) {
              const removedKeys = keyLength - maximumBreadth;
              res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
              separator = join22;
            }
            if (spacer !== "" && separator.length > 1) {
              res = `
${indentation}${res}
${originalIndentation}`;
            }
            stack.pop();
            return `{${res}}`;
          }
          case "number":
            return isFinite(value) ? String(value) : fail ? fail(value) : "null";
          case "boolean":
            return value === true ? "true" : "false";
          case "undefined":
            return void 0;
          case "bigint":
            if (bigint) {
              return String(value);
            }
          // fallthrough
          default:
            return fail ? fail(value) : void 0;
        }
      }
      function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
        if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
          value = value.toJSON(key);
        }
        switch (typeof value) {
          case "string":
            return strEscape(value);
          case "object": {
            if (value === null) {
              return "null";
            }
            if (stack.indexOf(value) !== -1) {
              return circularValue;
            }
            const originalIndentation = indentation;
            let res = "";
            let join22 = ",";
            if (Array.isArray(value)) {
              if (value.length === 0) {
                return "[]";
              }
              if (maximumDepth < stack.length + 1) {
                return '"[Array]"';
              }
              stack.push(value);
              if (spacer !== "") {
                indentation += spacer;
                res += `
${indentation}`;
                join22 = `,
${indentation}`;
              }
              const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
              let i3 = 0;
              for (; i3 < maximumValuesToStringify - 1; i3++) {
                const tmp2 = stringifyArrayReplacer(String(i3), value[i3], stack, replacer, spacer, indentation);
                res += tmp2 !== void 0 ? tmp2 : "null";
                res += join22;
              }
              const tmp = stringifyArrayReplacer(String(i3), value[i3], stack, replacer, spacer, indentation);
              res += tmp !== void 0 ? tmp : "null";
              if (value.length - 1 > maximumBreadth) {
                const removedKeys = value.length - maximumBreadth - 1;
                res += `${join22}"... ${getItemCount(removedKeys)} not stringified"`;
              }
              if (spacer !== "") {
                res += `
${originalIndentation}`;
              }
              stack.pop();
              return `[${res}]`;
            }
            stack.push(value);
            let whitespace = "";
            if (spacer !== "") {
              indentation += spacer;
              join22 = `,
${indentation}`;
              whitespace = " ";
            }
            let separator = "";
            for (const key2 of replacer) {
              const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
              if (tmp !== void 0) {
                res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
                separator = join22;
              }
            }
            if (spacer !== "" && separator.length > 1) {
              res = `
${indentation}${res}
${originalIndentation}`;
            }
            stack.pop();
            return `{${res}}`;
          }
          case "number":
            return isFinite(value) ? String(value) : fail ? fail(value) : "null";
          case "boolean":
            return value === true ? "true" : "false";
          case "undefined":
            return void 0;
          case "bigint":
            if (bigint) {
              return String(value);
            }
          // fallthrough
          default:
            return fail ? fail(value) : void 0;
        }
      }
      function stringifyIndent(key, value, stack, spacer, indentation) {
        switch (typeof value) {
          case "string":
            return strEscape(value);
          case "object": {
            if (value === null) {
              return "null";
            }
            if (typeof value.toJSON === "function") {
              value = value.toJSON(key);
              if (typeof value !== "object") {
                return stringifyIndent(key, value, stack, spacer, indentation);
              }
              if (value === null) {
                return "null";
              }
            }
            if (stack.indexOf(value) !== -1) {
              return circularValue;
            }
            const originalIndentation = indentation;
            if (Array.isArray(value)) {
              if (value.length === 0) {
                return "[]";
              }
              if (maximumDepth < stack.length + 1) {
                return '"[Array]"';
              }
              stack.push(value);
              indentation += spacer;
              let res2 = `
${indentation}`;
              const join32 = `,
${indentation}`;
              const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
              let i3 = 0;
              for (; i3 < maximumValuesToStringify - 1; i3++) {
                const tmp2 = stringifyIndent(String(i3), value[i3], stack, spacer, indentation);
                res2 += tmp2 !== void 0 ? tmp2 : "null";
                res2 += join32;
              }
              const tmp = stringifyIndent(String(i3), value[i3], stack, spacer, indentation);
              res2 += tmp !== void 0 ? tmp : "null";
              if (value.length - 1 > maximumBreadth) {
                const removedKeys = value.length - maximumBreadth - 1;
                res2 += `${join32}"... ${getItemCount(removedKeys)} not stringified"`;
              }
              res2 += `
${originalIndentation}`;
              stack.pop();
              return `[${res2}]`;
            }
            let keys = Object.keys(value);
            const keyLength = keys.length;
            if (keyLength === 0) {
              return "{}";
            }
            if (maximumDepth < stack.length + 1) {
              return '"[Object]"';
            }
            indentation += spacer;
            const join22 = `,
${indentation}`;
            let res = "";
            let separator = "";
            let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
            if (isTypedArrayWithEntries(value)) {
              res += stringifyTypedArray(value, join22, maximumBreadth);
              keys = keys.slice(value.length);
              maximumPropertiesToStringify -= value.length;
              separator = join22;
            }
            if (deterministic) {
              keys = sort(keys, comparator);
            }
            stack.push(value);
            for (let i3 = 0; i3 < maximumPropertiesToStringify; i3++) {
              const key2 = keys[i3];
              const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
              if (tmp !== void 0) {
                res += `${separator}${strEscape(key2)}: ${tmp}`;
                separator = join22;
              }
            }
            if (keyLength > maximumBreadth) {
              const removedKeys = keyLength - maximumBreadth;
              res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
              separator = join22;
            }
            if (separator !== "") {
              res = `
${indentation}${res}
${originalIndentation}`;
            }
            stack.pop();
            return `{${res}}`;
          }
          case "number":
            return isFinite(value) ? String(value) : fail ? fail(value) : "null";
          case "boolean":
            return value === true ? "true" : "false";
          case "undefined":
            return void 0;
          case "bigint":
            if (bigint) {
              return String(value);
            }
          // fallthrough
          default:
            return fail ? fail(value) : void 0;
        }
      }
      function stringifySimple(key, value, stack) {
        switch (typeof value) {
          case "string":
            return strEscape(value);
          case "object": {
            if (value === null) {
              return "null";
            }
            if (typeof value.toJSON === "function") {
              value = value.toJSON(key);
              if (typeof value !== "object") {
                return stringifySimple(key, value, stack);
              }
              if (value === null) {
                return "null";
              }
            }
            if (stack.indexOf(value) !== -1) {
              return circularValue;
            }
            let res = "";
            const hasLength = value.length !== void 0;
            if (hasLength && Array.isArray(value)) {
              if (value.length === 0) {
                return "[]";
              }
              if (maximumDepth < stack.length + 1) {
                return '"[Array]"';
              }
              stack.push(value);
              const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
              let i3 = 0;
              for (; i3 < maximumValuesToStringify - 1; i3++) {
                const tmp2 = stringifySimple(String(i3), value[i3], stack);
                res += tmp2 !== void 0 ? tmp2 : "null";
                res += ",";
              }
              const tmp = stringifySimple(String(i3), value[i3], stack);
              res += tmp !== void 0 ? tmp : "null";
              if (value.length - 1 > maximumBreadth) {
                const removedKeys = value.length - maximumBreadth - 1;
                res += `,"... ${getItemCount(removedKeys)} not stringified"`;
              }
              stack.pop();
              return `[${res}]`;
            }
            let keys = Object.keys(value);
            const keyLength = keys.length;
            if (keyLength === 0) {
              return "{}";
            }
            if (maximumDepth < stack.length + 1) {
              return '"[Object]"';
            }
            let separator = "";
            let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
            if (hasLength && isTypedArrayWithEntries(value)) {
              res += stringifyTypedArray(value, ",", maximumBreadth);
              keys = keys.slice(value.length);
              maximumPropertiesToStringify -= value.length;
              separator = ",";
            }
            if (deterministic) {
              keys = sort(keys, comparator);
            }
            stack.push(value);
            for (let i3 = 0; i3 < maximumPropertiesToStringify; i3++) {
              const key2 = keys[i3];
              const tmp = stringifySimple(key2, value[key2], stack);
              if (tmp !== void 0) {
                res += `${separator}${strEscape(key2)}:${tmp}`;
                separator = ",";
              }
            }
            if (keyLength > maximumBreadth) {
              const removedKeys = keyLength - maximumBreadth;
              res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
            }
            stack.pop();
            return `{${res}}`;
          }
          case "number":
            return isFinite(value) ? String(value) : fail ? fail(value) : "null";
          case "boolean":
            return value === true ? "true" : "false";
          case "undefined":
            return void 0;
          case "bigint":
            if (bigint) {
              return String(value);
            }
          // fallthrough
          default:
            return fail ? fail(value) : void 0;
        }
      }
      function stringify22(value, replacer, space) {
        if (arguments.length > 1) {
          let spacer = "";
          if (typeof space === "number") {
            spacer = " ".repeat(Math.min(space, 10));
          } else if (typeof space === "string") {
            spacer = space.slice(0, 10);
          }
          if (replacer != null) {
            if (typeof replacer === "function") {
              return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
            }
            if (Array.isArray(replacer)) {
              return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
            }
          }
          if (spacer.length !== 0) {
            return stringifyIndent("", value, [], spacer, "");
          }
        }
        return stringifySimple("", value, []);
      }
      return stringify22;
    }
  }
});
var require_json = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/json.js"(exports$1, module2) {
    var format2 = require_format();
    var { MESSAGE } = require_triple_beam();
    var stringify3 = require_safe_stable_stringify();
    function replacer(key, value) {
      if (typeof value === "bigint")
        return value.toString();
      return value;
    }
    module2.exports = format2((info, opts) => {
      const jsonStringify = stringify3.configure(opts);
      info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space);
      return info;
    });
  }
});
var require_label = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/label.js"(exports$1, module2) {
    var format2 = require_format();
    module2.exports = format2((info, opts) => {
      if (opts.message) {
        info.message = `[${opts.label}] ${info.message}`;
        return info;
      }
      info.label = opts.label;
      return info;
    });
  }
});
var require_logstash = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/logstash.js"(exports$1, module2) {
    var format2 = require_format();
    var { MESSAGE } = require_triple_beam();
    var jsonStringify = require_safe_stable_stringify();
    module2.exports = format2((info) => {
      const logstash = {};
      if (info.message) {
        logstash["@message"] = info.message;
        delete info.message;
      }
      if (info.timestamp) {
        logstash["@timestamp"] = info.timestamp;
        delete info.timestamp;
      }
      logstash["@fields"] = info;
      info[MESSAGE] = jsonStringify(logstash);
      return info;
    });
  }
});
var require_metadata = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/metadata.js"(exports$1, module2) {
    var format2 = require_format();
    function fillExcept(info, fillExceptKeys, metadataKey) {
      const savedKeys = fillExceptKeys.reduce((acc, key) => {
        acc[key] = info[key];
        delete info[key];
        return acc;
      }, {});
      const metadata = Object.keys(info).reduce((acc, key) => {
        acc[key] = info[key];
        delete info[key];
        return acc;
      }, {});
      Object.assign(info, savedKeys, {
        [metadataKey]: metadata
      });
      return info;
    }
    function fillWith(info, fillWithKeys, metadataKey) {
      info[metadataKey] = fillWithKeys.reduce((acc, key) => {
        acc[key] = info[key];
        delete info[key];
        return acc;
      }, {});
      return info;
    }
    module2.exports = format2((info, opts = {}) => {
      let metadataKey = "metadata";
      if (opts.key) {
        metadataKey = opts.key;
      }
      let fillExceptKeys = [];
      if (!opts.fillExcept && !opts.fillWith) {
        fillExceptKeys.push("level");
        fillExceptKeys.push("message");
      }
      if (opts.fillExcept) {
        fillExceptKeys = opts.fillExcept;
      }
      if (fillExceptKeys.length > 0) {
        return fillExcept(info, fillExceptKeys, metadataKey);
      }
      if (opts.fillWith) {
        return fillWith(info, opts.fillWith, metadataKey);
      }
      return info;
    });
  }
});
var require_ms = __commonJS2({
  "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports$1, module2) {
    var s = 1e3;
    var m = s * 60;
    var h3 = m * 60;
    var d3 = h3 * 24;
    var w5 = d3 * 7;
    var y3 = d3 * 365.25;
    module2.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse2(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse2(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n3 = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n3 * y3;
        case "weeks":
        case "week":
        case "w":
          return n3 * w5;
        case "days":
        case "day":
        case "d":
          return n3 * d3;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n3 * h3;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n3 * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n3 * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n3;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d3) {
        return Math.round(ms / d3) + "d";
      }
      if (msAbs >= h3) {
        return Math.round(ms / h3) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d3) {
        return plural(ms, msAbs, d3, "day");
      }
      if (msAbs >= h3) {
        return plural(ms, msAbs, h3, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n3, name) {
      var isPlural = msAbs >= n3 * 1.5;
      return Math.round(ms / n3) + " " + name + (isPlural ? "s" : "");
    }
  }
});
var require_ms2 = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/ms.js"(exports$1, module2) {
    var format2 = require_format();
    var ms = require_ms();
    module2.exports = format2((info) => {
      const curr = +/* @__PURE__ */ new Date();
      exports$1.diff = curr - (exports$1.prevTime || curr);
      exports$1.prevTime = curr;
      info.ms = `+${ms(exports$1.diff)}`;
      return info;
    });
  }
});
var require_pretty_print = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/pretty-print.js"(exports$1, module2) {
    var inspect = __require("util").inspect;
    var format2 = require_format();
    var { LEVEL, MESSAGE, SPLAT } = require_triple_beam();
    module2.exports = format2((info, opts = {}) => {
      const stripped = Object.assign({}, info);
      delete stripped[LEVEL];
      delete stripped[MESSAGE];
      delete stripped[SPLAT];
      info[MESSAGE] = inspect(stripped, false, opts.depth || null, opts.colorize);
      return info;
    });
  }
});
var require_printf = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/printf.js"(exports$1, module2) {
    var { MESSAGE } = require_triple_beam();
    var Printf = class {
      constructor(templateFn) {
        this.template = templateFn;
      }
      transform(info) {
        info[MESSAGE] = this.template(info);
        return info;
      }
    };
    module2.exports = (opts) => new Printf(opts);
    module2.exports.Printf = module2.exports.Format = Printf;
  }
});
var require_simple = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/simple.js"(exports$1, module2) {
    var format2 = require_format();
    var { MESSAGE } = require_triple_beam();
    var jsonStringify = require_safe_stable_stringify();
    module2.exports = format2((info) => {
      const stringifiedRest = jsonStringify(Object.assign({}, info, {
        level: void 0,
        message: void 0,
        splat: void 0
      }));
      const padding = info.padding && info.padding[info.level] || "";
      if (stringifiedRest !== "{}") {
        info[MESSAGE] = `${info.level}:${padding} ${info.message} ${stringifiedRest}`;
      } else {
        info[MESSAGE] = `${info.level}:${padding} ${info.message}`;
      }
      return info;
    });
  }
});
var require_splat = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/splat.js"(exports$1, module2) {
    var util = __require("util");
    var { SPLAT } = require_triple_beam();
    var formatRegExp = /%[scdjifoO%]/g;
    var escapedPercent = /%%/g;
    var Splatter = class {
      constructor(opts) {
        this.options = opts;
      }
      /**
         * Check to see if tokens <= splat.length, assign { splat, meta } into the
         * `info` accordingly, and write to this instance.
         *
         * @param  {Info} info Logform info message.
         * @param  {String[]} tokens Set of string interpolation tokens.
         * @returns {Info} Modified info message
         * @private
         */
      _splat(info, tokens) {
        const msg = info.message;
        const splat = info[SPLAT] || info.splat || [];
        const percents = msg.match(escapedPercent);
        const escapes = percents && percents.length || 0;
        const expectedSplat = tokens.length - escapes;
        const extraSplat = expectedSplat - splat.length;
        const metas = extraSplat < 0 ? splat.splice(extraSplat, -1 * extraSplat) : [];
        const metalen = metas.length;
        if (metalen) {
          for (let i3 = 0; i3 < metalen; i3++) {
            Object.assign(info, metas[i3]);
          }
        }
        info.message = util.format(msg, ...splat);
        return info;
      }
      /**
        * 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
        */
      transform(info) {
        const msg = info.message;
        const splat = info[SPLAT] || info.splat;
        if (!splat || !splat.length) {
          return info;
        }
        const tokens = msg && msg.match && msg.match(formatRegExp);
        if (!tokens && (splat || splat.length)) {
          const metas = splat.length > 1 ? splat.splice(0) : splat;
          const metalen = metas.length;
          if (metalen) {
            for (let i3 = 0; i3 < metalen; i3++) {
              Object.assign(info, metas[i3]);
            }
          }
          return info;
        }
        if (tokens) {
          return this._splat(info, tokens);
        }
        return info;
      }
    };
    module2.exports = (opts) => new Splatter(opts);
  }
});
var fecha_exports = {};
__export2(fecha_exports, {
  assign: () => assign,
  default: () => fecha_default,
  defaultI18n: () => defaultI18n,
  format: () => format,
  parse: () => parse,
  setGlobalDateI18n: () => setGlobalDateI18n,
  setGlobalDateMasks: () => setGlobalDateMasks
});
function shorten(arr, sLen) {
  var newArr = [];
  for (var i3 = 0, len = arr.length; i3 < len; i3++) {
    newArr.push(arr[i3].substr(0, sLen));
  }
  return newArr;
}
function assign(origObj) {
  var args = [];
  for (var _i = 1; _i < arguments.length; _i++) {
    args[_i - 1] = arguments[_i];
  }
  for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
    var obj = args_1[_a];
    for (var key in obj) {
      origObj[key] = obj[key];
    }
  }
  return origObj;
}
function parse(dateStr, format2, i18n) {
  if (i18n === void 0) {
    i18n = {};
  }
  if (typeof format2 !== "string") {
    throw new Error("Invalid format in fecha parse");
  }
  format2 = globalMasks[format2] || format2;
  if (dateStr.length > 1e3) {
    return null;
  }
  var today = /* @__PURE__ */ new Date();
  var dateInfo = {
    year: today.getFullYear(),
    month: 0,
    day: 1,
    hour: 0,
    minute: 0,
    second: 0,
    millisecond: 0,
    isPm: null,
    timezoneOffset: null
  };
  var parseInfo = [];
  var literals = [];
  var newFormat = format2.replace(literal, function($0, $1) {
    literals.push(regexEscape($1));
    return "@@@";
  });
  var specifiedFields = {};
  var requiredFields = {};
  newFormat = regexEscape(newFormat).replace(token, function($0) {
    var info = parseFlags[$0];
    var field2 = info[0], regex = info[1], requiredField = info[3];
    if (specifiedFields[field2]) {
      throw new Error("Invalid format. " + field2 + " specified twice in format");
    }
    specifiedFields[field2] = true;
    if (requiredField) {
      requiredFields[requiredField] = true;
    }
    parseInfo.push(info);
    return "(" + regex + ")";
  });
  Object.keys(requiredFields).forEach(function(field2) {
    if (!specifiedFields[field2]) {
      throw new Error("Invalid format. " + field2 + " is required in specified format");
    }
  });
  newFormat = newFormat.replace(/@@@/g, function() {
    return literals.shift();
  });
  var matches = dateStr.match(new RegExp(newFormat, "i"));
  if (!matches) {
    return null;
  }
  var combinedI18nSettings = assign(assign({}, globalI18n), i18n);
  for (var i3 = 1; i3 < matches.length; i3++) {
    var _a = parseInfo[i3 - 1], field = _a[0], parser = _a[2];
    var value = parser ? parser(matches[i3], combinedI18nSettings) : +matches[i3];
    if (value == null) {
      return null;
    }
    dateInfo[field] = value;
  }
  if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) {
    dateInfo.hour = +dateInfo.hour + 12;
  } else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) {
    dateInfo.hour = 0;
  }
  var dateTZ;
  if (dateInfo.timezoneOffset == null) {
    dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond);
    var validateFields = [
      ["month", "getMonth"],
      ["day", "getDate"],
      ["hour", "getHours"],
      ["minute", "getMinutes"],
      ["second", "getSeconds"]
    ];
    for (var i3 = 0, len = validateFields.length; i3 < len; i3++) {
      if (specifiedFields[validateFields[i3][0]] && dateInfo[validateFields[i3][0]] !== dateTZ[validateFields[i3][1]]()) {
        return null;
      }
    }
  } else {
    dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond));
    if (dateInfo.month > 11 || dateInfo.month < 0 || dateInfo.day > 31 || dateInfo.day < 1 || dateInfo.hour > 23 || dateInfo.hour < 0 || dateInfo.minute > 59 || dateInfo.minute < 0 || dateInfo.second > 59 || dateInfo.second < 0) {
      return null;
    }
  }
  return dateTZ;
}
var token;
var twoDigitsOptional;
var twoDigits;
var threeDigits;
var fourDigits;
var word;
var literal;
var monthUpdate;
var dayNames;
var monthNames;
var monthNamesShort;
var dayNamesShort;
var defaultI18n;
var globalI18n;
var setGlobalDateI18n;
var regexEscape;
var pad;
var formatFlags;
var monthParse;
var emptyDigits;
var emptyWord;
var amPm;
var timezoneOffset;
var parseFlags;
var globalMasks;
var setGlobalDateMasks;
var format;
var fecha;
var fecha_default;
var init_fecha = __esm2({
  "../../node_modules/.pnpm/fecha@4.2.3/node_modules/fecha/lib/fecha.js"() {
    token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
    twoDigitsOptional = "\\d\\d?";
    twoDigits = "\\d\\d";
    threeDigits = "\\d{3}";
    fourDigits = "\\d{4}";
    word = "[^\\s]+";
    literal = /\[([^]*?)\]/gm;
    monthUpdate = function(arrName) {
      return function(v3, i18n) {
        var lowerCaseArr = i18n[arrName].map(function(v22) {
          return v22.toLowerCase();
        });
        var index = lowerCaseArr.indexOf(v3.toLowerCase());
        if (index > -1) {
          return index;
        }
        return null;
      };
    };
    dayNames = [
      "Sunday",
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday"
    ];
    monthNames = [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    ];
    monthNamesShort = shorten(monthNames, 3);
    dayNamesShort = shorten(dayNames, 3);
    defaultI18n = {
      dayNamesShort,
      dayNames,
      monthNamesShort,
      monthNames,
      amPm: ["am", "pm"],
      DoFn: function(dayOfMonth) {
        return dayOfMonth + ["th", "st", "nd", "rd"][dayOfMonth % 10 > 3 ? 0 : (dayOfMonth - dayOfMonth % 10 !== 10 ? 1 : 0) * dayOfMonth % 10];
      }
    };
    globalI18n = assign({}, defaultI18n);
    setGlobalDateI18n = function(i18n) {
      return globalI18n = assign(globalI18n, i18n);
    };
    regexEscape = function(str) {
      return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&");
    };
    pad = function(val, len) {
      if (len === void 0) {
        len = 2;
      }
      val = String(val);
      while (val.length < len) {
        val = "0" + val;
      }
      return val;
    };
    formatFlags = {
      D: function(dateObj) {
        return String(dateObj.getDate());
      },
      DD: function(dateObj) {
        return pad(dateObj.getDate());
      },
      Do: function(dateObj, i18n) {
        return i18n.DoFn(dateObj.getDate());
      },
      d: function(dateObj) {
        return String(dateObj.getDay());
      },
      dd: function(dateObj) {
        return pad(dateObj.getDay());
      },
      ddd: function(dateObj, i18n) {
        return i18n.dayNamesShort[dateObj.getDay()];
      },
      dddd: function(dateObj, i18n) {
        return i18n.dayNames[dateObj.getDay()];
      },
      M: function(dateObj) {
        return String(dateObj.getMonth() + 1);
      },
      MM: function(dateObj) {
        return pad(dateObj.getMonth() + 1);
      },
      MMM: function(dateObj, i18n) {
        return i18n.monthNamesShort[dateObj.getMonth()];
      },
      MMMM: function(dateObj, i18n) {
        return i18n.monthNames[dateObj.getMonth()];
      },
      YY: function(dateObj) {
        return pad(String(dateObj.getFullYear()), 4).substr(2);
      },
      YYYY: function(dateObj) {
        return pad(dateObj.getFullYear(), 4);
      },
      h: function(dateObj) {
        return String(dateObj.getHours() % 12 || 12);
      },
      hh: function(dateObj) {
        return pad(dateObj.getHours() % 12 || 12);
      },
      H: function(dateObj) {
        return String(dateObj.getHours());
      },
      HH: function(dateObj) {
        return pad(dateObj.getHours());
      },
      m: function(dateObj) {
        return String(dateObj.getMinutes());
      },
      mm: function(dateObj) {
        return pad(dateObj.getMinutes());
      },
      s: function(dateObj) {
        return String(dateObj.getSeconds());
      },
      ss: function(dateObj) {
        return pad(dateObj.getSeconds());
      },
      S: function(dateObj) {
        return String(Math.round(dateObj.getMilliseconds() / 100));
      },
      SS: function(dateObj) {
        return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
      },
      SSS: function(dateObj) {
        return pad(dateObj.getMilliseconds(), 3);
      },
      a: function(dateObj, i18n) {
        return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];
      },
      A: function(dateObj, i18n) {
        return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();
      },
      ZZ: function(dateObj) {
        var offset = dateObj.getTimezoneOffset();
        return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60) * 100 + Math.abs(offset) % 60, 4);
      },
      Z: function(dateObj) {
        var offset = dateObj.getTimezoneOffset();
        return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60), 2) + ":" + pad(Math.abs(offset) % 60, 2);
      }
    };
    monthParse = function(v3) {
      return +v3 - 1;
    };
    emptyDigits = [null, twoDigitsOptional];
    emptyWord = [null, word];
    amPm = [
      "isPm",
      word,
      function(v3, i18n) {
        var val = v3.toLowerCase();
        if (val === i18n.amPm[0]) {
          return 0;
        } else if (val === i18n.amPm[1]) {
          return 1;
        }
        return null;
      }
    ];
    timezoneOffset = [
      "timezoneOffset",
      "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",
      function(v3) {
        var parts = (v3 + "").match(/([+-]|\d\d)/gi);
        if (parts) {
          var minutes = +parts[1] * 60 + parseInt(parts[2], 10);
          return parts[0] === "+" ? minutes : -minutes;
        }
        return 0;
      }
    ];
    parseFlags = {
      D: ["day", twoDigitsOptional],
      DD: ["day", twoDigits],
      Do: ["day", twoDigitsOptional + word, function(v3) {
        return parseInt(v3, 10);
      }],
      M: ["month", twoDigitsOptional, monthParse],
      MM: ["month", twoDigits, monthParse],
      YY: [
        "year",
        twoDigits,
        function(v3) {
          var now = /* @__PURE__ */ new Date();
          var cent = +("" + now.getFullYear()).substr(0, 2);
          return +("" + (+v3 > 68 ? cent - 1 : cent) + v3);
        }
      ],
      h: ["hour", twoDigitsOptional, void 0, "isPm"],
      hh: ["hour", twoDigits, void 0, "isPm"],
      H: ["hour", twoDigitsOptional],
      HH: ["hour", twoDigits],
      m: ["minute", twoDigitsOptional],
      mm: ["minute", twoDigits],
      s: ["second", twoDigitsOptional],
      ss: ["second", twoDigits],
      YYYY: ["year", fourDigits],
      S: ["millisecond", "\\d", function(v3) {
        return +v3 * 100;
      }],
      SS: ["millisecond", twoDigits, function(v3) {
        return +v3 * 10;
      }],
      SSS: ["millisecond", threeDigits],
      d: emptyDigits,
      dd: emptyDigits,
      ddd: emptyWord,
      dddd: emptyWord,
      MMM: ["month", word, monthUpdate("monthNamesShort")],
      MMMM: ["month", word, monthUpdate("monthNames")],
      a: amPm,
      A: amPm,
      ZZ: timezoneOffset,
      Z: timezoneOffset
    };
    globalMasks = {
      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"
    };
    setGlobalDateMasks = function(masks) {
      return assign(globalMasks, masks);
    };
    format = function(dateObj, mask, i18n) {
      if (mask === void 0) {
        mask = globalMasks["default"];
      }
      if (i18n === void 0) {
        i18n = {};
      }
      if (typeof dateObj === "number") {
        dateObj = new Date(dateObj);
      }
      if (Object.prototype.toString.call(dateObj) !== "[object Date]" || isNaN(dateObj.getTime())) {
        throw new Error("Invalid Date pass to format");
      }
      mask = globalMasks[mask] || mask;
      var literals = [];
      mask = mask.replace(literal, function($0, $1) {
        literals.push($1);
        return "@@@";
      });
      var combinedI18nSettings = assign(assign({}, globalI18n), i18n);
      mask = mask.replace(token, function($0) {
        return formatFlags[$0](dateObj, combinedI18nSettings);
      });
      return mask.replace(/@@@/g, function() {
        return literals.shift();
      });
    };
    fecha = {
      format,
      parse,
      defaultI18n,
      setGlobalDateI18n,
      setGlobalDateMasks
    };
    fecha_default = fecha;
  }
});
var require_timestamp2 = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/timestamp.js"(exports$1, module2) {
    var fecha2 = (init_fecha(), __toCommonJS(fecha_exports));
    var format2 = require_format();
    module2.exports = format2((info, opts = {}) => {
      if (opts.format) {
        info.timestamp = typeof opts.format === "function" ? opts.format() : fecha2.format(/* @__PURE__ */ new Date(), opts.format);
      }
      if (!info.timestamp) {
        info.timestamp = (/* @__PURE__ */ new Date()).toISOString();
      }
      if (opts.alias) {
        info[opts.alias] = info.timestamp;
      }
      return info;
    });
  }
});
var require_uncolorize = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/uncolorize.js"(exports$1, module2) {
    var colors = require_safe();
    var format2 = require_format();
    var { MESSAGE } = require_triple_beam();
    module2.exports = format2((info, opts) => {
      if (opts.level !== false) {
        info.level = colors.strip(info.level);
      }
      if (opts.message !== false) {
        info.message = colors.strip(String(info.message));
      }
      if (opts.raw !== false && info[MESSAGE]) {
        info[MESSAGE] = colors.strip(String(info[MESSAGE]));
      }
      return info;
    });
  }
});
var require_logform = __commonJS2({
  "../../node_modules/.pnpm/logform@2.7.0/node_modules/logform/index.js"(exports$1) {
    var format2 = exports$1.format = require_format();
    exports$1.levels = require_levels();
    function exposeFormat(name, requireFormat) {
      Object.defineProperty(format2, name, {
        get() {
          return requireFormat();
        },
        configurable: true
      });
    }
    exposeFormat("align", function() {
      return require_align();
    });
    exposeFormat("errors", function() {
      return require_errors();
    });
    exposeFormat("cli", function() {
      return require_cli2();
    });
    exposeFormat("combine", function() {
      return require_combine();
    });
    exposeFormat("colorize", function() {
      return require_colorize();
    });
    exposeFormat("json", function() {
      return require_json();
    });
    exposeFormat("label", function() {
      return require_label();
    });
    exposeFormat("logstash", function() {
      return require_logstash();
    });
    exposeFormat("metadata", function() {
      return require_metadata();
    });
    exposeFormat("ms", function() {
      return require_ms2();
    });
    exposeFormat("padLevels", function() {
      return require_pad_levels();
    });
    exposeFormat("prettyPrint", function() {
      return require_pretty_print();
    });
    exposeFormat("printf", function() {
      return require_printf();
    });
    exposeFormat("simple", function() {
      return require_simple();
    });
    exposeFormat("splat", function() {
      return require_splat();
    });
    exposeFormat("timestamp", function() {
      return require_timestamp2();
    });
    exposeFormat("uncolorize", function() {
      return require_uncolorize();
    });
  }
});
var require_common = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/common.js"(exports$1) {
    var { format: format2 } = __require("util");
    exports$1.warn = {
      deprecated(prop) {
        return () => {
          throw new Error(format2("{ %s } was removed in winston@3.0.0.", prop));
        };
      },
      useFormat(prop) {
        return () => {
          throw new Error([
            format2("{ %s } was removed in winston@3.0.0.", prop),
            "Use a custom winston.format = winston.format(function) instead."
          ].join("\n"));
        };
      },
      forFunctions(obj, type, props) {
        props.forEach((prop) => {
          obj[prop] = exports$1.warn[type](prop);
        });
      },
      forProperties(obj, type, props) {
        props.forEach((prop) => {
          const notice = exports$1.warn[type](prop);
          Object.defineProperty(obj, prop, {
            get: notice,
            set: notice
          });
        });
      }
    };
  }
});
var require_package = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/package.json"(exports$1, module2) {
    module2.exports = {
      name: "winston",
      description: "A logger for just about everything.",
      version: "3.19.0",
      author: "Charlie Robbins <charlie.robbins@gmail.com>",
      maintainers: [
        "David Hyde <dabh@alumni.stanford.edu>"
      ],
      repository: {
        type: "git",
        url: "https://github.com/winstonjs/winston.git"
      },
      keywords: [
        "winston",
        "logger",
        "logging",
        "logs",
        "sysadmin",
        "bunyan",
        "pino",
        "loglevel",
        "tools",
        "json",
        "stream"
      ],
      dependencies: {
        "@dabh/diagnostics": "^2.0.8",
        "@colors/colors": "^1.6.0",
        async: "^3.2.3",
        "is-stream": "^2.0.0",
        logform: "^2.7.0",
        "one-time": "^1.0.0",
        "readable-stream": "^3.4.0",
        "safe-stable-stringify": "^2.3.1",
        "stack-trace": "0.0.x",
        "triple-beam": "^1.3.0",
        "winston-transport": "^4.9.0"
      },
      devDependencies: {
        "@babel/cli": "^7.23.9",
        "@babel/core": "^7.24.0",
        "@babel/preset-env": "^7.24.0",
        "@dabh/eslint-config-populist": "^4.4.0",
        "@types/node": "^20.11.24",
        "abstract-winston-transport": "^0.5.1",
        assume: "^2.2.0",
        "cross-spawn-async": "^2.2.5",
        eslint: "^8.57.0",
        hock: "^1.4.1",
        jest: "^29.7.0",
        rimraf: "5.0.10",
        split2: "^4.1.0",
        "std-mocks": "^2.0.0",
        through2: "^4.0.2",
        "winston-compat": "^0.1.5"
      },
      main: "./lib/winston.js",
      browser: "./dist/winston",
      types: "./index.d.ts",
      scripts: {
        lint: "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
        test: "jest",
        "test:unit": "jest -c test/jest.config.unit.js",
        "test:integration": "jest -c test/jest.config.integration.js",
        "test:typescript": "npx --package typescript tsc --project test",
        build: "babel lib -d dist",
        prebuild: "rimraf dist",
        prepublishOnly: "npm run build"
      },
      engines: {
        node: ">= 12.0.0"
      },
      license: "MIT"
    };
  }
});
var require_node = __commonJS2({
  "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports$1, module2) {
    module2.exports = __require("util").deprecate;
  }
});
var require_stream2 = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports$1, module2) {
    module2.exports = __require("stream");
  }
});
var require_destroy = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports$1, module2) {
    function destroy(err, cb) {
      var _this = this;
      var readableDestroyed = this._readableState && this._readableState.destroyed;
      var writableDestroyed = this._writableState && this._writableState.destroyed;
      if (readableDestroyed || writableDestroyed) {
        if (cb) {
          cb(err);
        } else if (err) {
          if (!this._writableState) {
            process.nextTick(emitErrorNT, this, err);
          } else if (!this._writableState.errorEmitted) {
            this._writableState.errorEmitted = true;
            process.nextTick(emitErrorNT, this, err);
          }
        }
        return this;
      }
      if (this._readableState) {
        this._readableState.destroyed = true;
      }
      if (this._writableState) {
        this._writableState.destroyed = true;
      }
      this._destroy(err || null, function(err2) {
        if (!cb && err2) {
          if (!_this._writableState) {
            process.nextTick(emitErrorAndCloseNT, _this, err2);
          } else if (!_this._writableState.errorEmitted) {
            _this._writableState.errorEmitted = true;
            process.nextTick(emitErrorAndCloseNT, _this, err2);
          } else {
            process.nextTick(emitCloseNT, _this);
          }
        } else if (cb) {
          process.nextTick(emitCloseNT, _this);
          cb(err2);
        } else {
          process.nextTick(emitCloseNT, _this);
        }
      });
      return this;
    }
    function emitErrorAndCloseNT(self2, err) {
      emitErrorNT(self2, err);
      emitCloseNT(self2);
    }
    function emitCloseNT(self2) {
      if (self2._writableState && !self2._writableState.emitClose) return;
      if (self2._readableState && !self2._readableState.emitClose) return;
      self2.emit("close");
    }
    function undestroy() {
      if (this._readableState) {
        this._readableState.destroyed = false;
        this._readableState.reading = false;
        this._readableState.ended = false;
        this._readableState.endEmitted = false;
      }
      if (this._writableState) {
        this._writableState.destroyed = false;
        this._writableState.ended = false;
        this._writableState.ending = false;
        this._writableState.finalCalled = false;
        this._writableState.prefinished = false;
        this._writableState.finished = false;
        this._writableState.errorEmitted = false;
      }
    }
    function emitErrorNT(self2, err) {
      self2.emit("error", err);
    }
    function errorOrDestroy(stream, err) {
      var rState = stream._readableState;
      var wState = stream._writableState;
      if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
      else stream.emit("error", err);
    }
    module2.exports = {
      destroy,
      undestroy,
      errorOrDestroy
    };
  }
});
var require_errors2 = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js"(exports$1, module2) {
    var codes = {};
    function createErrorType(code, message, Base) {
      if (!Base) {
        Base = Error;
      }
      function getMessage(arg1, arg2, arg3) {
        if (typeof message === "string") {
          return message;
        } else {
          return message(arg1, arg2, arg3);
        }
      }
      class NodeError extends Base {
        constructor(arg1, arg2, arg3) {
          super(getMessage(arg1, arg2, arg3));
        }
      }
      NodeError.prototype.name = Base.name;
      NodeError.prototype.code = code;
      codes[code] = NodeError;
    }
    function oneOf(expected, thing) {
      if (Array.isArray(expected)) {
        const len = expected.length;
        expected = expected.map((i3) => String(i3));
        if (len > 2) {
          return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1];
        } else if (len === 2) {
          return `one of ${thing} ${expected[0]} or ${expected[1]}`;
        } else {
          return `of ${thing} ${expected[0]}`;
        }
      } else {
        return `of ${thing} ${String(expected)}`;
      }
    }
    function startsWith(str, search, pos) {
      return str.substr(0, search.length) === search;
    }
    function endsWith(str, search, this_len) {
      if (this_len === void 0 || this_len > str.length) {
        this_len = str.length;
      }
      return str.substring(this_len - search.length, this_len) === search;
    }
    function includes(str, search, start) {
      if (typeof start !== "number") {
        start = 0;
      }
      if (start + search.length > str.length) {
        return false;
      } else {
        return str.indexOf(search, start) !== -1;
      }
    }
    createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
      return 'The value "' + value + '" is invalid for option "' + name + '"';
    }, TypeError);
    createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
      let determiner;
      if (typeof expected === "string" && startsWith(expected, "not ")) {
        determiner = "must not be";
        expected = expected.replace(/^not /, "");
      } else {
        determiner = "must be";
      }
      let msg;
      if (endsWith(name, " argument")) {
        msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`;
      } else {
        const type = includes(name, ".") ? "property" : "argument";
        msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`;
      }
      msg += `. Received type ${typeof actual}`;
      return msg;
    }, TypeError);
    createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
    createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
      return "The " + name + " method is not implemented";
    });
    createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
    createErrorType("ERR_STREAM_DESTROYED", function(name) {
      return "Cannot call " + name + " after a stream was destroyed";
    });
    createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
    createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
    createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
    createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
    createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
      return "Unknown encoding: " + arg;
    }, TypeError);
    createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
    module2.exports.codes = codes;
  }
});
var require_state = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js"(exports$1, module2) {
    var ERR_INVALID_OPT_VALUE = require_errors2().codes.ERR_INVALID_OPT_VALUE;
    function highWaterMarkFrom(options, isDuplex, duplexKey) {
      return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
    }
    function getHighWaterMark(state, options, duplexKey, isDuplex) {
      var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
      if (hwm != null) {
        if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
          var name = isDuplex ? duplexKey : "highWaterMark";
          throw new ERR_INVALID_OPT_VALUE(name, hwm);
        }
        return Math.floor(hwm);
      }
      return state.objectMode ? 16 : 16 * 1024;
    }
    module2.exports = {
      getHighWaterMark
    };
  }
});
var require_inherits_browser = __commonJS2({
  "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports$1, module2) {
    if (typeof Object.create === "function") {
      module2.exports = function inherits(ctor, superCtor) {
        if (superCtor) {
          ctor.super_ = superCtor;
          ctor.prototype = Object.create(superCtor.prototype, {
            constructor: {
              value: ctor,
              enumerable: false,
              writable: true,
              configurable: true
            }
          });
        }
      };
    } else {
      module2.exports = function inherits(ctor, superCtor) {
        if (superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {
          };
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor();
          ctor.prototype.constructor = ctor;
        }
      };
    }
  }
});
var require_inherits = __commonJS2({
  "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports$1, module2) {
    try {
      util = __require("util");
      if (typeof util.inherits !== "function") throw "";
      module2.exports = util.inherits;
    } catch (e3) {
      module2.exports = require_inherits_browser();
    }
    var util;
  }
});
var require_buffer_list = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports$1, module2) {
    function ownKeys(object, enumerableOnly) {
      var keys = Object.keys(object);
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        enumerableOnly && (symbols = symbols.filter(function(sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        })), keys.push.apply(keys, symbols);
      }
      return keys;
    }
    function _objectSpread(target) {
      for (var i3 = 1; i3 < arguments.length; i3++) {
        var source = null != arguments[i3] ? arguments[i3] : {};
        i3 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
          _defineProperty(target, key, source[key]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
      return target;
    }
    function _defineProperty(obj, key, value) {
      key = _toPropertyKey(key);
      if (key in obj) {
        Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }
      return obj;
    }
    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }
    function _defineProperties(target, props) {
      for (var i3 = 0; i3 < props.length; i3++) {
        var descriptor = props[i3];
        descriptor.enumerable = descriptor.enumerable || false;
        descriptor.configurable = true;
        if ("value" in descriptor) descriptor.writable = true;
        Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
      }
    }
    function _createClass(Constructor, protoProps, staticProps) {
      if (protoProps) _defineProperties(Constructor.prototype, protoProps);
      Object.defineProperty(Constructor, "prototype", { writable: false });
      return Constructor;
    }
    function _toPropertyKey(arg) {
      var key = _toPrimitive(arg, "string");
      return typeof key === "symbol" ? key : String(key);
    }
    function _toPrimitive(input, hint) {
      if (typeof input !== "object" || input === null) return input;
      var prim = input[Symbol.toPrimitive];
      if (prim !== void 0) {
        var res = prim.call(input, hint);
        if (typeof res !== "object") return res;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return String(input);
    }
    var _require = __require("buffer");
    var Buffer2 = _require.Buffer;
    var _require2 = __require("util");
    var inspect = _require2.inspect;
    var custom = inspect && inspect.custom || "inspect";
    function copyBuffer(src, target, offset) {
      Buffer2.prototype.copy.call(src, target, offset);
    }
    module2.exports = /* @__PURE__ */ function() {
      function BufferList() {
        _classCallCheck(this, BufferList);
        this.head = null;
        this.tail = null;
        this.length = 0;
      }
      _createClass(BufferList, [{
        key: "push",
        value: function push(v3) {
          var entry = {
            data: v3,
            next: null
          };
          if (this.length > 0) this.tail.next = entry;
          else this.head = entry;
          this.tail = entry;
          ++this.length;
        }
      }, {
        key: "unshift",
        value: function unshift(v3) {
          var entry = {
            data: v3,
            next: this.head
          };
          if (this.length === 0) this.tail = entry;
          this.head = entry;
          ++this.length;
        }
      }, {
        key: "shift",
        value: function shift() {
          if (this.length === 0) return;
          var ret = this.head.data;
          if (this.length === 1) this.head = this.tail = null;
          else this.head = this.head.next;
          --this.length;
          return ret;
        }
      }, {
        key: "clear",
        value: function clear() {
          this.head = this.tail = null;
          this.length = 0;
        }
      }, {
        key: "join",
        value: function join22(s) {
          if (this.length === 0) return "";
          var p = this.head;
          var ret = "" + p.data;
          while (p = p.next) ret += s + p.data;
          return ret;
        }
      }, {
        key: "concat",
        value: function concat(n3) {
          if (this.length === 0) return Buffer2.alloc(0);
          var ret = Buffer2.allocUnsafe(n3 >>> 0);
          var p = this.head;
          var i3 = 0;
          while (p) {
            copyBuffer(p.data, ret, i3);
            i3 += p.data.length;
            p = p.next;
          }
          return ret;
        }
        // Consumes a specified amount of bytes or characters from the buffered data.
      }, {
        key: "consume",
        value: function consume(n3, hasStrings) {
          var ret;
          if (n3 < this.head.data.length) {
            ret = this.head.data.slice(0, n3);
            this.head.data = this.head.data.slice(n3);
          } else if (n3 === this.head.data.length) {
            ret = this.shift();
          } else {
            ret = hasStrings ? this._getString(n3) : this._getBuffer(n3);
          }
          return ret;
        }
      }, {
        key: "first",
        value: function first() {
          return this.head.data;
        }
        // Consumes a specified amount of characters from the buffered data.
      }, {
        key: "_getString",
        value: function _getString(n3) {
          var p = this.head;
          var c3 = 1;
          var ret = p.data;
          n3 -= ret.length;
          while (p = p.next) {
            var str = p.data;
            var nb = n3 > str.length ? str.length : n3;
            if (nb === str.length) ret += str;
            else ret += str.slice(0, n3);
            n3 -= nb;
            if (n3 === 0) {
              if (nb === str.length) {
                ++c3;
                if (p.next) this.head = p.next;
                else this.head = this.tail = null;
              } else {
                this.head = p;
                p.data = str.slice(nb);
              }
              break;
            }
            ++c3;
          }
          this.length -= c3;
          return ret;
        }
        // Consumes a specified amount of bytes from the buffered data.
      }, {
        key: "_getBuffer",
        value: function _getBuffer(n3) {
          var ret = Buffer2.allocUnsafe(n3);
          var p = this.head;
          var c3 = 1;
          p.data.copy(ret);
          n3 -= p.data.length;
          while (p = p.next) {
            var buf = p.data;
            var nb = n3 > buf.length ? buf.length : n3;
            buf.copy(ret, ret.length - n3, 0, nb);
            n3 -= nb;
            if (n3 === 0) {
              if (nb === buf.length) {
                ++c3;
                if (p.next) this.head = p.next;
                else this.head = this.tail = null;
              } else {
                this.head = p;
                p.data = buf.slice(nb);
              }
              break;
            }
            ++c3;
          }
          this.length -= c3;
          return ret;
        }
        // Make sure the linked list only shows the minimal necessary information.
      }, {
        key: custom,
        value: function value(_, options) {
          return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
            // Only inspect one level.
            depth: 0,
            // It should not recurse.
            customInspect: false
          }));
        }
      }]);
      return BufferList;
    }();
  }
});
var require_safe_buffer = __commonJS2({
  "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$1, module2) {
    var buffer = __require("buffer");
    var Buffer2 = buffer.Buffer;
    function copyProps(src, dst) {
      for (var key in src) {
        dst[key] = src[key];
      }
    }
    if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
      module2.exports = buffer;
    } else {
      copyProps(buffer, exports$1);
      exports$1.Buffer = SafeBuffer;
    }
    function SafeBuffer(arg, encodingOrOffset, length) {
      return Buffer2(arg, encodingOrOffset, length);
    }
    SafeBuffer.prototype = Object.create(Buffer2.prototype);
    copyProps(Buffer2, SafeBuffer);
    SafeBuffer.from = function(arg, encodingOrOffset, length) {
      if (typeof arg === "number") {
        throw new TypeError("Argument must not be a number");
      }
      return Buffer2(arg, encodingOrOffset, length);
    };
    SafeBuffer.alloc = function(size, fill, encoding) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      var buf = Buffer2(size);
      if (fill !== void 0) {
        if (typeof encoding === "string") {
          buf.fill(fill, encoding);
        } else {
          buf.fill(fill);
        }
      } else {
        buf.fill(0);
      }
      return buf;
    };
    SafeBuffer.allocUnsafe = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return Buffer2(size);
    };
    SafeBuffer.allocUnsafeSlow = function(size) {
      if (typeof size !== "number") {
        throw new TypeError("Argument must be a number");
      }
      return buffer.SlowBuffer(size);
    };
  }
});
var require_string_decoder = __commonJS2({
  "../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js"(exports$1) {
    var Buffer2 = require_safe_buffer().Buffer;
    var isEncoding = Buffer2.isEncoding || function(encoding) {
      encoding = "" + encoding;
      switch (encoding && encoding.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 true;
        default:
          return false;
      }
    };
    function _normalizeEncoding(enc) {
      if (!enc) return "utf8";
      var retried;
      while (true) {
        switch (enc) {
          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 enc;
          default:
            if (retried) return;
            enc = ("" + enc).toLowerCase();
            retried = true;
        }
      }
    }
    function normalizeEncoding(enc) {
      var nenc = _normalizeEncoding(enc);
      if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
      return nenc || enc;
    }
    exports$1.StringDecoder = StringDecoder;
    function StringDecoder(encoding) {
      this.encoding = normalizeEncoding(encoding);
      var nb;
      switch (this.encoding) {
        case "utf16le":
          this.text = utf16Text;
          this.end = utf16End;
          nb = 4;
          break;
        case "utf8":
          this.fillLast = utf8FillLast;
          nb = 4;
          break;
        case "base64":
          this.text = base64Text;
          this.end = base64End;
          nb = 3;
          break;
        default:
          this.write = simpleWrite;
          this.end = simpleEnd;
          return;
      }
      this.lastNeed = 0;
      this.lastTotal = 0;
      this.lastChar = Buffer2.allocUnsafe(nb);
    }
    StringDecoder.prototype.write = function(buf) {
      if (buf.length === 0) return "";
      var r3;
      var i3;
      if (this.lastNeed) {
        r3 = this.fillLast(buf);
        if (r3 === void 0) return "";
        i3 = this.lastNeed;
        this.lastNeed = 0;
      } else {
        i3 = 0;
      }
      if (i3 < buf.length) return r3 ? r3 + this.text(buf, i3) : this.text(buf, i3);
      return r3 || "";
    };
    StringDecoder.prototype.end = utf8End;
    StringDecoder.prototype.text = utf8Text;
    StringDecoder.prototype.fillLast = function(buf) {
      if (this.lastNeed <= buf.length) {
        buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
        return this.lastChar.toString(this.encoding, 0, this.lastTotal);
      }
      buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
      this.lastNeed -= buf.length;
    };
    function utf8CheckByte(byte) {
      if (byte <= 127) return 0;
      else if (byte >> 5 === 6) return 2;
      else if (byte >> 4 === 14) return 3;
      else if (byte >> 3 === 30) return 4;
      return byte >> 6 === 2 ? -1 : -2;
    }
    function utf8CheckIncomplete(self2, buf, i3) {
      var j3 = buf.length - 1;
      if (j3 < i3) return 0;
      var nb = utf8CheckByte(buf[j3]);
      if (nb >= 0) {
        if (nb > 0) self2.lastNeed = nb - 1;
        return nb;
      }
      if (--j3 < i3 || nb === -2) return 0;
      nb = utf8CheckByte(buf[j3]);
      if (nb >= 0) {
        if (nb > 0) self2.lastNeed = nb - 2;
        return nb;
      }
      if (--j3 < i3 || nb === -2) return 0;
      nb = utf8CheckByte(buf[j3]);
      if (nb >= 0) {
        if (nb > 0) {
          if (nb === 2) nb = 0;
          else self2.lastNeed = nb - 3;
        }
        return nb;
      }
      return 0;
    }
    function utf8CheckExtraBytes(self2, buf, p) {
      if ((buf[0] & 192) !== 128) {
        self2.lastNeed = 0;
        return "\uFFFD";
      }
      if (self2.lastNeed > 1 && buf.length > 1) {
        if ((buf[1] & 192) !== 128) {
          self2.lastNeed = 1;
          return "\uFFFD";
        }
        if (self2.lastNeed > 2 && buf.length > 2) {
          if ((buf[2] & 192) !== 128) {
            self2.lastNeed = 2;
            return "\uFFFD";
          }
        }
      }
    }
    function utf8FillLast(buf) {
      var p = this.lastTotal - this.lastNeed;
      var r3 = utf8CheckExtraBytes(this, buf);
      if (r3 !== void 0) return r3;
      if (this.lastNeed <= buf.length) {
        buf.copy(this.lastChar, p, 0, this.lastNeed);
        return this.lastChar.toString(this.encoding, 0, this.lastTotal);
      }
      buf.copy(this.lastChar, p, 0, buf.length);
      this.lastNeed -= buf.length;
    }
    function utf8Text(buf, i3) {
      var total = utf8CheckIncomplete(this, buf, i3);
      if (!this.lastNeed) return buf.toString("utf8", i3);
      this.lastTotal = total;
      var end = buf.length - (total - this.lastNeed);
      buf.copy(this.lastChar, 0, end);
      return buf.toString("utf8", i3, end);
    }
    function utf8End(buf) {
      var r3 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed) return r3 + "\uFFFD";
      return r3;
    }
    function utf16Text(buf, i3) {
      if ((buf.length - i3) % 2 === 0) {
        var r3 = buf.toString("utf16le", i3);
        if (r3) {
          var c3 = r3.charCodeAt(r3.length - 1);
          if (c3 >= 55296 && c3 <= 56319) {
            this.lastNeed = 2;
            this.lastTotal = 4;
            this.lastChar[0] = buf[buf.length - 2];
            this.lastChar[1] = buf[buf.length - 1];
            return r3.slice(0, -1);
          }
        }
        return r3;
      }
      this.lastNeed = 1;
      this.lastTotal = 2;
      this.lastChar[0] = buf[buf.length - 1];
      return buf.toString("utf16le", i3, buf.length - 1);
    }
    function utf16End(buf) {
      var r3 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed) {
        var end = this.lastTotal - this.lastNeed;
        return r3 + this.lastChar.toString("utf16le", 0, end);
      }
      return r3;
    }
    function base64Text(buf, i3) {
      var n3 = (buf.length - i3) % 3;
      if (n3 === 0) return buf.toString("base64", i3);
      this.lastNeed = 3 - n3;
      this.lastTotal = 3;
      if (n3 === 1) {
        this.lastChar[0] = buf[buf.length - 1];
      } else {
        this.lastChar[0] = buf[buf.length - 2];
        this.lastChar[1] = buf[buf.length - 1];
      }
      return buf.toString("base64", i3, buf.length - n3);
    }
    function base64End(buf) {
      var r3 = buf && buf.length ? this.write(buf) : "";
      if (this.lastNeed) return r3 + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
      return r3;
    }
    function simpleWrite(buf) {
      return buf.toString(this.encoding);
    }
    function simpleEnd(buf) {
      return buf && buf.length ? this.write(buf) : "";
    }
  }
});
var require_end_of_stream = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports$1, module2) {
    var ERR_STREAM_PREMATURE_CLOSE = require_errors2().codes.ERR_STREAM_PREMATURE_CLOSE;
    function once(callback) {
      var called = false;
      return function() {
        if (called) return;
        called = true;
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        callback.apply(this, args);
      };
    }
    function noop() {
    }
    function isRequest2(stream) {
      return stream.setHeader && typeof stream.abort === "function";
    }
    function eos(stream, opts, callback) {
      if (typeof opts === "function") return eos(stream, null, opts);
      if (!opts) opts = {};
      callback = once(callback || noop);
      var readable = opts.readable || opts.readable !== false && stream.readable;
      var writable = opts.writable || opts.writable !== false && stream.writable;
      var onlegacyfinish = function onlegacyfinish2() {
        if (!stream.writable) onfinish();
      };
      var writableEnded = stream._writableState && stream._writableState.finished;
      var onfinish = function onfinish2() {
        writable = false;
        writableEnded = true;
        if (!readable) callback.call(stream);
      };
      var readableEnded = stream._readableState && stream._readableState.endEmitted;
      var onend = function onend2() {
        readable = false;
        readableEnded = true;
        if (!writable) callback.call(stream);
      };
      var onerror = function onerror2(err) {
        callback.call(stream, err);
      };
      var onclose = function onclose2() {
        var err;
        if (readable && !readableEnded) {
          if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
          return callback.call(stream, err);
        }
        if (writable && !writableEnded) {
          if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
          return callback.call(stream, err);
        }
      };
      var onrequest = function onrequest2() {
        stream.req.on("finish", onfinish);
      };
      if (isRequest2(stream)) {
        stream.on("complete", onfinish);
        stream.on("abort", onclose);
        if (stream.req) onrequest();
        else stream.on("request", onrequest);
      } else if (writable && !stream._writableState) {
        stream.on("end", onlegacyfinish);
        stream.on("close", onlegacyfinish);
      }
      stream.on("end", onend);
      stream.on("finish", onfinish);
      if (opts.error !== false) stream.on("error", onerror);
      stream.on("close", onclose);
      return function() {
        stream.removeListener("complete", onfinish);
        stream.removeListener("abort", onclose);
        stream.removeListener("request", onrequest);
        if (stream.req) stream.req.removeListener("finish", onfinish);
        stream.removeListener("end", onlegacyfinish);
        stream.removeListener("close", onlegacyfinish);
        stream.removeListener("finish", onfinish);
        stream.removeListener("end", onend);
        stream.removeListener("error", onerror);
        stream.removeListener("close", onclose);
      };
    }
    module2.exports = eos;
  }
});
var require_async_iterator = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports$1, module2) {
    var _Object$setPrototypeO;
    function _defineProperty(obj, key, value) {
      key = _toPropertyKey(key);
      if (key in obj) {
        Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }
      return obj;
    }
    function _toPropertyKey(arg) {
      var key = _toPrimitive(arg, "string");
      return typeof key === "symbol" ? key : String(key);
    }
    function _toPrimitive(input, hint) {
      if (typeof input !== "object" || input === null) return input;
      var prim = input[Symbol.toPrimitive];
      if (prim !== void 0) {
        var res = prim.call(input, hint);
        if (typeof res !== "object") return res;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (hint === "string" ? String : Number)(input);
    }
    var finished = require_end_of_stream();
    var kLastResolve = /* @__PURE__ */ Symbol("lastResolve");
    var kLastReject = /* @__PURE__ */ Symbol("lastReject");
    var kError = /* @__PURE__ */ Symbol("error");
    var kEnded = /* @__PURE__ */ Symbol("ended");
    var kLastPromise = /* @__PURE__ */ Symbol("lastPromise");
    var kHandlePromise = /* @__PURE__ */ Symbol("handlePromise");
    var kStream = /* @__PURE__ */ Symbol("stream");
    function createIterResult(value, done) {
      return {
        value,
        done
      };
    }
    function readAndResolve(iter) {
      var resolve4 = iter[kLastResolve];
      if (resolve4 !== null) {
        var data = iter[kStream].read();
        if (data !== null) {
          iter[kLastPromise] = null;
          iter[kLastResolve] = null;
          iter[kLastReject] = null;
          resolve4(createIterResult(data, false));
        }
      }
    }
    function onReadable(iter) {
      process.nextTick(readAndResolve, iter);
    }
    function wrapForNext(lastPromise, iter) {
      return function(resolve4, reject) {
        lastPromise.then(function() {
          if (iter[kEnded]) {
            resolve4(createIterResult(void 0, true));
            return;
          }
          iter[kHandlePromise](resolve4, reject);
        }, reject);
      };
    }
    var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
    });
    var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
      get stream() {
        return this[kStream];
      },
      next: function next() {
        var _this = this;
        var error = this[kError];
        if (error !== null) {
          return Promise.reject(error);
        }
        if (this[kEnded]) {
          return Promise.resolve(createIterResult(void 0, true));
        }
        if (this[kStream].destroyed) {
          return new Promise(function(resolve4, reject) {
            process.nextTick(function() {
              if (_this[kError]) {
                reject(_this[kError]);
              } else {
                resolve4(createIterResult(void 0, true));
              }
            });
          });
        }
        var lastPromise = this[kLastPromise];
        var promise;
        if (lastPromise) {
          promise = new Promise(wrapForNext(lastPromise, this));
        } else {
          var data = this[kStream].read();
          if (data !== null) {
            return Promise.resolve(createIterResult(data, false));
          }
          promise = new Promise(this[kHandlePromise]);
        }
        this[kLastPromise] = promise;
        return promise;
      }
    }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
      return this;
    }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
      var _this2 = this;
      return new Promise(function(resolve4, reject) {
        _this2[kStream].destroy(null, function(err) {
          if (err) {
            reject(err);
            return;
          }
          resolve4(createIterResult(void 0, true));
        });
      });
    }), _Object$setPrototypeO), AsyncIteratorPrototype);
    var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
      var _Object$create;
      var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
        value: stream,
        writable: true
      }), _defineProperty(_Object$create, kLastResolve, {
        value: null,
        writable: true
      }), _defineProperty(_Object$create, kLastReject, {
        value: null,
        writable: true
      }), _defineProperty(_Object$create, kError, {
        value: null,
        writable: true
      }), _defineProperty(_Object$create, kEnded, {
        value: stream._readableState.endEmitted,
        writable: true
      }), _defineProperty(_Object$create, kHandlePromise, {
        value: function value(resolve4, reject) {
          var data = iterator[kStream].read();
          if (data) {
            iterator[kLastPromise] = null;
            iterator[kLastResolve] = null;
            iterator[kLastReject] = null;
            resolve4(createIterResult(data, false));
          } else {
            iterator[kLastResolve] = resolve4;
            iterator[kLastReject] = reject;
          }
        },
        writable: true
      }), _Object$create));
      iterator[kLastPromise] = null;
      finished(stream, function(err) {
        if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
          var reject = iterator[kLastReject];
          if (reject !== null) {
            iterator[kLastPromise] = null;
            iterator[kLastResolve] = null;
            iterator[kLastReject] = null;
            reject(err);
          }
          iterator[kError] = err;
          return;
        }
        var resolve4 = iterator[kLastResolve];
        if (resolve4 !== null) {
          iterator[kLastPromise] = null;
          iterator[kLastResolve] = null;
          iterator[kLastReject] = null;
          resolve4(createIterResult(void 0, true));
        }
        iterator[kEnded] = true;
      });
      stream.on("readable", onReadable.bind(null, iterator));
      return iterator;
    };
    module2.exports = createReadableStreamAsyncIterator;
  }
});
var require_from2 = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports$1, module2) {
    function asyncGeneratorStep(gen, resolve4, reject, _next, _throw, key, arg) {
      try {
        var info = gen[key](arg);
        var value = info.value;
      } catch (error) {
        reject(error);
        return;
      }
      if (info.done) {
        resolve4(value);
      } else {
        Promise.resolve(value).then(_next, _throw);
      }
    }
    function _asyncToGenerator(fn) {
      return function() {
        var self2 = this, args = arguments;
        return new Promise(function(resolve4, reject) {
          var gen = fn.apply(self2, args);
          function _next(value) {
            asyncGeneratorStep(gen, resolve4, reject, _next, _throw, "next", value);
          }
          function _throw(err) {
            asyncGeneratorStep(gen, resolve4, reject, _next, _throw, "throw", err);
          }
          _next(void 0);
        });
      };
    }
    function ownKeys(object, enumerableOnly) {
      var keys = Object.keys(object);
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        enumerableOnly && (symbols = symbols.filter(function(sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        })), keys.push.apply(keys, symbols);
      }
      return keys;
    }
    function _objectSpread(target) {
      for (var i3 = 1; i3 < arguments.length; i3++) {
        var source = null != arguments[i3] ? arguments[i3] : {};
        i3 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
          _defineProperty(target, key, source[key]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
      return target;
    }
    function _defineProperty(obj, key, value) {
      key = _toPropertyKey(key);
      if (key in obj) {
        Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }
      return obj;
    }
    function _toPropertyKey(arg) {
      var key = _toPrimitive(arg, "string");
      return typeof key === "symbol" ? key : String(key);
    }
    function _toPrimitive(input, hint) {
      if (typeof input !== "object" || input === null) return input;
      var prim = input[Symbol.toPrimitive];
      if (prim !== void 0) {
        var res = prim.call(input, hint);
        if (typeof res !== "object") return res;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (hint === "string" ? String : Number)(input);
    }
    var ERR_INVALID_ARG_TYPE = require_errors2().codes.ERR_INVALID_ARG_TYPE;
    function from(Readable, iterable, opts) {
      var iterator;
      if (iterable && typeof iterable.next === "function") {
        iterator = iterable;
      } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();
      else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();
      else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
      var readable = new Readable(_objectSpread({
        objectMode: true
      }, opts));
      var reading = false;
      readable._read = function() {
        if (!reading) {
          reading = true;
          next();
        }
      };
      function next() {
        return _next2.apply(this, arguments);
      }
      function _next2() {
        _next2 = _asyncToGenerator(function* () {
          try {
            var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done;
            if (done) {
              readable.push(null);
            } else if (readable.push(yield value)) {
              next();
            } else {
              reading = false;
            }
          } catch (err) {
            readable.destroy(err);
          }
        });
        return _next2.apply(this, arguments);
      }
      return readable;
    }
    module2.exports = from;
  }
});
var require_stream_readable = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js"(exports$1, module2) {
    module2.exports = Readable;
    var Duplex;
    Readable.ReadableState = ReadableState;
    __require("events").EventEmitter;
    var EElistenerCount = function EElistenerCount2(emitter, type) {
      return emitter.listeners(type).length;
    };
    var Stream = require_stream2();
    var Buffer2 = __require("buffer").Buffer;
    var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
    };
    function _uint8ArrayToBuffer(chunk) {
      return Buffer2.from(chunk);
    }
    function _isUint8Array(obj) {
      return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
    }
    var debugUtil = __require("util");
    var debug;
    if (debugUtil && debugUtil.debuglog) {
      debug = debugUtil.debuglog("stream");
    } else {
      debug = function debug2() {
      };
    }
    var BufferList = require_buffer_list();
    var destroyImpl = require_destroy();
    var _require = require_state();
    var getHighWaterMark = _require.getHighWaterMark;
    var _require$codes = require_errors2().codes;
    var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
    var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF;
    var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
    var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
    var StringDecoder;
    var createReadableStreamAsyncIterator;
    var from;
    require_inherits()(Readable, Stream);
    var errorOrDestroy = destroyImpl.errorOrDestroy;
    var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
    function prependListener(emitter, event, fn) {
      if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
      if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
      else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
      else emitter._events[event] = [fn, emitter._events[event]];
    }
    function ReadableState(options, stream, isDuplex) {
      Duplex = Duplex || require_stream_duplex();
      options = options || {};
      if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
      this.objectMode = !!options.objectMode;
      if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
      this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
      this.buffer = new BufferList();
      this.length = 0;
      this.pipes = null;
      this.pipesCount = 0;
      this.flowing = null;
      this.ended = false;
      this.endEmitted = false;
      this.reading = false;
      this.sync = true;
      this.needReadable = false;
      this.emittedReadable = false;
      this.readableListening = false;
      this.resumeScheduled = false;
      this.paused = true;
      this.emitClose = options.emitClose !== false;
      this.autoDestroy = !!options.autoDestroy;
      this.destroyed = false;
      this.defaultEncoding = options.defaultEncoding || "utf8";
      this.awaitDrain = 0;
      this.readingMore = false;
      this.decoder = null;
      this.encoding = null;
      if (options.encoding) {
        if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
        this.decoder = new StringDecoder(options.encoding);
        this.encoding = options.encoding;
      }
    }
    function Readable(options) {
      Duplex = Duplex || require_stream_duplex();
      if (!(this instanceof Readable)) return new Readable(options);
      var isDuplex = this instanceof Duplex;
      this._readableState = new ReadableState(options, this, isDuplex);
      this.readable = true;
      if (options) {
        if (typeof options.read === "function") this._read = options.read;
        if (typeof options.destroy === "function") this._destroy = options.destroy;
      }
      Stream.call(this);
    }
    Object.defineProperty(Readable.prototype, "destroyed", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        if (this._readableState === void 0) {
          return false;
        }
        return this._readableState.destroyed;
      },
      set: function set(value) {
        if (!this._readableState) {
          return;
        }
        this._readableState.destroyed = value;
      }
    });
    Readable.prototype.destroy = destroyImpl.destroy;
    Readable.prototype._undestroy = destroyImpl.undestroy;
    Readable.prototype._destroy = function(err, cb) {
      cb(err);
    };
    Readable.prototype.push = function(chunk, encoding) {
      var state = this._readableState;
      var skipChunkCheck;
      if (!state.objectMode) {
        if (typeof chunk === "string") {
          encoding = encoding || state.defaultEncoding;
          if (encoding !== state.encoding) {
            chunk = Buffer2.from(chunk, encoding);
            encoding = "";
          }
          skipChunkCheck = true;
        }
      } else {
        skipChunkCheck = true;
      }
      return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
    };
    Readable.prototype.unshift = function(chunk) {
      return readableAddChunk(this, chunk, null, true, false);
    };
    function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
      debug("readableAddChunk", chunk);
      var state = stream._readableState;
      if (chunk === null) {
        state.reading = false;
        onEofChunk(stream, state);
      } else {
        var er;
        if (!skipChunkCheck) er = chunkInvalid(state, chunk);
        if (er) {
          errorOrDestroy(stream, er);
        } else if (state.objectMode || chunk && chunk.length > 0) {
          if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
            chunk = _uint8ArrayToBuffer(chunk);
          }
          if (addToFront) {
            if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
            else addChunk(stream, state, chunk, true);
          } else if (state.ended) {
            errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
          } else if (state.destroyed) {
            return false;
          } else {
            state.reading = false;
            if (state.decoder && !encoding) {
              chunk = state.decoder.write(chunk);
              if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
              else maybeReadMore(stream, state);
            } else {
              addChunk(stream, state, chunk, false);
            }
          }
        } else if (!addToFront) {
          state.reading = false;
          maybeReadMore(stream, state);
        }
      }
      return !state.ended && (state.length < state.highWaterMark || state.length === 0);
    }
    function addChunk(stream, state, chunk, addToFront) {
      if (state.flowing && state.length === 0 && !state.sync) {
        state.awaitDrain = 0;
        stream.emit("data", chunk);
      } else {
        state.length += state.objectMode ? 1 : chunk.length;
        if (addToFront) state.buffer.unshift(chunk);
        else state.buffer.push(chunk);
        if (state.needReadable) emitReadable(stream);
      }
      maybeReadMore(stream, state);
    }
    function chunkInvalid(state, chunk) {
      var er;
      if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
        er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
      }
      return er;
    }
    Readable.prototype.isPaused = function() {
      return this._readableState.flowing === false;
    };
    Readable.prototype.setEncoding = function(enc) {
      if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
      var decoder = new StringDecoder(enc);
      this._readableState.decoder = decoder;
      this._readableState.encoding = this._readableState.decoder.encoding;
      var p = this._readableState.buffer.head;
      var content = "";
      while (p !== null) {
        content += decoder.write(p.data);
        p = p.next;
      }
      this._readableState.buffer.clear();
      if (content !== "") this._readableState.buffer.push(content);
      this._readableState.length = content.length;
      return this;
    };
    var MAX_HWM = 1073741824;
    function computeNewHighWaterMark(n3) {
      if (n3 >= MAX_HWM) {
        n3 = MAX_HWM;
      } else {
        n3--;
        n3 |= n3 >>> 1;
        n3 |= n3 >>> 2;
        n3 |= n3 >>> 4;
        n3 |= n3 >>> 8;
        n3 |= n3 >>> 16;
        n3++;
      }
      return n3;
    }
    function howMuchToRead(n3, state) {
      if (n3 <= 0 || state.length === 0 && state.ended) return 0;
      if (state.objectMode) return 1;
      if (n3 !== n3) {
        if (state.flowing && state.length) return state.buffer.head.data.length;
        else return state.length;
      }
      if (n3 > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n3);
      if (n3 <= state.length) return n3;
      if (!state.ended) {
        state.needReadable = true;
        return 0;
      }
      return state.length;
    }
    Readable.prototype.read = function(n3) {
      debug("read", n3);
      n3 = parseInt(n3, 10);
      var state = this._readableState;
      var nOrig = n3;
      if (n3 !== 0) state.emittedReadable = false;
      if (n3 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
        debug("read: emitReadable", state.length, state.ended);
        if (state.length === 0 && state.ended) endReadable(this);
        else emitReadable(this);
        return null;
      }
      n3 = howMuchToRead(n3, state);
      if (n3 === 0 && state.ended) {
        if (state.length === 0) endReadable(this);
        return null;
      }
      var doRead = state.needReadable;
      debug("need readable", doRead);
      if (state.length === 0 || state.length - n3 < state.highWaterMark) {
        doRead = true;
        debug("length less than watermark", doRead);
      }
      if (state.ended || state.reading) {
        doRead = false;
        debug("reading or ended", doRead);
      } else if (doRead) {
        debug("do read");
        state.reading = true;
        state.sync = true;
        if (state.length === 0) state.needReadable = true;
        this._read(state.highWaterMark);
        state.sync = false;
        if (!state.reading) n3 = howMuchToRead(nOrig, state);
      }
      var ret;
      if (n3 > 0) ret = fromList(n3, state);
      else ret = null;
      if (ret === null) {
        state.needReadable = state.length <= state.highWaterMark;
        n3 = 0;
      } else {
        state.length -= n3;
        state.awaitDrain = 0;
      }
      if (state.length === 0) {
        if (!state.ended) state.needReadable = true;
        if (nOrig !== n3 && state.ended) endReadable(this);
      }
      if (ret !== null) this.emit("data", ret);
      return ret;
    };
    function onEofChunk(stream, state) {
      debug("onEofChunk");
      if (state.ended) return;
      if (state.decoder) {
        var chunk = state.decoder.end();
        if (chunk && chunk.length) {
          state.buffer.push(chunk);
          state.length += state.objectMode ? 1 : chunk.length;
        }
      }
      state.ended = true;
      if (state.sync) {
        emitReadable(stream);
      } else {
        state.needReadable = false;
        if (!state.emittedReadable) {
          state.emittedReadable = true;
          emitReadable_(stream);
        }
      }
    }
    function emitReadable(stream) {
      var state = stream._readableState;
      debug("emitReadable", state.needReadable, state.emittedReadable);
      state.needReadable = false;
      if (!state.emittedReadable) {
        debug("emitReadable", state.flowing);
        state.emittedReadable = true;
        process.nextTick(emitReadable_, stream);
      }
    }
    function emitReadable_(stream) {
      var state = stream._readableState;
      debug("emitReadable_", state.destroyed, state.length, state.ended);
      if (!state.destroyed && (state.length || state.ended)) {
        stream.emit("readable");
        state.emittedReadable = false;
      }
      state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
      flow(stream);
    }
    function maybeReadMore(stream, state) {
      if (!state.readingMore) {
        state.readingMore = true;
        process.nextTick(maybeReadMore_, stream, state);
      }
    }
    function maybeReadMore_(stream, state) {
      while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
        var len = state.length;
        debug("maybeReadMore read 0");
        stream.read(0);
        if (len === state.length)
          break;
      }
      state.readingMore = false;
    }
    Readable.prototype._read = function(n3) {
      errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
    };
    Readable.prototype.pipe = function(dest, pipeOpts) {
      var src = this;
      var state = this._readableState;
      switch (state.pipesCount) {
        case 0:
          state.pipes = dest;
          break;
        case 1:
          state.pipes = [state.pipes, dest];
          break;
        default:
          state.pipes.push(dest);
          break;
      }
      state.pipesCount += 1;
      debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
      var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
      var endFn = doEnd ? onend : unpipe;
      if (state.endEmitted) process.nextTick(endFn);
      else src.once("end", endFn);
      dest.on("unpipe", onunpipe);
      function onunpipe(readable, unpipeInfo) {
        debug("onunpipe");
        if (readable === src) {
          if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
            unpipeInfo.hasUnpiped = true;
            cleanup();
          }
        }
      }
      function onend() {
        debug("onend");
        dest.end();
      }
      var ondrain = pipeOnDrain(src);
      dest.on("drain", ondrain);
      var cleanedUp = false;
      function cleanup() {
        debug("cleanup");
        dest.removeListener("close", onclose);
        dest.removeListener("finish", onfinish);
        dest.removeListener("drain", ondrain);
        dest.removeListener("error", onerror);
        dest.removeListener("unpipe", onunpipe);
        src.removeListener("end", onend);
        src.removeListener("end", unpipe);
        src.removeListener("data", ondata);
        cleanedUp = true;
        if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
      }
      src.on("data", ondata);
      function ondata(chunk) {
        debug("ondata");
        var ret = dest.write(chunk);
        debug("dest.write", ret);
        if (ret === false) {
          if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
            debug("false write response, pause", state.awaitDrain);
            state.awaitDrain++;
          }
          src.pause();
        }
      }
      function onerror(er) {
        debug("onerror", er);
        unpipe();
        dest.removeListener("error", onerror);
        if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
      }
      prependListener(dest, "error", onerror);
      function onclose() {
        dest.removeListener("finish", onfinish);
        unpipe();
      }
      dest.once("close", onclose);
      function onfinish() {
        debug("onfinish");
        dest.removeListener("close", onclose);
        unpipe();
      }
      dest.once("finish", onfinish);
      function unpipe() {
        debug("unpipe");
        src.unpipe(dest);
      }
      dest.emit("pipe", src);
      if (!state.flowing) {
        debug("pipe resume");
        src.resume();
      }
      return dest;
    };
    function pipeOnDrain(src) {
      return function pipeOnDrainFunctionResult() {
        var state = src._readableState;
        debug("pipeOnDrain", state.awaitDrain);
        if (state.awaitDrain) state.awaitDrain--;
        if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
          state.flowing = true;
          flow(src);
        }
      };
    }
    Readable.prototype.unpipe = function(dest) {
      var state = this._readableState;
      var unpipeInfo = {
        hasUnpiped: false
      };
      if (state.pipesCount === 0) return this;
      if (state.pipesCount === 1) {
        if (dest && dest !== state.pipes) return this;
        if (!dest) dest = state.pipes;
        state.pipes = null;
        state.pipesCount = 0;
        state.flowing = false;
        if (dest) dest.emit("unpipe", this, unpipeInfo);
        return this;
      }
      if (!dest) {
        var dests = state.pipes;
        var len = state.pipesCount;
        state.pipes = null;
        state.pipesCount = 0;
        state.flowing = false;
        for (var i3 = 0; i3 < len; i3++) dests[i3].emit("unpipe", this, {
          hasUnpiped: false
        });
        return this;
      }
      var index = indexOf(state.pipes, dest);
      if (index === -1) return this;
      state.pipes.splice(index, 1);
      state.pipesCount -= 1;
      if (state.pipesCount === 1) state.pipes = state.pipes[0];
      dest.emit("unpipe", this, unpipeInfo);
      return this;
    };
    Readable.prototype.on = function(ev, fn) {
      var res = Stream.prototype.on.call(this, ev, fn);
      var state = this._readableState;
      if (ev === "data") {
        state.readableListening = this.listenerCount("readable") > 0;
        if (state.flowing !== false) this.resume();
      } else if (ev === "readable") {
        if (!state.endEmitted && !state.readableListening) {
          state.readableListening = state.needReadable = true;
          state.flowing = false;
          state.emittedReadable = false;
          debug("on readable", state.length, state.reading);
          if (state.length) {
            emitReadable(this);
          } else if (!state.reading) {
            process.nextTick(nReadingNextTick, this);
          }
        }
      }
      return res;
    };
    Readable.prototype.addListener = Readable.prototype.on;
    Readable.prototype.removeListener = function(ev, fn) {
      var res = Stream.prototype.removeListener.call(this, ev, fn);
      if (ev === "readable") {
        process.nextTick(updateReadableListening, this);
      }
      return res;
    };
    Readable.prototype.removeAllListeners = function(ev) {
      var res = Stream.prototype.removeAllListeners.apply(this, arguments);
      if (ev === "readable" || ev === void 0) {
        process.nextTick(updateReadableListening, this);
      }
      return res;
    };
    function updateReadableListening(self2) {
      var state = self2._readableState;
      state.readableListening = self2.listenerCount("readable") > 0;
      if (state.resumeScheduled && !state.paused) {
        state.flowing = true;
      } else if (self2.listenerCount("data") > 0) {
        self2.resume();
      }
    }
    function nReadingNextTick(self2) {
      debug("readable nexttick read 0");
      self2.read(0);
    }
    Readable.prototype.resume = function() {
      var state = this._readableState;
      if (!state.flowing) {
        debug("resume");
        state.flowing = !state.readableListening;
        resume(this, state);
      }
      state.paused = false;
      return this;
    };
    function resume(stream, state) {
      if (!state.resumeScheduled) {
        state.resumeScheduled = true;
        process.nextTick(resume_, stream, state);
      }
    }
    function resume_(stream, state) {
      debug("resume", state.reading);
      if (!state.reading) {
        stream.read(0);
      }
      state.resumeScheduled = false;
      stream.emit("resume");
      flow(stream);
      if (state.flowing && !state.reading) stream.read(0);
    }
    Readable.prototype.pause = function() {
      debug("call pause flowing=%j", this._readableState.flowing);
      if (this._readableState.flowing !== false) {
        debug("pause");
        this._readableState.flowing = false;
        this.emit("pause");
      }
      this._readableState.paused = true;
      return this;
    };
    function flow(stream) {
      var state = stream._readableState;
      debug("flow", state.flowing);
      while (state.flowing && stream.read() !== null) ;
    }
    Readable.prototype.wrap = function(stream) {
      var _this = this;
      var state = this._readableState;
      var paused = false;
      stream.on("end", function() {
        debug("wrapped end");
        if (state.decoder && !state.ended) {
          var chunk = state.decoder.end();
          if (chunk && chunk.length) _this.push(chunk);
        }
        _this.push(null);
      });
      stream.on("data", function(chunk) {
        debug("wrapped data");
        if (state.decoder) chunk = state.decoder.write(chunk);
        if (state.objectMode && (chunk === null || chunk === void 0)) return;
        else if (!state.objectMode && (!chunk || !chunk.length)) return;
        var ret = _this.push(chunk);
        if (!ret) {
          paused = true;
          stream.pause();
        }
      });
      for (var i3 in stream) {
        if (this[i3] === void 0 && typeof stream[i3] === "function") {
          this[i3] = /* @__PURE__ */ function methodWrap(method) {
            return function methodWrapReturnFunction() {
              return stream[method].apply(stream, arguments);
            };
          }(i3);
        }
      }
      for (var n3 = 0; n3 < kProxyEvents.length; n3++) {
        stream.on(kProxyEvents[n3], this.emit.bind(this, kProxyEvents[n3]));
      }
      this._read = function(n22) {
        debug("wrapped _read", n22);
        if (paused) {
          paused = false;
          stream.resume();
        }
      };
      return this;
    };
    if (typeof Symbol === "function") {
      Readable.prototype[Symbol.asyncIterator] = function() {
        if (createReadableStreamAsyncIterator === void 0) {
          createReadableStreamAsyncIterator = require_async_iterator();
        }
        return createReadableStreamAsyncIterator(this);
      };
    }
    Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._readableState.highWaterMark;
      }
    });
    Object.defineProperty(Readable.prototype, "readableBuffer", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._readableState && this._readableState.buffer;
      }
    });
    Object.defineProperty(Readable.prototype, "readableFlowing", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._readableState.flowing;
      },
      set: function set(state) {
        if (this._readableState) {
          this._readableState.flowing = state;
        }
      }
    });
    Readable._fromList = fromList;
    Object.defineProperty(Readable.prototype, "readableLength", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._readableState.length;
      }
    });
    function fromList(n3, state) {
      if (state.length === 0) return null;
      var ret;
      if (state.objectMode) ret = state.buffer.shift();
      else if (!n3 || n3 >= state.length) {
        if (state.decoder) ret = state.buffer.join("");
        else if (state.buffer.length === 1) ret = state.buffer.first();
        else ret = state.buffer.concat(state.length);
        state.buffer.clear();
      } else {
        ret = state.buffer.consume(n3, state.decoder);
      }
      return ret;
    }
    function endReadable(stream) {
      var state = stream._readableState;
      debug("endReadable", state.endEmitted);
      if (!state.endEmitted) {
        state.ended = true;
        process.nextTick(endReadableNT, state, stream);
      }
    }
    function endReadableNT(state, stream) {
      debug("endReadableNT", state.endEmitted, state.length);
      if (!state.endEmitted && state.length === 0) {
        state.endEmitted = true;
        stream.readable = false;
        stream.emit("end");
        if (state.autoDestroy) {
          var wState = stream._writableState;
          if (!wState || wState.autoDestroy && wState.finished) {
            stream.destroy();
          }
        }
      }
    }
    if (typeof Symbol === "function") {
      Readable.from = function(iterable, opts) {
        if (from === void 0) {
          from = require_from2();
        }
        return from(Readable, iterable, opts);
      };
    }
    function indexOf(xs, x3) {
      for (var i3 = 0, l3 = xs.length; i3 < l3; i3++) {
        if (xs[i3] === x3) return i3;
      }
      return -1;
    }
  }
});
var require_stream_duplex = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js"(exports$1, module2) {
    var objectKeys = Object.keys || function(obj) {
      var keys2 = [];
      for (var key in obj) keys2.push(key);
      return keys2;
    };
    module2.exports = Duplex;
    var Readable = require_stream_readable();
    var Writable = require_stream_writable();
    require_inherits()(Duplex, Readable);
    {
      keys = objectKeys(Writable.prototype);
      for (v3 = 0; v3 < keys.length; v3++) {
        method = keys[v3];
        if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
      }
    }
    var keys;
    var method;
    var v3;
    function Duplex(options) {
      if (!(this instanceof Duplex)) return new Duplex(options);
      Readable.call(this, options);
      Writable.call(this, options);
      this.allowHalfOpen = true;
      if (options) {
        if (options.readable === false) this.readable = false;
        if (options.writable === false) this.writable = false;
        if (options.allowHalfOpen === false) {
          this.allowHalfOpen = false;
          this.once("end", onend);
        }
      }
    }
    Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState.highWaterMark;
      }
    });
    Object.defineProperty(Duplex.prototype, "writableBuffer", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState && this._writableState.getBuffer();
      }
    });
    Object.defineProperty(Duplex.prototype, "writableLength", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState.length;
      }
    });
    function onend() {
      if (this._writableState.ended) return;
      process.nextTick(onEndNT, this);
    }
    function onEndNT(self2) {
      self2.end();
    }
    Object.defineProperty(Duplex.prototype, "destroyed", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        if (this._readableState === void 0 || this._writableState === void 0) {
          return false;
        }
        return this._readableState.destroyed && this._writableState.destroyed;
      },
      set: function set(value) {
        if (this._readableState === void 0 || this._writableState === void 0) {
          return;
        }
        this._readableState.destroyed = value;
        this._writableState.destroyed = value;
      }
    });
  }
});
var require_stream_writable = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js"(exports$1, module2) {
    module2.exports = Writable;
    function CorkedRequest(state) {
      var _this = this;
      this.next = null;
      this.entry = null;
      this.finish = function() {
        onCorkedFinish(_this, state);
      };
    }
    var Duplex;
    Writable.WritableState = WritableState;
    var internalUtil = {
      deprecate: require_node()
    };
    var Stream = require_stream2();
    var Buffer2 = __require("buffer").Buffer;
    var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
    };
    function _uint8ArrayToBuffer(chunk) {
      return Buffer2.from(chunk);
    }
    function _isUint8Array(obj) {
      return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
    }
    var destroyImpl = require_destroy();
    var _require = require_state();
    var getHighWaterMark = _require.getHighWaterMark;
    var _require$codes = require_errors2().codes;
    var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
    var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
    var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
    var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE;
    var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
    var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES;
    var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
    var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
    var errorOrDestroy = destroyImpl.errorOrDestroy;
    require_inherits()(Writable, Stream);
    function nop() {
    }
    function WritableState(options, stream, isDuplex) {
      Duplex = Duplex || require_stream_duplex();
      options = options || {};
      if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
      this.objectMode = !!options.objectMode;
      if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
      this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
      this.finalCalled = false;
      this.needDrain = false;
      this.ending = false;
      this.ended = false;
      this.finished = false;
      this.destroyed = false;
      var noDecode = options.decodeStrings === false;
      this.decodeStrings = !noDecode;
      this.defaultEncoding = options.defaultEncoding || "utf8";
      this.length = 0;
      this.writing = false;
      this.corked = 0;
      this.sync = true;
      this.bufferProcessing = false;
      this.onwrite = function(er) {
        onwrite(stream, er);
      };
      this.writecb = null;
      this.writelen = 0;
      this.bufferedRequest = null;
      this.lastBufferedRequest = null;
      this.pendingcb = 0;
      this.prefinished = false;
      this.errorEmitted = false;
      this.emitClose = options.emitClose !== false;
      this.autoDestroy = !!options.autoDestroy;
      this.bufferedRequestCount = 0;
      this.corkedRequestsFree = new CorkedRequest(this);
    }
    WritableState.prototype.getBuffer = function getBuffer() {
      var current = this.bufferedRequest;
      var out = [];
      while (current) {
        out.push(current);
        current = current.next;
      }
      return out;
    };
    (function() {
      try {
        Object.defineProperty(WritableState.prototype, "buffer", {
          get: internalUtil.deprecate(function writableStateBufferGetter() {
            return this.getBuffer();
          }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
        });
      } catch (_) {
      }
    })();
    var realHasInstance;
    if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
      realHasInstance = Function.prototype[Symbol.hasInstance];
      Object.defineProperty(Writable, Symbol.hasInstance, {
        value: function value(object) {
          if (realHasInstance.call(this, object)) return true;
          if (this !== Writable) return false;
          return object && object._writableState instanceof WritableState;
        }
      });
    } else {
      realHasInstance = function realHasInstance2(object) {
        return object instanceof this;
      };
    }
    function Writable(options) {
      Duplex = Duplex || require_stream_duplex();
      var isDuplex = this instanceof Duplex;
      if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
      this._writableState = new WritableState(options, this, isDuplex);
      this.writable = true;
      if (options) {
        if (typeof options.write === "function") this._write = options.write;
        if (typeof options.writev === "function") this._writev = options.writev;
        if (typeof options.destroy === "function") this._destroy = options.destroy;
        if (typeof options.final === "function") this._final = options.final;
      }
      Stream.call(this);
    }
    Writable.prototype.pipe = function() {
      errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
    };
    function writeAfterEnd(stream, cb) {
      var er = new ERR_STREAM_WRITE_AFTER_END();
      errorOrDestroy(stream, er);
      process.nextTick(cb, er);
    }
    function validChunk(stream, state, chunk, cb) {
      var er;
      if (chunk === null) {
        er = new ERR_STREAM_NULL_VALUES();
      } else if (typeof chunk !== "string" && !state.objectMode) {
        er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
      }
      if (er) {
        errorOrDestroy(stream, er);
        process.nextTick(cb, er);
        return false;
      }
      return true;
    }
    Writable.prototype.write = function(chunk, encoding, cb) {
      var state = this._writableState;
      var ret = false;
      var isBuf = !state.objectMode && _isUint8Array(chunk);
      if (isBuf && !Buffer2.isBuffer(chunk)) {
        chunk = _uint8ArrayToBuffer(chunk);
      }
      if (typeof encoding === "function") {
        cb = encoding;
        encoding = null;
      }
      if (isBuf) encoding = "buffer";
      else if (!encoding) encoding = state.defaultEncoding;
      if (typeof cb !== "function") cb = nop;
      if (state.ending) writeAfterEnd(this, cb);
      else if (isBuf || validChunk(this, state, chunk, cb)) {
        state.pendingcb++;
        ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
      }
      return ret;
    };
    Writable.prototype.cork = function() {
      this._writableState.corked++;
    };
    Writable.prototype.uncork = function() {
      var state = this._writableState;
      if (state.corked) {
        state.corked--;
        if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
      }
    };
    Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
      if (typeof encoding === "string") encoding = encoding.toLowerCase();
      if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
      this._writableState.defaultEncoding = encoding;
      return this;
    };
    Object.defineProperty(Writable.prototype, "writableBuffer", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState && this._writableState.getBuffer();
      }
    });
    function decodeChunk(state, chunk, encoding) {
      if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
        chunk = Buffer2.from(chunk, encoding);
      }
      return chunk;
    }
    Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState.highWaterMark;
      }
    });
    function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
      if (!isBuf) {
        var newChunk = decodeChunk(state, chunk, encoding);
        if (chunk !== newChunk) {
          isBuf = true;
          encoding = "buffer";
          chunk = newChunk;
        }
      }
      var len = state.objectMode ? 1 : chunk.length;
      state.length += len;
      var ret = state.length < state.highWaterMark;
      if (!ret) state.needDrain = true;
      if (state.writing || state.corked) {
        var last = state.lastBufferedRequest;
        state.lastBufferedRequest = {
          chunk,
          encoding,
          isBuf,
          callback: cb,
          next: null
        };
        if (last) {
          last.next = state.lastBufferedRequest;
        } else {
          state.bufferedRequest = state.lastBufferedRequest;
        }
        state.bufferedRequestCount += 1;
      } else {
        doWrite(stream, state, false, len, chunk, encoding, cb);
      }
      return ret;
    }
    function doWrite(stream, state, writev, len, chunk, encoding, cb) {
      state.writelen = len;
      state.writecb = cb;
      state.writing = true;
      state.sync = true;
      if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write"));
      else if (writev) stream._writev(chunk, state.onwrite);
      else stream._write(chunk, encoding, state.onwrite);
      state.sync = false;
    }
    function onwriteError(stream, state, sync, er, cb) {
      --state.pendingcb;
      if (sync) {
        process.nextTick(cb, er);
        process.nextTick(finishMaybe, stream, state);
        stream._writableState.errorEmitted = true;
        errorOrDestroy(stream, er);
      } else {
        cb(er);
        stream._writableState.errorEmitted = true;
        errorOrDestroy(stream, er);
        finishMaybe(stream, state);
      }
    }
    function onwriteStateUpdate(state) {
      state.writing = false;
      state.writecb = null;
      state.length -= state.writelen;
      state.writelen = 0;
    }
    function onwrite(stream, er) {
      var state = stream._writableState;
      var sync = state.sync;
      var cb = state.writecb;
      if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
      onwriteStateUpdate(state);
      if (er) onwriteError(stream, state, sync, er, cb);
      else {
        var finished = needFinish(state) || stream.destroyed;
        if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
          clearBuffer(stream, state);
        }
        if (sync) {
          process.nextTick(afterWrite, stream, state, finished, cb);
        } else {
          afterWrite(stream, state, finished, cb);
        }
      }
    }
    function afterWrite(stream, state, finished, cb) {
      if (!finished) onwriteDrain(stream, state);
      state.pendingcb--;
      cb();
      finishMaybe(stream, state);
    }
    function onwriteDrain(stream, state) {
      if (state.length === 0 && state.needDrain) {
        state.needDrain = false;
        stream.emit("drain");
      }
    }
    function clearBuffer(stream, state) {
      state.bufferProcessing = true;
      var entry = state.bufferedRequest;
      if (stream._writev && entry && entry.next) {
        var l3 = state.bufferedRequestCount;
        var buffer = new Array(l3);
        var holder = state.corkedRequestsFree;
        holder.entry = entry;
        var count = 0;
        var allBuffers = true;
        while (entry) {
          buffer[count] = entry;
          if (!entry.isBuf) allBuffers = false;
          entry = entry.next;
          count += 1;
        }
        buffer.allBuffers = allBuffers;
        doWrite(stream, state, true, state.length, buffer, "", holder.finish);
        state.pendingcb++;
        state.lastBufferedRequest = null;
        if (holder.next) {
          state.corkedRequestsFree = holder.next;
          holder.next = null;
        } else {
          state.corkedRequestsFree = new CorkedRequest(state);
        }
        state.bufferedRequestCount = 0;
      } else {
        while (entry) {
          var chunk = entry.chunk;
          var encoding = entry.encoding;
          var cb = entry.callback;
          var len = state.objectMode ? 1 : chunk.length;
          doWrite(stream, state, false, len, chunk, encoding, cb);
          entry = entry.next;
          state.bufferedRequestCount--;
          if (state.writing) {
            break;
          }
        }
        if (entry === null) state.lastBufferedRequest = null;
      }
      state.bufferedRequest = entry;
      state.bufferProcessing = false;
    }
    Writable.prototype._write = function(chunk, encoding, cb) {
      cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
    };
    Writable.prototype._writev = null;
    Writable.prototype.end = function(chunk, encoding, cb) {
      var state = this._writableState;
      if (typeof chunk === "function") {
        cb = chunk;
        chunk = null;
        encoding = null;
      } else if (typeof encoding === "function") {
        cb = encoding;
        encoding = null;
      }
      if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
      if (state.corked) {
        state.corked = 1;
        this.uncork();
      }
      if (!state.ending) endWritable(this, state, cb);
      return this;
    };
    Object.defineProperty(Writable.prototype, "writableLength", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        return this._writableState.length;
      }
    });
    function needFinish(state) {
      return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
    }
    function callFinal(stream, state) {
      stream._final(function(err) {
        state.pendingcb--;
        if (err) {
          errorOrDestroy(stream, err);
        }
        state.prefinished = true;
        stream.emit("prefinish");
        finishMaybe(stream, state);
      });
    }
    function prefinish(stream, state) {
      if (!state.prefinished && !state.finalCalled) {
        if (typeof stream._final === "function" && !state.destroyed) {
          state.pendingcb++;
          state.finalCalled = true;
          process.nextTick(callFinal, stream, state);
        } else {
          state.prefinished = true;
          stream.emit("prefinish");
        }
      }
    }
    function finishMaybe(stream, state) {
      var need = needFinish(state);
      if (need) {
        prefinish(stream, state);
        if (state.pendingcb === 0) {
          state.finished = true;
          stream.emit("finish");
          if (state.autoDestroy) {
            var rState = stream._readableState;
            if (!rState || rState.autoDestroy && rState.endEmitted) {
              stream.destroy();
            }
          }
        }
      }
      return need;
    }
    function endWritable(stream, state, cb) {
      state.ending = true;
      finishMaybe(stream, state);
      if (cb) {
        if (state.finished) process.nextTick(cb);
        else stream.once("finish", cb);
      }
      state.ended = true;
      stream.writable = false;
    }
    function onCorkedFinish(corkReq, state, err) {
      var entry = corkReq.entry;
      corkReq.entry = null;
      while (entry) {
        var cb = entry.callback;
        state.pendingcb--;
        cb(err);
        entry = entry.next;
      }
      state.corkedRequestsFree.next = corkReq;
    }
    Object.defineProperty(Writable.prototype, "destroyed", {
      // making it explicit this property is not enumerable
      // because otherwise some prototype manipulation in
      // userland will fail
      enumerable: false,
      get: function get() {
        if (this._writableState === void 0) {
          return false;
        }
        return this._writableState.destroyed;
      },
      set: function set(value) {
        if (!this._writableState) {
          return;
        }
        this._writableState.destroyed = value;
      }
    });
    Writable.prototype.destroy = destroyImpl.destroy;
    Writable.prototype._undestroy = destroyImpl.undestroy;
    Writable.prototype._destroy = function(err, cb) {
      cb(err);
    };
  }
});
var require_modern = __commonJS2({
  "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/modern.js"(exports$1, module2) {
    var util = __require("util");
    var Writable = require_stream_writable();
    var { LEVEL } = require_triple_beam();
    var TransportStream = module2.exports = function TransportStream2(options = {}) {
      Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
      this.format = options.format;
      this.level = options.level;
      this.handleExceptions = options.handleExceptions;
      this.handleRejections = options.handleRejections;
      this.silent = options.silent;
      if (options.log) this.log = options.log;
      if (options.logv) this.logv = options.logv;
      if (options.close) this.close = options.close;
      this.once("pipe", (logger18) => {
        this.levels = logger18.levels;
        this.parent = logger18;
      });
      this.once("unpipe", (src) => {
        if (src === this.parent) {
          this.parent = null;
          if (this.close) {
            this.close();
          }
        }
      });
    };
    util.inherits(TransportStream, Writable);
    TransportStream.prototype._write = function _write(info, enc, callback) {
      if (this.silent || info.exception === true && !this.handleExceptions) {
        return callback(null);
      }
      const level = this.level || this.parent && this.parent.level;
      if (!level || this.levels[level] >= this.levels[info[LEVEL]]) {
        if (info && !this.format) {
          return this.log(info, callback);
        }
        let errState;
        let transformed;
        try {
          transformed = this.format.transform(Object.assign({}, info), this.format.options);
        } catch (err) {
          errState = err;
        }
        if (errState || !transformed) {
          callback();
          if (errState) throw errState;
          return;
        }
        return this.log(transformed, callback);
      }
      this._writableState.sync = false;
      return callback(null);
    };
    TransportStream.prototype._writev = function _writev(chunks, callback) {
      if (this.logv) {
        const infos = chunks.filter(this._accept, this);
        if (!infos.length) {
          return callback(null);
        }
        return this.logv(infos, callback);
      }
      for (let i3 = 0; i3 < chunks.length; i3++) {
        if (!this._accept(chunks[i3])) continue;
        if (chunks[i3].chunk && !this.format) {
          this.log(chunks[i3].chunk, chunks[i3].callback);
          continue;
        }
        let errState;
        let transformed;
        try {
          transformed = this.format.transform(
            Object.assign({}, chunks[i3].chunk),
            this.format.options
          );
        } catch (err) {
          errState = err;
        }
        if (errState || !transformed) {
          chunks[i3].callback();
          if (errState) {
            callback(null);
            throw errState;
          }
        } else {
          this.log(transformed, chunks[i3].callback);
        }
      }
      return callback(null);
    };
    TransportStream.prototype._accept = function _accept(write) {
      const info = write.chunk;
      if (this.silent) {
        return false;
      }
      const level = this.level || this.parent && this.parent.level;
      if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) {
        if (this.handleExceptions || info.exception !== true) {
          return true;
        }
      }
      return false;
    };
    TransportStream.prototype._nop = function _nop() {
      return void 0;
    };
  }
});
var require_legacy = __commonJS2({
  "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/legacy.js"(exports$1, module2) {
    var util = __require("util");
    var { LEVEL } = require_triple_beam();
    var TransportStream = require_modern();
    var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) {
      TransportStream.call(this, options);
      if (!options.transport || typeof options.transport.log !== "function") {
        throw new Error("Invalid transport, must be an object with a log method.");
      }
      this.transport = options.transport;
      this.level = this.level || options.transport.level;
      this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
      this._deprecated();
      function transportError(err) {
        this.emit("error", err, this.transport);
      }
      if (!this.transport.__winstonError) {
        this.transport.__winstonError = transportError.bind(this);
        this.transport.on("error", this.transport.__winstonError);
      }
    };
    util.inherits(LegacyTransportStream, TransportStream);
    LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
      if (this.silent || info.exception === true && !this.handleExceptions) {
        return callback(null);
      }
      if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
        this.transport.log(info[LEVEL], info.message, info, this._nop);
      }
      callback(null);
    };
    LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
      for (let i3 = 0; i3 < chunks.length; i3++) {
        if (this._accept(chunks[i3])) {
          this.transport.log(
            chunks[i3].chunk[LEVEL],
            chunks[i3].chunk.message,
            chunks[i3].chunk,
            this._nop
          );
          chunks[i3].callback();
        }
      }
      return callback(null);
    };
    LegacyTransportStream.prototype._deprecated = function _deprecated() {
      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("\n"));
    };
    LegacyTransportStream.prototype.close = function close() {
      if (this.transport.close) {
        this.transport.close();
      }
      if (this.transport.__winstonError) {
        this.transport.removeListener("error", this.transport.__winstonError);
        this.transport.__winstonError = null;
      }
    };
  }
});
var require_winston_transport = __commonJS2({
  "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/index.js"(exports$1, module2) {
    module2.exports = require_modern();
    module2.exports.LegacyTransportStream = require_legacy();
  }
});
var require_console = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/console.js"(exports$1, module2) {
    var os2 = __require("os");
    var { LEVEL, MESSAGE } = require_triple_beam();
    var TransportStream = require_winston_transport();
    module2.exports = class Console extends TransportStream {
      /**
       * Constructor function for the Console transport object responsible for
       * persisting log messages and metadata to a terminal or TTY.
       * @param {!Object} [options={}] - Options for this instance.
       */
      constructor(options = {}) {
        super(options);
        this.name = options.name || "console";
        this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
        this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
        this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
        this.forceConsole = options.forceConsole || false;
        this._consoleLog = console.log.bind(console);
        this._consoleWarn = console.warn.bind(console);
        this._consoleError = console.error.bind(console);
        this.setMaxListeners(30);
      }
      /**
       * Core logging method exposed to Winston.
       * @param {Object} info - TODO: add param description.
       * @param {Function} callback - TODO: add param description.
       * @returns {undefined}
       */
      log(info, callback) {
        setImmediate(() => this.emit("logged", info));
        if (this.stderrLevels[info[LEVEL]]) {
          if (console._stderr && !this.forceConsole) {
            console._stderr.write(`${info[MESSAGE]}${this.eol}`);
          } else {
            this._consoleError(info[MESSAGE]);
          }
          if (callback) {
            callback();
          }
          return;
        } else if (this.consoleWarnLevels[info[LEVEL]]) {
          if (console._stderr && !this.forceConsole) {
            console._stderr.write(`${info[MESSAGE]}${this.eol}`);
          } else {
            this._consoleWarn(info[MESSAGE]);
          }
          if (callback) {
            callback();
          }
          return;
        }
        if (console._stdout && !this.forceConsole) {
          console._stdout.write(`${info[MESSAGE]}${this.eol}`);
        } else {
          this._consoleLog(info[MESSAGE]);
        }
        if (callback) {
          callback();
        }
      }
      /**
       * 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
       */
      _stringArrayToSet(strArray, errMsg) {
        if (!strArray) return {};
        errMsg = errMsg || "Cannot make set from type other than Array of string elements";
        if (!Array.isArray(strArray)) {
          throw new Error(errMsg);
        }
        return strArray.reduce((set, el) => {
          if (typeof el !== "string") {
            throw new Error(errMsg);
          }
          set[el] = true;
          return set;
        }, {});
      }
    };
  }
});
var require_isArrayLike2 = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/isArrayLike.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = isArrayLike;
    function isArrayLike(value) {
      return value && typeof value.length === "number" && value.length >= 0 && value.length % 1 === 0;
    }
    module2.exports = exports$1.default;
  }
});
var require_initialParams = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/initialParams.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = function(fn) {
      return function(...args) {
        var callback = args.pop();
        return fn.call(this, args, callback);
      };
    };
    module2.exports = exports$1.default;
  }
});
var require_setImmediate = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/setImmediate.js"(exports$1) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.fallback = fallback;
    exports$1.wrap = wrap;
    var hasQueueMicrotask = exports$1.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
    var hasSetImmediate = exports$1.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
    var hasNextTick = exports$1.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
    function fallback(fn) {
      setTimeout(fn, 0);
    }
    function wrap(defer) {
      return (fn, ...args) => defer(() => fn(...args));
    }
    var _defer;
    if (hasQueueMicrotask) {
      _defer = queueMicrotask;
    } else if (hasSetImmediate) {
      _defer = setImmediate;
    } else if (hasNextTick) {
      _defer = process.nextTick;
    } else {
      _defer = fallback;
    }
    exports$1.default = wrap(_defer);
  }
});
var require_asyncify = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/asyncify.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = asyncify;
    var _initialParams = require_initialParams();
    var _initialParams2 = _interopRequireDefault(_initialParams);
    var _setImmediate = require_setImmediate();
    var _setImmediate2 = _interopRequireDefault(_setImmediate);
    var _wrapAsync = require_wrapAsync();
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function asyncify(func) {
      if ((0, _wrapAsync.isAsync)(func)) {
        return function(...args) {
          const callback = args.pop();
          const promise = func.apply(this, args);
          return handlePromise(promise, callback);
        };
      }
      return (0, _initialParams2.default)(function(args, callback) {
        var result;
        try {
          result = func.apply(this, args);
        } catch (e3) {
          return callback(e3);
        }
        if (result && typeof result.then === "function") {
          return handlePromise(result, callback);
        } else {
          callback(null, result);
        }
      });
    }
    function handlePromise(promise, callback) {
      return promise.then((value) => {
        invokeCallback(callback, null, value);
      }, (err) => {
        invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err));
      });
    }
    function invokeCallback(callback, error, value) {
      try {
        callback(error, value);
      } catch (err) {
        (0, _setImmediate2.default)((e3) => {
          throw e3;
        }, err);
      }
    }
    module2.exports = exports$1.default;
  }
});
var require_wrapAsync = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/wrapAsync.js"(exports$1) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.isAsyncIterable = exports$1.isAsyncGenerator = exports$1.isAsync = void 0;
    var _asyncify = require_asyncify();
    var _asyncify2 = _interopRequireDefault(_asyncify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function isAsync(fn) {
      return fn[Symbol.toStringTag] === "AsyncFunction";
    }
    function isAsyncGenerator(fn) {
      return fn[Symbol.toStringTag] === "AsyncGenerator";
    }
    function isAsyncIterable(obj) {
      return typeof obj[Symbol.asyncIterator] === "function";
    }
    function wrapAsync(asyncFn) {
      if (typeof asyncFn !== "function") throw new Error("expected a function");
      return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
    }
    exports$1.default = wrapAsync;
    exports$1.isAsync = isAsync;
    exports$1.isAsyncGenerator = isAsyncGenerator;
    exports$1.isAsyncIterable = isAsyncIterable;
  }
});
var require_awaitify = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/awaitify.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = awaitify;
    function awaitify(asyncFn, arity) {
      if (!arity) arity = asyncFn.length;
      if (!arity) throw new Error("arity is undefined");
      function awaitable(...args) {
        if (typeof args[arity - 1] === "function") {
          return asyncFn.apply(this, args);
        }
        return new Promise((resolve4, reject) => {
          args[arity - 1] = (err, ...cbArgs) => {
            if (err) return reject(err);
            resolve4(cbArgs.length > 1 ? cbArgs : cbArgs[0]);
          };
          asyncFn.apply(this, args);
        });
      }
      return awaitable;
    }
    module2.exports = exports$1.default;
  }
});
var require_parallel = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/parallel.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _isArrayLike = require_isArrayLike2();
    var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
    var _wrapAsync = require_wrapAsync();
    var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
    var _awaitify = require_awaitify();
    var _awaitify2 = _interopRequireDefault(_awaitify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    exports$1.default = (0, _awaitify2.default)((eachfn, tasks, callback) => {
      var results = (0, _isArrayLike2.default)(tasks) ? [] : {};
      eachfn(tasks, (task, key, taskCb) => {
        (0, _wrapAsync2.default)(task)((err, ...result) => {
          if (result.length < 2) {
            [result] = result;
          }
          results[key] = result;
          taskCb(err);
        });
      }, (err) => callback(err, results));
    }, 3);
    module2.exports = exports$1.default;
  }
});
var require_once = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/once.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = once;
    function once(fn) {
      function wrapper(...args) {
        if (fn === null) return;
        var callFn = fn;
        fn = null;
        callFn.apply(this, args);
      }
      Object.assign(wrapper, fn);
      return wrapper;
    }
    module2.exports = exports$1.default;
  }
});
var require_getIterator = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/getIterator.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = function(coll) {
      return coll[Symbol.iterator] && coll[Symbol.iterator]();
    };
    module2.exports = exports$1.default;
  }
});
var require_iterator2 = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/iterator.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = createIterator;
    var _isArrayLike = require_isArrayLike2();
    var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
    var _getIterator = require_getIterator();
    var _getIterator2 = _interopRequireDefault(_getIterator);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function createArrayIterator(coll) {
      var i3 = -1;
      var len = coll.length;
      return function next() {
        return ++i3 < len ? { value: coll[i3], key: i3 } : null;
      };
    }
    function createES2015Iterator(iterator) {
      var i3 = -1;
      return function next() {
        var item = iterator.next();
        if (item.done) return null;
        i3++;
        return { value: item.value, key: i3 };
      };
    }
    function createObjectIterator(obj) {
      var okeys = obj ? Object.keys(obj) : [];
      var i3 = -1;
      var len = okeys.length;
      return function next() {
        var key = okeys[++i3];
        if (key === "__proto__") {
          return next();
        }
        return i3 < len ? { value: obj[key], key } : null;
      };
    }
    function createIterator(coll) {
      if ((0, _isArrayLike2.default)(coll)) {
        return createArrayIterator(coll);
      }
      var iterator = (0, _getIterator2.default)(coll);
      return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);
    }
    module2.exports = exports$1.default;
  }
});
var require_onlyOnce = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/onlyOnce.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = onlyOnce;
    function onlyOnce(fn) {
      return function(...args) {
        if (fn === null) throw new Error("Callback was already called.");
        var callFn = fn;
        fn = null;
        callFn.apply(this, args);
      };
    }
    module2.exports = exports$1.default;
  }
});
var require_breakLoop = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/breakLoop.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var breakLoop = {};
    exports$1.default = breakLoop;
    module2.exports = exports$1.default;
  }
});
var require_asyncEachOfLimit = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/asyncEachOfLimit.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = asyncEachOfLimit;
    var _breakLoop = require_breakLoop();
    var _breakLoop2 = _interopRequireDefault(_breakLoop);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function asyncEachOfLimit(generator, limit, iteratee, callback) {
      let done = false;
      let canceled = false;
      let awaiting = false;
      let running = 0;
      let idx = 0;
      function replenish() {
        if (running >= limit || awaiting || done) return;
        awaiting = true;
        generator.next().then(({ value, done: iterDone }) => {
          if (canceled || done) return;
          awaiting = false;
          if (iterDone) {
            done = true;
            if (running <= 0) {
              callback(null);
            }
            return;
          }
          running++;
          iteratee(value, idx, iterateeCallback);
          idx++;
          replenish();
        }).catch(handleError);
      }
      function iterateeCallback(err, result) {
        running -= 1;
        if (canceled) return;
        if (err) return handleError(err);
        if (err === false) {
          done = true;
          canceled = true;
          return;
        }
        if (result === _breakLoop2.default || done && running <= 0) {
          done = true;
          return callback(null);
        }
        replenish();
      }
      function handleError(err) {
        if (canceled) return;
        awaiting = false;
        done = true;
        callback(err);
      }
      replenish();
    }
    module2.exports = exports$1.default;
  }
});
var require_eachOfLimit = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/eachOfLimit.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _once = require_once();
    var _once2 = _interopRequireDefault(_once);
    var _iterator = require_iterator2();
    var _iterator2 = _interopRequireDefault(_iterator);
    var _onlyOnce = require_onlyOnce();
    var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
    var _wrapAsync = require_wrapAsync();
    var _asyncEachOfLimit = require_asyncEachOfLimit();
    var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit);
    var _breakLoop = require_breakLoop();
    var _breakLoop2 = _interopRequireDefault(_breakLoop);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    exports$1.default = (limit) => {
      return (obj, iteratee, callback) => {
        callback = (0, _once2.default)(callback);
        if (limit <= 0) {
          throw new RangeError("concurrency limit cannot be less than 1");
        }
        if (!obj) {
          return callback(null);
        }
        if ((0, _wrapAsync.isAsyncGenerator)(obj)) {
          return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback);
        }
        if ((0, _wrapAsync.isAsyncIterable)(obj)) {
          return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback);
        }
        var nextElem = (0, _iterator2.default)(obj);
        var done = false;
        var canceled = false;
        var running = 0;
        var looping = false;
        function iterateeCallback(err, value) {
          if (canceled) return;
          running -= 1;
          if (err) {
            done = true;
            callback(err);
          } else if (err === false) {
            done = true;
            canceled = true;
          } else if (value === _breakLoop2.default || done && running <= 0) {
            done = true;
            return callback(null);
          } else if (!looping) {
            replenish();
          }
        }
        function replenish() {
          looping = true;
          while (running < limit && !done) {
            var elem = nextElem();
            if (elem === null) {
              done = true;
              if (running <= 0) {
                callback(null);
              }
              return;
            }
            running += 1;
            iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));
          }
          looping = false;
        }
        replenish();
      };
    };
    module2.exports = exports$1.default;
  }
});
var require_eachOfLimit2 = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/eachOfLimit.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _eachOfLimit2 = require_eachOfLimit();
    var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
    var _wrapAsync = require_wrapAsync();
    var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
    var _awaitify = require_awaitify();
    var _awaitify2 = _interopRequireDefault(_awaitify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function eachOfLimit(coll, limit, iteratee, callback) {
      return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
    }
    exports$1.default = (0, _awaitify2.default)(eachOfLimit, 4);
    module2.exports = exports$1.default;
  }
});
var require_eachOfSeries = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/eachOfSeries.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _eachOfLimit = require_eachOfLimit2();
    var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
    var _awaitify = require_awaitify();
    var _awaitify2 = _interopRequireDefault(_awaitify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function eachOfSeries(coll, iteratee, callback) {
      return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback);
    }
    exports$1.default = (0, _awaitify2.default)(eachOfSeries, 3);
    module2.exports = exports$1.default;
  }
});
var require_series = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/series.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = series;
    var _parallel2 = require_parallel();
    var _parallel3 = _interopRequireDefault(_parallel2);
    var _eachOfSeries = require_eachOfSeries();
    var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function series(tasks, callback) {
      return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback);
    }
    module2.exports = exports$1.default;
  }
});
var require_stream_transform = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js"(exports$1, module2) {
    module2.exports = Transform;
    var _require$codes = require_errors2().codes;
    var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
    var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
    var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
    var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
    var Duplex = require_stream_duplex();
    require_inherits()(Transform, Duplex);
    function afterTransform(er, data) {
      var ts = this._transformState;
      ts.transforming = false;
      var cb = ts.writecb;
      if (cb === null) {
        return this.emit("error", new ERR_MULTIPLE_CALLBACK());
      }
      ts.writechunk = null;
      ts.writecb = null;
      if (data != null)
        this.push(data);
      cb(er);
      var rs = this._readableState;
      rs.reading = false;
      if (rs.needReadable || rs.length < rs.highWaterMark) {
        this._read(rs.highWaterMark);
      }
    }
    function Transform(options) {
      if (!(this instanceof Transform)) return new Transform(options);
      Duplex.call(this, options);
      this._transformState = {
        afterTransform: afterTransform.bind(this),
        needTransform: false,
        transforming: false,
        writecb: null,
        writechunk: null,
        writeencoding: null
      };
      this._readableState.needReadable = true;
      this._readableState.sync = false;
      if (options) {
        if (typeof options.transform === "function") this._transform = options.transform;
        if (typeof options.flush === "function") this._flush = options.flush;
      }
      this.on("prefinish", prefinish);
    }
    function prefinish() {
      var _this = this;
      if (typeof this._flush === "function" && !this._readableState.destroyed) {
        this._flush(function(er, data) {
          done(_this, er, data);
        });
      } else {
        done(this, null, null);
      }
    }
    Transform.prototype.push = function(chunk, encoding) {
      this._transformState.needTransform = false;
      return Duplex.prototype.push.call(this, chunk, encoding);
    };
    Transform.prototype._transform = function(chunk, encoding, cb) {
      cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
    };
    Transform.prototype._write = function(chunk, encoding, cb) {
      var ts = this._transformState;
      ts.writecb = cb;
      ts.writechunk = chunk;
      ts.writeencoding = encoding;
      if (!ts.transforming) {
        var rs = this._readableState;
        if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
      }
    };
    Transform.prototype._read = function(n3) {
      var ts = this._transformState;
      if (ts.writechunk !== null && !ts.transforming) {
        ts.transforming = true;
        this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
      } else {
        ts.needTransform = true;
      }
    };
    Transform.prototype._destroy = function(err, cb) {
      Duplex.prototype._destroy.call(this, err, function(err2) {
        cb(err2);
      });
    };
    function done(stream, er, data) {
      if (er) return stream.emit("error", er);
      if (data != null)
        stream.push(data);
      if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
      if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
      return stream.push(null);
    }
  }
});
var require_stream_passthrough = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports$1, module2) {
    module2.exports = PassThrough;
    var Transform = require_stream_transform();
    require_inherits()(PassThrough, Transform);
    function PassThrough(options) {
      if (!(this instanceof PassThrough)) return new PassThrough(options);
      Transform.call(this, options);
    }
    PassThrough.prototype._transform = function(chunk, encoding, cb) {
      cb(null, chunk);
    };
  }
});
var require_pipeline = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports$1, module2) {
    var eos;
    function once(callback) {
      var called = false;
      return function() {
        if (called) return;
        called = true;
        callback.apply(void 0, arguments);
      };
    }
    var _require$codes = require_errors2().codes;
    var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
    var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
    function noop(err) {
      if (err) throw err;
    }
    function isRequest2(stream) {
      return stream.setHeader && typeof stream.abort === "function";
    }
    function destroyer(stream, reading, writing, callback) {
      callback = once(callback);
      var closed = false;
      stream.on("close", function() {
        closed = true;
      });
      if (eos === void 0) eos = require_end_of_stream();
      eos(stream, {
        readable: reading,
        writable: writing
      }, function(err) {
        if (err) return callback(err);
        closed = true;
        callback();
      });
      var destroyed = false;
      return function(err) {
        if (closed) return;
        if (destroyed) return;
        destroyed = true;
        if (isRequest2(stream)) return stream.abort();
        if (typeof stream.destroy === "function") return stream.destroy();
        callback(err || new ERR_STREAM_DESTROYED("pipe"));
      };
    }
    function call(fn) {
      fn();
    }
    function pipe(from, to) {
      return from.pipe(to);
    }
    function popCallback(streams) {
      if (!streams.length) return noop;
      if (typeof streams[streams.length - 1] !== "function") return noop;
      return streams.pop();
    }
    function pipeline() {
      for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
        streams[_key] = arguments[_key];
      }
      var callback = popCallback(streams);
      if (Array.isArray(streams[0])) streams = streams[0];
      if (streams.length < 2) {
        throw new ERR_MISSING_ARGS("streams");
      }
      var error;
      var destroys = streams.map(function(stream, i3) {
        var reading = i3 < streams.length - 1;
        var writing = i3 > 0;
        return destroyer(stream, reading, writing, function(err) {
          if (!error) error = err;
          if (err) destroys.forEach(call);
          if (reading) return;
          destroys.forEach(call);
          callback(error);
        });
      });
      return streams.reduce(pipe);
    }
    module2.exports = pipeline;
  }
});
var require_readable = __commonJS2({
  "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js"(exports$1, module2) {
    var Stream = __require("stream");
    if (process.env.READABLE_STREAM === "disable" && Stream) {
      module2.exports = Stream.Readable;
      Object.assign(module2.exports, Stream);
      module2.exports.Stream = Stream;
    } else {
      exports$1 = module2.exports = require_stream_readable();
      exports$1.Stream = Stream || exports$1;
      exports$1.Readable = exports$1;
      exports$1.Writable = require_stream_writable();
      exports$1.Duplex = require_stream_duplex();
      exports$1.Transform = require_stream_transform();
      exports$1.PassThrough = require_stream_passthrough();
      exports$1.finished = require_end_of_stream();
      exports$1.pipeline = require_pipeline();
    }
  }
});
var require_diagnostics = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/diagnostics.js"(exports$1, module2) {
    var adapters = [];
    var modifiers = [];
    var logger18 = function devnull() {
    };
    function use(adapter) {
      if (~adapters.indexOf(adapter)) return false;
      adapters.push(adapter);
      return true;
    }
    function set(custom) {
      logger18 = custom;
    }
    function enabled(namespace) {
      var async = [];
      for (var i3 = 0; i3 < adapters.length; i3++) {
        if (adapters[i3].async) {
          async.push(adapters[i3]);
          continue;
        }
        if (adapters[i3](namespace)) return true;
      }
      if (!async.length) return false;
      return new Promise(function pinky(resolve4) {
        Promise.all(
          async.map(function prebind(fn) {
            return fn(namespace);
          })
        ).then(function resolved(values) {
          resolve4(values.some(Boolean));
        });
      });
    }
    function modify(fn) {
      if (~modifiers.indexOf(fn)) return false;
      modifiers.push(fn);
      return true;
    }
    function write() {
      logger18.apply(logger18, arguments);
    }
    function process2(message) {
      for (var i3 = 0; i3 < modifiers.length; i3++) {
        message = modifiers[i3].apply(modifiers[i3], arguments);
      }
      return message;
    }
    function introduce(fn, options) {
      var has = Object.prototype.hasOwnProperty;
      for (var key in options) {
        if (has.call(options, key)) {
          fn[key] = options[key];
        }
      }
      return fn;
    }
    function nope(options) {
      options.enabled = false;
      options.modify = modify;
      options.set = set;
      options.use = use;
      return introduce(function diagnopes() {
        return false;
      }, options);
    }
    function yep(options) {
      function diagnostics() {
        var args = Array.prototype.slice.call(arguments, 0);
        write.call(write, options, process2(args, options));
        return true;
      }
      options.enabled = true;
      options.modify = modify;
      options.set = set;
      options.use = use;
      return introduce(diagnostics, options);
    }
    module2.exports = function create(diagnostics) {
      diagnostics.introduce = introduce;
      diagnostics.enabled = enabled;
      diagnostics.process = process2;
      diagnostics.modify = modify;
      diagnostics.write = write;
      diagnostics.nope = nope;
      diagnostics.yep = yep;
      diagnostics.set = set;
      diagnostics.use = use;
      return diagnostics;
    };
  }
});
var require_production = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/node/production.js"(exports$1, module2) {
    var create = require_diagnostics();
    var diagnostics = create(function prod(namespace, options) {
      options = options || {};
      options.namespace = namespace;
      options.prod = true;
      options.dev = false;
      if (!(options.force || prod.force)) return prod.nope(options);
      return prod.yep(options);
    });
    module2.exports = diagnostics;
  }
});
var require_index_cjs = __commonJS2({
  "../../node_modules/.pnpm/@so-ric+colorspace@1.1.6/node_modules/@so-ric/colorspace/dist/index.cjs.js"(exports$1, module2) {
    var cssKeywords = {
      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]
    };
    var reverseNames = /* @__PURE__ */ Object.create(null);
    for (const name in cssKeywords) {
      if (Object.hasOwn(cssKeywords, name)) {
        reverseNames[cssKeywords[name]] = name;
      }
    }
    var cs = {
      to: {},
      get: {}
    };
    cs.get = function(string) {
      const prefix = string.slice(0, 3).toLowerCase();
      let value;
      let model;
      switch (prefix) {
        case "hsl": {
          value = cs.get.hsl(string);
          model = "hsl";
          break;
        }
        case "hwb": {
          value = cs.get.hwb(string);
          model = "hwb";
          break;
        }
        default: {
          value = cs.get.rgb(string);
          model = "rgb";
          break;
        }
      }
      if (!value) {
        return null;
      }
      return { model, value };
    };
    cs.get.rgb = function(string) {
      if (!string) {
        return null;
      }
      const abbr = /^#([a-f\d]{3,4})$/i;
      const hex2 = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
      const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
      const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
      const keyword = /^(\w+)$/;
      let rgb = [0, 0, 0, 1];
      let match;
      let i3;
      let hexAlpha;
      if (match = string.match(hex2)) {
        hexAlpha = match[2];
        match = match[1];
        for (i3 = 0; i3 < 3; i3++) {
          const i22 = i3 * 2;
          rgb[i3] = Number.parseInt(match.slice(i22, i22 + 2), 16);
        }
        if (hexAlpha) {
          rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
        }
      } else if (match = string.match(abbr)) {
        match = match[1];
        hexAlpha = match[3];
        for (i3 = 0; i3 < 3; i3++) {
          rgb[i3] = Number.parseInt(match[i3] + match[i3], 16);
        }
        if (hexAlpha) {
          rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
        }
      } else if (match = string.match(rgba)) {
        for (i3 = 0; i3 < 3; i3++) {
          rgb[i3] = Number.parseInt(match[i3 + 1], 10);
        }
        if (match[4]) {
          rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
        }
      } else if (match = string.match(per)) {
        for (i3 = 0; i3 < 3; i3++) {
          rgb[i3] = Math.round(Number.parseFloat(match[i3 + 1]) * 2.55);
        }
        if (match[4]) {
          rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
        }
      } else if (match = string.match(keyword)) {
        if (match[1] === "transparent") {
          return [0, 0, 0, 0];
        }
        if (!Object.hasOwn(cssKeywords, match[1])) {
          return null;
        }
        rgb = cssKeywords[match[1]];
        rgb[3] = 1;
        return rgb;
      } else {
        return null;
      }
      for (i3 = 0; i3 < 3; i3++) {
        rgb[i3] = clamp(rgb[i3], 0, 255);
      }
      rgb[3] = clamp(rgb[3], 0, 1);
      return rgb;
    };
    cs.get.hsl = function(string) {
      if (!string) {
        return null;
      }
      const hsl = /^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*)?\)$/;
      const match = string.match(hsl);
      if (match) {
        const alpha = Number.parseFloat(match[4]);
        const h3 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
        const s = clamp(Number.parseFloat(match[2]), 0, 100);
        const l3 = clamp(Number.parseFloat(match[3]), 0, 100);
        const a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
        return [h3, s, l3, a];
      }
      return null;
    };
    cs.get.hwb = function(string) {
      if (!string) {
        return null;
      }
      const hwb = /^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*)?\)$/;
      const match = string.match(hwb);
      if (match) {
        const alpha = Number.parseFloat(match[4]);
        const h3 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
        const w5 = clamp(Number.parseFloat(match[2]), 0, 100);
        const b3 = clamp(Number.parseFloat(match[3]), 0, 100);
        const a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
        return [h3, w5, b3, a];
      }
      return null;
    };
    cs.to.hex = function(...rgba) {
      return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
    };
    cs.to.rgb = function(...rgba) {
      return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
    };
    cs.to.rgb.percent = function(...rgba) {
      const r3 = Math.round(rgba[0] / 255 * 100);
      const g3 = Math.round(rgba[1] / 255 * 100);
      const b3 = Math.round(rgba[2] / 255 * 100);
      return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r3 + "%, " + g3 + "%, " + b3 + "%)" : "rgba(" + r3 + "%, " + g3 + "%, " + b3 + "%, " + rgba[3] + ")";
    };
    cs.to.hsl = function(...hsla) {
      return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
    };
    cs.to.hwb = function(...hwba) {
      let a = "";
      if (hwba.length >= 4 && hwba[3] !== 1) {
        a = ", " + hwba[3];
      }
      return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
    };
    cs.to.keyword = function(...rgb) {
      return reverseNames[rgb.slice(0, 3)];
    };
    function clamp(number_, min, max) {
      return Math.min(Math.max(min, number_), max);
    }
    function hexDouble(number_) {
      const string_ = Math.round(number_).toString(16).toUpperCase();
      return string_.length < 2 ? "0" + string_ : string_;
    }
    var reverseKeywords = {};
    for (const key of Object.keys(cssKeywords)) {
      reverseKeywords[cssKeywords[key]] = key;
    }
    var convert$1 = {
      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"] }
    };
    var LAB_FT = (6 / 29) ** 3;
    function srgbNonlinearTransform(c3) {
      const cc = c3 > 31308e-7 ? 1.055 * c3 ** (1 / 2.4) - 0.055 : c3 * 12.92;
      return Math.min(Math.max(0, cc), 1);
    }
    function srgbNonlinearTransformInv(c3) {
      return c3 > 0.04045 ? ((c3 + 0.055) / 1.055) ** 2.4 : c3 / 12.92;
    }
    for (const model of Object.keys(convert$1)) {
      if (!("channels" in convert$1[model])) {
        throw new Error("missing channels property: " + model);
      }
      if (!("labels" in convert$1[model])) {
        throw new Error("missing channel labels property: " + model);
      }
      if (convert$1[model].labels.length !== convert$1[model].channels) {
        throw new Error("channel and label counts mismatch: " + model);
      }
      const { channels, labels } = convert$1[model];
      delete convert$1[model].channels;
      delete convert$1[model].labels;
      Object.defineProperty(convert$1[model], "channels", { value: channels });
      Object.defineProperty(convert$1[model], "labels", { value: labels });
    }
    convert$1.rgb.hsl = function(rgb) {
      const r3 = rgb[0] / 255;
      const g3 = rgb[1] / 255;
      const b3 = rgb[2] / 255;
      const min = Math.min(r3, g3, b3);
      const max = Math.max(r3, g3, b3);
      const delta = max - min;
      let h3;
      let s;
      switch (max) {
        case min: {
          h3 = 0;
          break;
        }
        case r3: {
          h3 = (g3 - b3) / delta;
          break;
        }
        case g3: {
          h3 = 2 + (b3 - r3) / delta;
          break;
        }
        case b3: {
          h3 = 4 + (r3 - g3) / delta;
          break;
        }
      }
      h3 = Math.min(h3 * 60, 360);
      if (h3 < 0) {
        h3 += 360;
      }
      const l3 = (min + max) / 2;
      if (max === min) {
        s = 0;
      } else if (l3 <= 0.5) {
        s = delta / (max + min);
      } else {
        s = delta / (2 - max - min);
      }
      return [h3, s * 100, l3 * 100];
    };
    convert$1.rgb.hsv = function(rgb) {
      let rdif;
      let gdif;
      let bdif;
      let h3;
      let s;
      const r3 = rgb[0] / 255;
      const g3 = rgb[1] / 255;
      const b3 = rgb[2] / 255;
      const v3 = Math.max(r3, g3, b3);
      const diff = v3 - Math.min(r3, g3, b3);
      const diffc = function(c3) {
        return (v3 - c3) / 6 / diff + 1 / 2;
      };
      if (diff === 0) {
        h3 = 0;
        s = 0;
      } else {
        s = diff / v3;
        rdif = diffc(r3);
        gdif = diffc(g3);
        bdif = diffc(b3);
        switch (v3) {
          case r3: {
            h3 = bdif - gdif;
            break;
          }
          case g3: {
            h3 = 1 / 3 + rdif - bdif;
            break;
          }
          case b3: {
            h3 = 2 / 3 + gdif - rdif;
            break;
          }
        }
        if (h3 < 0) {
          h3 += 1;
        } else if (h3 > 1) {
          h3 -= 1;
        }
      }
      return [
        h3 * 360,
        s * 100,
        v3 * 100
      ];
    };
    convert$1.rgb.hwb = function(rgb) {
      const r3 = rgb[0];
      const g3 = rgb[1];
      let b3 = rgb[2];
      const h3 = convert$1.rgb.hsl(rgb)[0];
      const w5 = 1 / 255 * Math.min(r3, Math.min(g3, b3));
      b3 = 1 - 1 / 255 * Math.max(r3, Math.max(g3, b3));
      return [h3, w5 * 100, b3 * 100];
    };
    convert$1.rgb.oklab = function(rgb) {
      const r3 = srgbNonlinearTransformInv(rgb[0] / 255);
      const g3 = srgbNonlinearTransformInv(rgb[1] / 255);
      const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
      const lp = Math.cbrt(0.4122214708 * r3 + 0.5363325363 * g3 + 0.0514459929 * b3);
      const mp = Math.cbrt(0.2119034982 * r3 + 0.6806995451 * g3 + 0.1073969566 * b3);
      const sp = Math.cbrt(0.0883024619 * r3 + 0.2817188376 * g3 + 0.6299787005 * b3);
      const l3 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
      const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
      const bb2 = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
      return [l3 * 100, aa * 100, bb2 * 100];
    };
    convert$1.rgb.cmyk = function(rgb) {
      const r3 = rgb[0] / 255;
      const g3 = rgb[1] / 255;
      const b3 = rgb[2] / 255;
      const k = Math.min(1 - r3, 1 - g3, 1 - b3);
      const c3 = (1 - r3 - k) / (1 - k) || 0;
      const m = (1 - g3 - k) / (1 - k) || 0;
      const y3 = (1 - b3 - k) / (1 - k) || 0;
      return [c3 * 100, m * 100, y3 * 100, k * 100];
    };
    function comparativeDistance(x3, y3) {
      return (x3[0] - y3[0]) ** 2 + (x3[1] - y3[1]) ** 2 + (x3[2] - y3[2]) ** 2;
    }
    convert$1.rgb.keyword = function(rgb) {
      const reversed = reverseKeywords[rgb];
      if (reversed) {
        return reversed;
      }
      let currentClosestDistance = Number.POSITIVE_INFINITY;
      let currentClosestKeyword;
      for (const keyword of Object.keys(cssKeywords)) {
        const value = cssKeywords[keyword];
        const distance = comparativeDistance(rgb, value);
        if (distance < currentClosestDistance) {
          currentClosestDistance = distance;
          currentClosestKeyword = keyword;
        }
      }
      return currentClosestKeyword;
    };
    convert$1.keyword.rgb = function(keyword) {
      return cssKeywords[keyword];
    };
    convert$1.rgb.xyz = function(rgb) {
      const r3 = srgbNonlinearTransformInv(rgb[0] / 255);
      const g3 = srgbNonlinearTransformInv(rgb[1] / 255);
      const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
      const x3 = r3 * 0.4124564 + g3 * 0.3575761 + b3 * 0.1804375;
      const y3 = r3 * 0.2126729 + g3 * 0.7151522 + b3 * 0.072175;
      const z = r3 * 0.0193339 + g3 * 0.119192 + b3 * 0.9503041;
      return [x3 * 100, y3 * 100, z * 100];
    };
    convert$1.rgb.lab = function(rgb) {
      const xyz = convert$1.rgb.xyz(rgb);
      let x3 = xyz[0];
      let y3 = xyz[1];
      let z = xyz[2];
      x3 /= 95.047;
      y3 /= 100;
      z /= 108.883;
      x3 = x3 > LAB_FT ? x3 ** (1 / 3) : 7.787 * x3 + 16 / 116;
      y3 = y3 > LAB_FT ? y3 ** (1 / 3) : 7.787 * y3 + 16 / 116;
      z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
      const l3 = 116 * y3 - 16;
      const a = 500 * (x3 - y3);
      const b3 = 200 * (y3 - z);
      return [l3, a, b3];
    };
    convert$1.hsl.rgb = function(hsl) {
      const h3 = hsl[0] / 360;
      const s = hsl[1] / 100;
      const l3 = hsl[2] / 100;
      let t32;
      let value;
      if (s === 0) {
        value = l3 * 255;
        return [value, value, value];
      }
      const t22 = l3 < 0.5 ? l3 * (1 + s) : l3 + s - l3 * s;
      const t12 = 2 * l3 - t22;
      const rgb = [0, 0, 0];
      for (let i3 = 0; i3 < 3; i3++) {
        t32 = h3 + 1 / 3 * -(i3 - 1);
        if (t32 < 0) {
          t32++;
        }
        if (t32 > 1) {
          t32--;
        }
        if (6 * t32 < 1) {
          value = t12 + (t22 - t12) * 6 * t32;
        } else if (2 * t32 < 1) {
          value = t22;
        } else if (3 * t32 < 2) {
          value = t12 + (t22 - t12) * (2 / 3 - t32) * 6;
        } else {
          value = t12;
        }
        rgb[i3] = value * 255;
      }
      return rgb;
    };
    convert$1.hsl.hsv = function(hsl) {
      const h3 = hsl[0];
      let s = hsl[1] / 100;
      let l3 = hsl[2] / 100;
      let smin = s;
      const lmin = Math.max(l3, 0.01);
      l3 *= 2;
      s *= l3 <= 1 ? l3 : 2 - l3;
      smin *= lmin <= 1 ? lmin : 2 - lmin;
      const v3 = (l3 + s) / 2;
      const sv = l3 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l3 + s);
      return [h3, sv * 100, v3 * 100];
    };
    convert$1.hsv.rgb = function(hsv) {
      const h3 = hsv[0] / 60;
      const s = hsv[1] / 100;
      let v3 = hsv[2] / 100;
      const hi = Math.floor(h3) % 6;
      const f = h3 - Math.floor(h3);
      const p = 255 * v3 * (1 - s);
      const q = 255 * v3 * (1 - s * f);
      const t = 255 * v3 * (1 - s * (1 - f));
      v3 *= 255;
      switch (hi) {
        case 0: {
          return [v3, t, p];
        }
        case 1: {
          return [q, v3, p];
        }
        case 2: {
          return [p, v3, t];
        }
        case 3: {
          return [p, q, v3];
        }
        case 4: {
          return [t, p, v3];
        }
        case 5: {
          return [v3, p, q];
        }
      }
    };
    convert$1.hsv.hsl = function(hsv) {
      const h3 = hsv[0];
      const s = hsv[1] / 100;
      const v3 = hsv[2] / 100;
      const vmin = Math.max(v3, 0.01);
      let sl;
      let l3;
      l3 = (2 - s) * v3;
      const lmin = (2 - s) * vmin;
      sl = s * vmin;
      sl /= lmin <= 1 ? lmin : 2 - lmin;
      sl = sl || 0;
      l3 /= 2;
      return [h3, sl * 100, l3 * 100];
    };
    convert$1.hwb.rgb = function(hwb) {
      const h3 = hwb[0] / 360;
      let wh = hwb[1] / 100;
      let bl = hwb[2] / 100;
      const ratio = wh + bl;
      let f;
      if (ratio > 1) {
        wh /= ratio;
        bl /= ratio;
      }
      const i3 = Math.floor(6 * h3);
      const v3 = 1 - bl;
      f = 6 * h3 - i3;
      if ((i3 & 1) !== 0) {
        f = 1 - f;
      }
      const n3 = wh + f * (v3 - wh);
      let r3;
      let g3;
      let b3;
      switch (i3) {
        default:
        case 6:
        case 0: {
          r3 = v3;
          g3 = n3;
          b3 = wh;
          break;
        }
        case 1: {
          r3 = n3;
          g3 = v3;
          b3 = wh;
          break;
        }
        case 2: {
          r3 = wh;
          g3 = v3;
          b3 = n3;
          break;
        }
        case 3: {
          r3 = wh;
          g3 = n3;
          b3 = v3;
          break;
        }
        case 4: {
          r3 = n3;
          g3 = wh;
          b3 = v3;
          break;
        }
        case 5: {
          r3 = v3;
          g3 = wh;
          b3 = n3;
          break;
        }
      }
      return [r3 * 255, g3 * 255, b3 * 255];
    };
    convert$1.cmyk.rgb = function(cmyk) {
      const c3 = cmyk[0] / 100;
      const m = cmyk[1] / 100;
      const y3 = cmyk[2] / 100;
      const k = cmyk[3] / 100;
      const r3 = 1 - Math.min(1, c3 * (1 - k) + k);
      const g3 = 1 - Math.min(1, m * (1 - k) + k);
      const b3 = 1 - Math.min(1, y3 * (1 - k) + k);
      return [r3 * 255, g3 * 255, b3 * 255];
    };
    convert$1.xyz.rgb = function(xyz) {
      const x3 = xyz[0] / 100;
      const y3 = xyz[1] / 100;
      const z = xyz[2] / 100;
      let r3;
      let g3;
      let b3;
      r3 = x3 * 3.2404542 + y3 * -1.5371385 + z * -0.4985314;
      g3 = x3 * -0.969266 + y3 * 1.8760108 + z * 0.041556;
      b3 = x3 * 0.0556434 + y3 * -0.2040259 + z * 1.0572252;
      r3 = srgbNonlinearTransform(r3);
      g3 = srgbNonlinearTransform(g3);
      b3 = srgbNonlinearTransform(b3);
      return [r3 * 255, g3 * 255, b3 * 255];
    };
    convert$1.xyz.lab = function(xyz) {
      let x3 = xyz[0];
      let y3 = xyz[1];
      let z = xyz[2];
      x3 /= 95.047;
      y3 /= 100;
      z /= 108.883;
      x3 = x3 > LAB_FT ? x3 ** (1 / 3) : 7.787 * x3 + 16 / 116;
      y3 = y3 > LAB_FT ? y3 ** (1 / 3) : 7.787 * y3 + 16 / 116;
      z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
      const l3 = 116 * y3 - 16;
      const a = 500 * (x3 - y3);
      const b3 = 200 * (y3 - z);
      return [l3, a, b3];
    };
    convert$1.xyz.oklab = function(xyz) {
      const x3 = xyz[0] / 100;
      const y3 = xyz[1] / 100;
      const z = xyz[2] / 100;
      const lp = Math.cbrt(0.8189330101 * x3 + 0.3618667424 * y3 - 0.1288597137 * z);
      const mp = Math.cbrt(0.0329845436 * x3 + 0.9293118715 * y3 + 0.0361456387 * z);
      const sp = Math.cbrt(0.0482003018 * x3 + 0.2643662691 * y3 + 0.633851707 * z);
      const l3 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
      const a = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
      const b3 = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
      return [l3 * 100, a * 100, b3 * 100];
    };
    convert$1.oklab.oklch = function(oklab) {
      return convert$1.lab.lch(oklab);
    };
    convert$1.oklab.xyz = function(oklab) {
      const ll = oklab[0] / 100;
      const a = oklab[1] / 100;
      const b3 = oklab[2] / 100;
      const l3 = (0.999999998 * ll + 0.396337792 * a + 0.215803758 * b3) ** 3;
      const m = (1.000000008 * ll - 0.105561342 * a - 0.063854175 * b3) ** 3;
      const s = (1.000000055 * ll - 0.089484182 * a - 1.291485538 * b3) ** 3;
      const x3 = 1.227013851 * l3 - 0.55779998 * m + 0.281256149 * s;
      const y3 = -0.040580178 * l3 + 1.11225687 * m - 0.071676679 * s;
      const z = -0.076381285 * l3 - 0.421481978 * m + 1.58616322 * s;
      return [x3 * 100, y3 * 100, z * 100];
    };
    convert$1.oklab.rgb = function(oklab) {
      const ll = oklab[0] / 100;
      const aa = oklab[1] / 100;
      const bb2 = oklab[2] / 100;
      const l3 = (ll + 0.3963377774 * aa + 0.2158037573 * bb2) ** 3;
      const m = (ll - 0.1055613458 * aa - 0.0638541728 * bb2) ** 3;
      const s = (ll - 0.0894841775 * aa - 1.291485548 * bb2) ** 3;
      const r3 = srgbNonlinearTransform(4.0767416621 * l3 - 3.3077115913 * m + 0.2309699292 * s);
      const g3 = srgbNonlinearTransform(-1.2684380046 * l3 + 2.6097574011 * m - 0.3413193965 * s);
      const b3 = srgbNonlinearTransform(-0.0041960863 * l3 - 0.7034186147 * m + 1.707614701 * s);
      return [r3 * 255, g3 * 255, b3 * 255];
    };
    convert$1.oklch.oklab = function(oklch) {
      return convert$1.lch.lab(oklch);
    };
    convert$1.lab.xyz = function(lab) {
      const l3 = lab[0];
      const a = lab[1];
      const b3 = lab[2];
      let x3;
      let y3;
      let z;
      y3 = (l3 + 16) / 116;
      x3 = a / 500 + y3;
      z = y3 - b3 / 200;
      const y22 = y3 ** 3;
      const x22 = x3 ** 3;
      const z2 = z ** 3;
      y3 = y22 > LAB_FT ? y22 : (y3 - 16 / 116) / 7.787;
      x3 = x22 > LAB_FT ? x22 : (x3 - 16 / 116) / 7.787;
      z = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;
      x3 *= 95.047;
      y3 *= 100;
      z *= 108.883;
      return [x3, y3, z];
    };
    convert$1.lab.lch = function(lab) {
      const l3 = lab[0];
      const a = lab[1];
      const b3 = lab[2];
      let h3;
      const hr = Math.atan2(b3, a);
      h3 = hr * 360 / 2 / Math.PI;
      if (h3 < 0) {
        h3 += 360;
      }
      const c3 = Math.sqrt(a * a + b3 * b3);
      return [l3, c3, h3];
    };
    convert$1.lch.lab = function(lch) {
      const l3 = lch[0];
      const c3 = lch[1];
      const h3 = lch[2];
      const hr = h3 / 360 * 2 * Math.PI;
      const a = c3 * Math.cos(hr);
      const b3 = c3 * Math.sin(hr);
      return [l3, a, b3];
    };
    convert$1.rgb.ansi16 = function(args, saturation = null) {
      const [r3, g3, b3] = args;
      let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation;
      value = Math.round(value / 50);
      if (value === 0) {
        return 30;
      }
      let ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g3 / 255) << 1 | Math.round(r3 / 255));
      if (value === 2) {
        ansi += 60;
      }
      return ansi;
    };
    convert$1.hsv.ansi16 = function(args) {
      return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
    };
    convert$1.rgb.ansi256 = function(args) {
      const r3 = args[0];
      const g3 = args[1];
      const b3 = args[2];
      if (r3 >> 4 === g3 >> 4 && g3 >> 4 === b3 >> 4) {
        if (r3 < 8) {
          return 16;
        }
        if (r3 > 248) {
          return 231;
        }
        return Math.round((r3 - 8) / 247 * 24) + 232;
      }
      const ansi = 16 + 36 * Math.round(r3 / 255 * 5) + 6 * Math.round(g3 / 255 * 5) + Math.round(b3 / 255 * 5);
      return ansi;
    };
    convert$1.ansi16.rgb = function(args) {
      args = args[0];
      let color = args % 10;
      if (color === 0 || color === 7) {
        if (args > 50) {
          color += 3.5;
        }
        color = color / 10.5 * 255;
        return [color, color, color];
      }
      const mult = (Math.trunc(args > 50) + 1) * 0.5;
      const r3 = (color & 1) * mult * 255;
      const g3 = (color >> 1 & 1) * mult * 255;
      const b3 = (color >> 2 & 1) * mult * 255;
      return [r3, g3, b3];
    };
    convert$1.ansi256.rgb = function(args) {
      args = args[0];
      if (args >= 232) {
        const c3 = (args - 232) * 10 + 8;
        return [c3, c3, c3];
      }
      args -= 16;
      let rem;
      const r3 = Math.floor(args / 36) / 5 * 255;
      const g3 = Math.floor((rem = args % 36) / 6) / 5 * 255;
      const b3 = rem % 6 / 5 * 255;
      return [r3, g3, b3];
    };
    convert$1.rgb.hex = function(args) {
      const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
      const string = integer.toString(16).toUpperCase();
      return "000000".slice(string.length) + string;
    };
    convert$1.hex.rgb = function(args) {
      const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
      if (!match) {
        return [0, 0, 0];
      }
      let colorString = match[0];
      if (match[0].length === 3) {
        colorString = [...colorString].map((char) => char + char).join("");
      }
      const integer = Number.parseInt(colorString, 16);
      const r3 = integer >> 16 & 255;
      const g3 = integer >> 8 & 255;
      const b3 = integer & 255;
      return [r3, g3, b3];
    };
    convert$1.rgb.hcg = function(rgb) {
      const r3 = rgb[0] / 255;
      const g3 = rgb[1] / 255;
      const b3 = rgb[2] / 255;
      const max = Math.max(Math.max(r3, g3), b3);
      const min = Math.min(Math.min(r3, g3), b3);
      const chroma = max - min;
      let hue;
      const grayscale = chroma < 1 ? min / (1 - chroma) : 0;
      if (chroma <= 0) {
        hue = 0;
      } else if (max === r3) {
        hue = (g3 - b3) / chroma % 6;
      } else if (max === g3) {
        hue = 2 + (b3 - r3) / chroma;
      } else {
        hue = 4 + (r3 - g3) / chroma;
      }
      hue /= 6;
      hue %= 1;
      return [hue * 360, chroma * 100, grayscale * 100];
    };
    convert$1.hsl.hcg = function(hsl) {
      const s = hsl[1] / 100;
      const l3 = hsl[2] / 100;
      const c3 = l3 < 0.5 ? 2 * s * l3 : 2 * s * (1 - l3);
      let f = 0;
      if (c3 < 1) {
        f = (l3 - 0.5 * c3) / (1 - c3);
      }
      return [hsl[0], c3 * 100, f * 100];
    };
    convert$1.hsv.hcg = function(hsv) {
      const s = hsv[1] / 100;
      const v3 = hsv[2] / 100;
      const c3 = s * v3;
      let f = 0;
      if (c3 < 1) {
        f = (v3 - c3) / (1 - c3);
      }
      return [hsv[0], c3 * 100, f * 100];
    };
    convert$1.hcg.rgb = function(hcg) {
      const h3 = hcg[0] / 360;
      const c3 = hcg[1] / 100;
      const g3 = hcg[2] / 100;
      if (c3 === 0) {
        return [g3 * 255, g3 * 255, g3 * 255];
      }
      const pure = [0, 0, 0];
      const hi = h3 % 1 * 6;
      const v3 = hi % 1;
      const w5 = 1 - v3;
      let mg = 0;
      switch (Math.floor(hi)) {
        case 0: {
          pure[0] = 1;
          pure[1] = v3;
          pure[2] = 0;
          break;
        }
        case 1: {
          pure[0] = w5;
          pure[1] = 1;
          pure[2] = 0;
          break;
        }
        case 2: {
          pure[0] = 0;
          pure[1] = 1;
          pure[2] = v3;
          break;
        }
        case 3: {
          pure[0] = 0;
          pure[1] = w5;
          pure[2] = 1;
          break;
        }
        case 4: {
          pure[0] = v3;
          pure[1] = 0;
          pure[2] = 1;
          break;
        }
        default: {
          pure[0] = 1;
          pure[1] = 0;
          pure[2] = w5;
        }
      }
      mg = (1 - c3) * g3;
      return [
        (c3 * pure[0] + mg) * 255,
        (c3 * pure[1] + mg) * 255,
        (c3 * pure[2] + mg) * 255
      ];
    };
    convert$1.hcg.hsv = function(hcg) {
      const c3 = hcg[1] / 100;
      const g3 = hcg[2] / 100;
      const v3 = c3 + g3 * (1 - c3);
      let f = 0;
      if (v3 > 0) {
        f = c3 / v3;
      }
      return [hcg[0], f * 100, v3 * 100];
    };
    convert$1.hcg.hsl = function(hcg) {
      const c3 = hcg[1] / 100;
      const g3 = hcg[2] / 100;
      const l3 = g3 * (1 - c3) + 0.5 * c3;
      let s = 0;
      if (l3 > 0 && l3 < 0.5) {
        s = c3 / (2 * l3);
      } else if (l3 >= 0.5 && l3 < 1) {
        s = c3 / (2 * (1 - l3));
      }
      return [hcg[0], s * 100, l3 * 100];
    };
    convert$1.hcg.hwb = function(hcg) {
      const c3 = hcg[1] / 100;
      const g3 = hcg[2] / 100;
      const v3 = c3 + g3 * (1 - c3);
      return [hcg[0], (v3 - c3) * 100, (1 - v3) * 100];
    };
    convert$1.hwb.hcg = function(hwb) {
      const w5 = hwb[1] / 100;
      const b3 = hwb[2] / 100;
      const v3 = 1 - b3;
      const c3 = v3 - w5;
      let g3 = 0;
      if (c3 < 1) {
        g3 = (v3 - c3) / (1 - c3);
      }
      return [hwb[0], c3 * 100, g3 * 100];
    };
    convert$1.apple.rgb = function(apple) {
      return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
    };
    convert$1.rgb.apple = function(rgb) {
      return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
    };
    convert$1.gray.rgb = function(args) {
      return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
    };
    convert$1.gray.hsl = function(args) {
      return [0, 0, args[0]];
    };
    convert$1.gray.hsv = convert$1.gray.hsl;
    convert$1.gray.hwb = function(gray) {
      return [0, 100, gray[0]];
    };
    convert$1.gray.cmyk = function(gray) {
      return [0, 0, 0, gray[0]];
    };
    convert$1.gray.lab = function(gray) {
      return [gray[0], 0, 0];
    };
    convert$1.gray.hex = function(gray) {
      const value = Math.round(gray[0] / 100 * 255) & 255;
      const integer = (value << 16) + (value << 8) + value;
      const string = integer.toString(16).toUpperCase();
      return "000000".slice(string.length) + string;
    };
    convert$1.rgb.gray = function(rgb) {
      const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
      return [value / 255 * 100];
    };
    function buildGraph() {
      const graph = {};
      const models2 = Object.keys(convert$1);
      for (let { length } = models2, i3 = 0; i3 < length; i3++) {
        graph[models2[i3]] = {
          // http://jsperf.com/1-vs-infinity
          // micro-opt, but this is simple.
          distance: -1,
          parent: null
        };
      }
      return graph;
    }
    function deriveBFS(fromModel) {
      const graph = buildGraph();
      const queue = [fromModel];
      graph[fromModel].distance = 0;
      while (queue.length > 0) {
        const current = queue.pop();
        const adjacents = Object.keys(convert$1[current]);
        for (let { length } = adjacents, i3 = 0; i3 < length; i3++) {
          const adjacent = adjacents[i3];
          const node = graph[adjacent];
          if (node.distance === -1) {
            node.distance = graph[current].distance + 1;
            node.parent = current;
            queue.unshift(adjacent);
          }
        }
      }
      return graph;
    }
    function link(from, to) {
      return function(args) {
        return to(from(args));
      };
    }
    function wrapConversion(toModel, graph) {
      const path2 = [graph[toModel].parent, toModel];
      let fn = convert$1[graph[toModel].parent][toModel];
      let cur = graph[toModel].parent;
      while (graph[cur].parent) {
        path2.unshift(graph[cur].parent);
        fn = link(convert$1[graph[cur].parent][cur], fn);
        cur = graph[cur].parent;
      }
      fn.conversion = path2;
      return fn;
    }
    function route(fromModel) {
      const graph = deriveBFS(fromModel);
      const conversion = {};
      const models2 = Object.keys(graph);
      for (let { length } = models2, i3 = 0; i3 < length; i3++) {
        const toModel = models2[i3];
        const node = graph[toModel];
        if (node.parent === null) {
          continue;
        }
        conversion[toModel] = wrapConversion(toModel, graph);
      }
      return conversion;
    }
    var convert = {};
    var models = Object.keys(convert$1);
    function wrapRaw(fn) {
      const wrappedFn = function(...args) {
        const arg0 = args[0];
        if (arg0 === void 0 || arg0 === null) {
          return arg0;
        }
        if (arg0.length > 1) {
          args = arg0;
        }
        return fn(args);
      };
      if ("conversion" in fn) {
        wrappedFn.conversion = fn.conversion;
      }
      return wrappedFn;
    }
    function wrapRounded(fn) {
      const wrappedFn = function(...args) {
        const arg0 = args[0];
        if (arg0 === void 0 || arg0 === null) {
          return arg0;
        }
        if (arg0.length > 1) {
          args = arg0;
        }
        const result = fn(args);
        if (typeof result === "object") {
          for (let { length } = result, i3 = 0; i3 < length; i3++) {
            result[i3] = Math.round(result[i3]);
          }
        }
        return result;
      };
      if ("conversion" in fn) {
        wrappedFn.conversion = fn.conversion;
      }
      return wrappedFn;
    }
    for (const fromModel of models) {
      convert[fromModel] = {};
      Object.defineProperty(convert[fromModel], "channels", { value: convert$1[fromModel].channels });
      Object.defineProperty(convert[fromModel], "labels", { value: convert$1[fromModel].labels });
      const routes = route(fromModel);
      const routeModels = Object.keys(routes);
      for (const toModel of routeModels) {
        const fn = routes[toModel];
        convert[fromModel][toModel] = wrapRounded(fn);
        convert[fromModel][toModel].raw = wrapRaw(fn);
      }
    }
    var skippedModels = [
      // 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"
    ];
    var hashedModelKeys = {};
    for (const model of Object.keys(convert)) {
      hashedModelKeys[[...convert[model].labels].sort().join("")] = model;
    }
    var limiters = {};
    function Color(object, model) {
      if (!(this instanceof Color)) {
        return new Color(object, model);
      }
      if (model && model in skippedModels) {
        model = null;
      }
      if (model && !(model in convert)) {
        throw new Error("Unknown model: " + model);
      }
      let i3;
      let channels;
      if (object == null) {
        this.model = "rgb";
        this.color = [0, 0, 0];
        this.valpha = 1;
      } else if (object instanceof Color) {
        this.model = object.model;
        this.color = [...object.color];
        this.valpha = object.valpha;
      } else if (typeof object === "string") {
        const result = cs.get(object);
        if (result === null) {
          throw new Error("Unable to parse color from string: " + object);
        }
        this.model = result.model;
        channels = convert[this.model].channels;
        this.color = result.value.slice(0, channels);
        this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
      } else if (object.length > 0) {
        this.model = model || "rgb";
        channels = convert[this.model].channels;
        const newArray = Array.prototype.slice.call(object, 0, channels);
        this.color = zeroArray(newArray, channels);
        this.valpha = typeof object[channels] === "number" ? object[channels] : 1;
      } else if (typeof object === "number") {
        this.model = "rgb";
        this.color = [
          object >> 16 & 255,
          object >> 8 & 255,
          object & 255
        ];
        this.valpha = 1;
      } else {
        this.valpha = 1;
        const keys = Object.keys(object);
        if ("alpha" in object) {
          keys.splice(keys.indexOf("alpha"), 1);
          this.valpha = typeof object.alpha === "number" ? object.alpha : 0;
        }
        const hashedKeys = keys.sort().join("");
        if (!(hashedKeys in hashedModelKeys)) {
          throw new Error("Unable to parse color from object: " + JSON.stringify(object));
        }
        this.model = hashedModelKeys[hashedKeys];
        const { labels } = convert[this.model];
        const color = [];
        for (i3 = 0; i3 < labels.length; i3++) {
          color.push(object[labels[i3]]);
        }
        this.color = zeroArray(color);
      }
      if (limiters[this.model]) {
        channels = convert[this.model].channels;
        for (i3 = 0; i3 < channels; i3++) {
          const limit = limiters[this.model][i3];
          if (limit) {
            this.color[i3] = limit(this.color[i3]);
          }
        }
      }
      this.valpha = Math.max(0, Math.min(1, this.valpha));
      if (Object.freeze) {
        Object.freeze(this);
      }
    }
    Color.prototype = {
      toString() {
        return this.string();
      },
      toJSON() {
        return this[this.model]();
      },
      string(places) {
        let self2 = this.model in cs.to ? this : this.rgb();
        self2 = self2.round(typeof places === "number" ? places : 1);
        const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
        return cs.to[self2.model](...arguments_);
      },
      percentString(places) {
        const self2 = this.rgb().round(typeof places === "number" ? places : 1);
        const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
        return cs.to.rgb.percent(...arguments_);
      },
      array() {
        return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
      },
      object() {
        const result = {};
        const { channels } = convert[this.model];
        const { labels } = convert[this.model];
        for (let i3 = 0; i3 < channels; i3++) {
          result[labels[i3]] = this.color[i3];
        }
        if (this.valpha !== 1) {
          result.alpha = this.valpha;
        }
        return result;
      },
      unitArray() {
        const rgb = this.rgb().color;
        rgb[0] /= 255;
        rgb[1] /= 255;
        rgb[2] /= 255;
        if (this.valpha !== 1) {
          rgb.push(this.valpha);
        }
        return rgb;
      },
      unitObject() {
        const rgb = this.rgb().object();
        rgb.r /= 255;
        rgb.g /= 255;
        rgb.b /= 255;
        if (this.valpha !== 1) {
          rgb.alpha = this.valpha;
        }
        return rgb;
      },
      round(places) {
        places = Math.max(places || 0, 0);
        return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
      },
      alpha(value) {
        if (value !== void 0) {
          return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
        }
        return this.valpha;
      },
      // Rgb
      red: getset("rgb", 0, maxfn(255)),
      green: getset("rgb", 1, maxfn(255)),
      blue: getset("rgb", 2, maxfn(255)),
      hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
      saturationl: getset("hsl", 1, maxfn(100)),
      lightness: getset("hsl", 2, maxfn(100)),
      saturationv: getset("hsv", 1, maxfn(100)),
      value: getset("hsv", 2, maxfn(100)),
      chroma: getset("hcg", 1, maxfn(100)),
      gray: getset("hcg", 2, maxfn(100)),
      white: getset("hwb", 1, maxfn(100)),
      wblack: getset("hwb", 2, maxfn(100)),
      cyan: getset("cmyk", 0, maxfn(100)),
      magenta: getset("cmyk", 1, maxfn(100)),
      yellow: getset("cmyk", 2, maxfn(100)),
      black: getset("cmyk", 3, maxfn(100)),
      x: getset("xyz", 0, maxfn(95.047)),
      y: getset("xyz", 1, maxfn(100)),
      z: getset("xyz", 2, maxfn(108.833)),
      l: getset("lab", 0, maxfn(100)),
      a: getset("lab", 1),
      b: getset("lab", 2),
      keyword(value) {
        if (value !== void 0) {
          return new Color(value);
        }
        return convert[this.model].keyword(this.color);
      },
      hex(value) {
        if (value !== void 0) {
          return new Color(value);
        }
        return cs.to.hex(...this.rgb().round().color);
      },
      hexa(value) {
        if (value !== void 0) {
          return new Color(value);
        }
        const rgbArray = this.rgb().round().color;
        let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
        if (alphaHex.length === 1) {
          alphaHex = "0" + alphaHex;
        }
        return cs.to.hex(...rgbArray) + alphaHex;
      },
      rgbNumber() {
        const rgb = this.rgb().color;
        return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
      },
      luminosity() {
        const rgb = this.rgb().color;
        const lum = [];
        for (const [i3, element] of rgb.entries()) {
          const chan = element / 255;
          lum[i3] = chan <= 0.04045 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
        }
        return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
      },
      contrast(color2) {
        const lum1 = this.luminosity();
        const lum2 = color2.luminosity();
        if (lum1 > lum2) {
          return (lum1 + 0.05) / (lum2 + 0.05);
        }
        return (lum2 + 0.05) / (lum1 + 0.05);
      },
      level(color2) {
        const contrastRatio = this.contrast(color2);
        if (contrastRatio >= 7) {
          return "AAA";
        }
        return contrastRatio >= 4.5 ? "AA" : "";
      },
      isDark() {
        const rgb = this.rgb().color;
        const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
        return yiq < 128;
      },
      isLight() {
        return !this.isDark();
      },
      negate() {
        const rgb = this.rgb();
        for (let i3 = 0; i3 < 3; i3++) {
          rgb.color[i3] = 255 - rgb.color[i3];
        }
        return rgb;
      },
      lighten(ratio) {
        const hsl = this.hsl();
        hsl.color[2] += hsl.color[2] * ratio;
        return hsl;
      },
      darken(ratio) {
        const hsl = this.hsl();
        hsl.color[2] -= hsl.color[2] * ratio;
        return hsl;
      },
      saturate(ratio) {
        const hsl = this.hsl();
        hsl.color[1] += hsl.color[1] * ratio;
        return hsl;
      },
      desaturate(ratio) {
        const hsl = this.hsl();
        hsl.color[1] -= hsl.color[1] * ratio;
        return hsl;
      },
      whiten(ratio) {
        const hwb = this.hwb();
        hwb.color[1] += hwb.color[1] * ratio;
        return hwb;
      },
      blacken(ratio) {
        const hwb = this.hwb();
        hwb.color[2] += hwb.color[2] * ratio;
        return hwb;
      },
      grayscale() {
        const rgb = this.rgb().color;
        const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
        return Color.rgb(value, value, value);
      },
      fade(ratio) {
        return this.alpha(this.valpha - this.valpha * ratio);
      },
      opaquer(ratio) {
        return this.alpha(this.valpha + this.valpha * ratio);
      },
      rotate(degrees) {
        const hsl = this.hsl();
        let hue = hsl.color[0];
        hue = (hue + degrees) % 360;
        hue = hue < 0 ? 360 + hue : hue;
        hsl.color[0] = hue;
        return hsl;
      },
      mix(mixinColor, weight) {
        if (!mixinColor || !mixinColor.rgb) {
          throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
        }
        const color1 = mixinColor.rgb();
        const color2 = this.rgb();
        const p = weight === void 0 ? 0.5 : weight;
        const w5 = 2 * p - 1;
        const a = color1.alpha() - color2.alpha();
        const w12 = ((w5 * a === -1 ? w5 : (w5 + a) / (1 + w5 * a)) + 1) / 2;
        const w22 = 1 - w12;
        return Color.rgb(
          w12 * color1.red() + w22 * color2.red(),
          w12 * color1.green() + w22 * color2.green(),
          w12 * color1.blue() + w22 * color2.blue(),
          color1.alpha() * p + color2.alpha() * (1 - p)
        );
      }
    };
    for (const model of Object.keys(convert)) {
      if (skippedModels.includes(model)) {
        continue;
      }
      const { channels } = convert[model];
      Color.prototype[model] = function(...arguments_) {
        if (this.model === model) {
          return new Color(this);
        }
        if (arguments_.length > 0) {
          return new Color(arguments_, model);
        }
        return new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);
      };
      Color[model] = function(...arguments_) {
        let color = arguments_[0];
        if (typeof color === "number") {
          color = zeroArray(arguments_, channels);
        }
        return new Color(color, model);
      };
    }
    function roundTo(number, places) {
      return Number(number.toFixed(places));
    }
    function roundToPlace(places) {
      return function(number) {
        return roundTo(number, places);
      };
    }
    function getset(model, channel, modifier) {
      model = Array.isArray(model) ? model : [model];
      for (const m of model) {
        (limiters[m] ||= [])[channel] = modifier;
      }
      model = model[0];
      return function(value) {
        let result;
        if (value !== void 0) {
          if (modifier) {
            value = modifier(value);
          }
          result = this[model]();
          result.color[channel] = value;
          return result;
        }
        result = this[model]().color[channel];
        if (modifier) {
          result = modifier(result);
        }
        return result;
      };
    }
    function maxfn(max) {
      return function(v3) {
        return Math.max(0, Math.min(max, v3));
      };
    }
    function assertArray(value) {
      return Array.isArray(value) ? value : [value];
    }
    function zeroArray(array, length) {
      for (let i3 = 0; i3 < length; i3++) {
        if (typeof array[i3] !== "number") {
          array[i3] = 0;
        }
      }
      return array;
    }
    function getDefaultExportFromCjs(x3) {
      return x3 && x3.__esModule && Object.prototype.hasOwnProperty.call(x3, "default") ? x3["default"] : x3;
    }
    var textHex = function hex2(str) {
      for (var i3 = 0, hash = 0; i3 < str.length; hash = str.charCodeAt(i3++) + ((hash << 5) - hash)) ;
      var color = Math.floor(
        Math.abs(
          Math.sin(hash) * 1e4 % 1 * 16777216
        )
      ).toString(16);
      return "#" + Array(6 - color.length + 1).join("0") + color;
    };
    var hex = /* @__PURE__ */ getDefaultExportFromCjs(textHex);
    function colorspace(namespace, delimiter) {
      const split = namespace.split(delimiter || ":");
      let base = hex(split[0]);
      if (!split.length) return base;
      for (let i3 = 0, l3 = split.length - 1; i3 < l3; i3++) {
        base = Color(base).mix(Color(hex(split[i3 + 1]))).saturate(1).hex();
      }
      return base;
    }
    module2.exports = colorspace;
  }
});
var require_kuler = __commonJS2({
  "../../node_modules/.pnpm/kuler@2.0.0/node_modules/kuler/index.js"(exports$1, module2) {
    function Kuler(text, color) {
      if (color) return new Kuler(text).style(color);
      if (!(this instanceof Kuler)) return new Kuler(text);
      this.text = text;
    }
    Kuler.prototype.prefix = "\x1B[";
    Kuler.prototype.suffix = "m";
    Kuler.prototype.hex = function hex(color) {
      color = color[0] === "#" ? color.substring(1) : color;
      if (color.length === 3) {
        color = color.split("");
        color[5] = color[2];
        color[4] = color[2];
        color[3] = color[1];
        color[2] = color[1];
        color[1] = color[0];
        color = color.join("");
      }
      var r3 = color.substring(0, 2), g3 = color.substring(2, 4), b3 = color.substring(4, 6);
      return [parseInt(r3, 16), parseInt(g3, 16), parseInt(b3, 16)];
    };
    Kuler.prototype.rgb = function rgb(r3, g3, b3) {
      var red = r3 / 255 * 5, green = g3 / 255 * 5, blue = b3 / 255 * 5;
      return this.ansi(red, green, blue);
    };
    Kuler.prototype.ansi = function ansi(r3, g3, b3) {
      var red = Math.round(r3), green = Math.round(g3), blue = Math.round(b3);
      return 16 + red * 36 + green * 6 + blue;
    };
    Kuler.prototype.reset = function reset() {
      return this.prefix + "39;49" + this.suffix;
    };
    Kuler.prototype.style = function style(color) {
      return this.prefix + "38;5;" + this.rgb.apply(this, this.hex(color)) + this.suffix + this.text + this.reset();
    };
    module2.exports = Kuler;
  }
});
var require_namespace_ansi = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js"(exports$1, module2) {
    var colorspace = require_index_cjs();
    var kuler = require_kuler();
    module2.exports = function ansiModifier(args, options) {
      var namespace = options.namespace;
      var ansi = options.colors !== false ? kuler(namespace + ":", colorspace(namespace)) : namespace + ":";
      args[0] = ansi + " " + args[0];
      return args;
    };
  }
});
var require_enabled = __commonJS2({
  "../../node_modules/.pnpm/enabled@2.0.0/node_modules/enabled/index.js"(exports$1, module2) {
    module2.exports = function enabled(name, variable) {
      if (!variable) return false;
      var variables = variable.split(/[\s,]+/), i3 = 0;
      for (; i3 < variables.length; i3++) {
        variable = variables[i3].replace("*", ".*?");
        if ("-" === variable.charAt(0)) {
          if (new RegExp("^" + variable.substr(1) + "$").test(name)) {
            return false;
          }
          continue;
        }
        if (new RegExp("^" + variable + "$").test(name)) {
          return true;
        }
      }
      return false;
    };
  }
});
var require_adapters = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/adapters/index.js"(exports$1, module2) {
    var enabled = require_enabled();
    module2.exports = function create(fn) {
      return function adapter(namespace) {
        try {
          return enabled(namespace, fn());
        } catch (e3) {
        }
        return false;
      };
    };
  }
});
var require_process_env = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/adapters/process.env.js"(exports$1, module2) {
    var adapter = require_adapters();
    module2.exports = adapter(function processenv() {
      return process.env.DEBUG || process.env.DIAGNOSTICS;
    });
  }
});
var require_console2 = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/logger/console.js"(exports$1, module2) {
    module2.exports = function(meta, messages) {
      try {
        Function.prototype.apply.call(console.log, console, messages);
      } catch (e3) {
      }
    };
  }
});
var require_development = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/node/development.js"(exports$1, module2) {
    var create = require_diagnostics();
    var tty = __require("tty").isatty(1);
    var diagnostics = create(function dev(namespace, options) {
      options = options || {};
      options.colors = "colors" in options ? options.colors : tty;
      options.namespace = namespace;
      options.prod = false;
      options.dev = true;
      if (!dev.enabled(namespace) && !(options.force || dev.force)) {
        return dev.nope(options);
      }
      return dev.yep(options);
    });
    diagnostics.modify(require_namespace_ansi());
    diagnostics.use(require_process_env());
    diagnostics.set(require_console2());
    module2.exports = diagnostics;
  }
});
var require_node2 = __commonJS2({
  "../../node_modules/.pnpm/@dabh+diagnostics@2.0.8/node_modules/@dabh/diagnostics/node/index.js"(exports$1, module2) {
    if (process.env.NODE_ENV === "production") {
      module2.exports = require_production();
    } else {
      module2.exports = require_development();
    }
  }
});
var require_tail_file = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/tail-file.js"(exports$1, module2) {
    var fs2 = __require("fs");
    var { StringDecoder } = __require("string_decoder");
    var { Stream } = require_readable();
    function noop() {
    }
    module2.exports = (options, iter) => {
      const buffer = Buffer.alloc(64 * 1024);
      const decode = new StringDecoder("utf8");
      const stream = new Stream();
      let buff = "";
      let pos = 0;
      let row = 0;
      if (options.start === -1) {
        delete options.start;
      }
      stream.readable = true;
      stream.destroy = () => {
        stream.destroyed = true;
        stream.emit("end");
        stream.emit("close");
      };
      fs2.open(options.file, "a+", "0644", (err, fd) => {
        if (err) {
          if (!iter) {
            stream.emit("error", err);
          } else {
            iter(err);
          }
          stream.destroy();
          return;
        }
        (function read() {
          if (stream.destroyed) {
            fs2.close(fd, noop);
            return;
          }
          return fs2.read(fd, buffer, 0, buffer.length, pos, (error, bytes) => {
            if (error) {
              if (!iter) {
                stream.emit("error", error);
              } else {
                iter(error);
              }
              stream.destroy();
              return;
            }
            if (!bytes) {
              if (buff) {
                if (options.start == null || row > options.start) {
                  if (!iter) {
                    stream.emit("line", buff);
                  } else {
                    iter(null, buff);
                  }
                }
                row++;
                buff = "";
              }
              return setTimeout(read, 1e3);
            }
            let data = decode.write(buffer.slice(0, bytes));
            if (!iter) {
              stream.emit("data", data);
            }
            data = (buff + data).split(/\n+/);
            const l3 = data.length - 1;
            let i3 = 0;
            for (; i3 < l3; i3++) {
              if (options.start == null || row > options.start) {
                if (!iter) {
                  stream.emit("line", data[i3]);
                } else {
                  iter(null, data[i3]);
                }
              }
              row++;
            }
            buff = data[l3];
            pos += bytes;
            return read();
          });
        })();
      });
      if (!iter) {
        return stream;
      }
      return stream.destroy;
    };
  }
});
var require_file = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/file.js"(exports$1, module2) {
    var fs2 = __require("fs");
    var path2 = __require("path");
    var asyncSeries = require_series();
    var zlib = __require("zlib");
    var { MESSAGE } = require_triple_beam();
    var { Stream, PassThrough } = require_readable();
    var TransportStream = require_winston_transport();
    var debug = require_node2()("winston:file");
    var os2 = __require("os");
    var tailFile = require_tail_file();
    module2.exports = class File extends TransportStream {
      /**
       * Constructor function for the File transport object responsible for
       * persisting log messages and metadata to one or more files.
       * @param {Object} options - Options for this instance.
       */
      constructor(options = {}) {
        super(options);
        this.name = options.name || "file";
        function throwIf(target, ...args) {
          args.slice(1).forEach((name) => {
            if (options[name]) {
              throw new Error(`Cannot set ${name} and ${target} together`);
            }
          });
        }
        this._stream = new PassThrough();
        this._stream.setMaxListeners(30);
        this._onError = this._onError.bind(this);
        if (options.filename || options.dirname) {
          throwIf("filename or dirname", "stream");
          this._basename = this.filename = options.filename ? path2.basename(options.filename) : "winston.log";
          this.dirname = options.dirname || path2.dirname(options.filename);
          this.options = options.options || { flags: "a" };
        } else if (options.stream) {
          console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream");
          throwIf("stream", "filename", "maxsize");
          this._dest = this._stream.pipe(this._setupStream(options.stream));
          this.dirname = path2.dirname(this._dest.path);
        } else {
          throw new Error("Cannot log to file without filename or stream.");
        }
        this.maxsize = options.maxsize || null;
        this.rotationFormat = options.rotationFormat || false;
        this.zippedArchive = options.zippedArchive || false;
        this.maxFiles = options.maxFiles || null;
        this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
        this.tailable = options.tailable || false;
        this.lazy = options.lazy || false;
        this._size = 0;
        this._pendingSize = 0;
        this._created = 0;
        this._drain = false;
        this._opening = false;
        this._ending = false;
        this._fileExist = false;
        if (this.dirname) this._createLogDirIfNotExist(this.dirname);
        if (!this.lazy) this.open();
      }
      finishIfEnding() {
        if (this._ending) {
          if (this._opening) {
            this.once("open", () => {
              this._stream.once("finish", () => this.emit("finish"));
              setImmediate(() => this._stream.end());
            });
          } else {
            this._stream.once("finish", () => this.emit("finish"));
            setImmediate(() => this._stream.end());
          }
        }
      }
      /**
       * Called by Node.js Writable stream before emitting 'finish'.
       * Ensures all buffered data is flushed to the underlying file stream
       * before the transport signals completion.
       * @param {Function} callback - Callback to signal completion.
       * @private
       */
      _final(callback) {
        if (this._opening) {
          this.once("open", () => this._final(callback));
          return;
        }
        this._stream.end();
        if (!this._dest) {
          return callback();
        }
        if (this._dest.writableFinished) {
          return callback();
        }
        this._dest.once("finish", callback);
        this._dest.once("error", callback);
      }
      /**
       * 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}
       */
      log(info, callback = () => {
      }) {
        if (this.silent) {
          callback();
          return true;
        }
        if (this._drain) {
          this._stream.once("drain", () => {
            this._drain = false;
            this.log(info, callback);
          });
          return;
        }
        if (this._rotate) {
          this._stream.once("rotate", () => {
            this._rotate = false;
            this.log(info, callback);
          });
          return;
        }
        if (this.lazy) {
          if (!this._fileExist) {
            if (!this._opening) {
              this.open();
            }
            this.once("open", () => {
              this._fileExist = true;
              this.log(info, callback);
              return;
            });
            return;
          }
          if (this._needsNewFile(this._pendingSize)) {
            this._dest.once("close", () => {
              if (!this._opening) {
                this.open();
              }
              this.once("open", () => {
                this.log(info, callback);
                return;
              });
              return;
            });
            return;
          }
        }
        const output = `${info[MESSAGE]}${this.eol}`;
        const bytes = Buffer.byteLength(output);
        function logged() {
          this._size += bytes;
          this._pendingSize -= bytes;
          debug("logged %s %s", this._size, output);
          this.emit("logged", info);
          if (this._rotate) {
            return;
          }
          if (this._opening) {
            return;
          }
          if (!this._needsNewFile()) {
            return;
          }
          if (this.lazy) {
            this._endStream(() => {
              this.emit("fileclosed");
            });
            return;
          }
          this._rotate = true;
          this._endStream(() => this._rotateFile());
        }
        this._pendingSize += bytes;
        if (this._opening && !this.rotatedWhileOpening && this._needsNewFile(this._size + this._pendingSize)) {
          this.rotatedWhileOpening = true;
        }
        const written = this._stream.write(output, logged.bind(this));
        if (!written) {
          this._drain = true;
          this._stream.once("drain", () => {
            this._drain = false;
            callback();
          });
        } else {
          callback();
        }
        debug("written", written, this._drain);
        this.finishIfEnding();
        return written;
      }
      /**
       * 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.
       */
      query(options, callback) {
        if (typeof options === "function") {
          callback = options;
          options = {};
        }
        options = normalizeQuery(options);
        const file = path2.join(this.dirname, this.filename);
        let buff = "";
        let results = [];
        let row = 0;
        const stream = fs2.createReadStream(file, {
          encoding: "utf8"
        });
        stream.on("error", (err) => {
          if (stream.readable) {
            stream.destroy();
          }
          if (!callback) {
            return;
          }
          return err.code !== "ENOENT" ? callback(err) : callback(null, results);
        });
        stream.on("data", (data) => {
          data = (buff + data).split(/\n+/);
          const l3 = data.length - 1;
          let i3 = 0;
          for (; i3 < l3; i3++) {
            if (!options.start || row >= options.start) {
              add(data[i3]);
            }
            row++;
          }
          buff = data[l3];
        });
        stream.on("close", () => {
          if (buff) {
            add(buff, true);
          }
          if (options.order === "desc") {
            results = results.reverse();
          }
          if (callback) callback(null, results);
        });
        function add(buff2, attempt) {
          try {
            const log = JSON.parse(buff2);
            if (check(log)) {
              push(log);
            }
          } catch (e3) {
            if (!attempt) {
              stream.emit("error", e3);
            }
          }
        }
        function push(log) {
          if (options.rows && results.length >= options.rows && options.order !== "desc") {
            if (stream.readable) {
              stream.destroy();
            }
            return;
          }
          if (options.fields) {
            log = options.fields.reduce((obj, key) => {
              obj[key] = log[key];
              return obj;
            }, {});
          }
          if (options.order === "desc") {
            if (results.length >= options.rows) {
              results.shift();
            }
          }
          results.push(log);
        }
        function check(log) {
          if (!log) {
            return;
          }
          if (typeof log !== "object") {
            return;
          }
          const time = new Date(log.timestamp);
          if (options.from && time < options.from || options.until && time > options.until || options.level && options.level !== log.level) {
            return;
          }
          return true;
        }
        function normalizeQuery(options2) {
          options2 = options2 || {};
          options2.rows = options2.rows || options2.limit || 10;
          options2.start = options2.start || 0;
          options2.until = options2.until || /* @__PURE__ */ new Date();
          if (typeof options2.until !== "object") {
            options2.until = new Date(options2.until);
          }
          options2.from = options2.from || options2.until - 24 * 60 * 60 * 1e3;
          if (typeof options2.from !== "object") {
            options2.from = new Date(options2.from);
          }
          options2.order = options2.order || "desc";
          return options2;
        }
      }
      /**
       * 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.
       */
      stream(options = {}) {
        const file = path2.join(this.dirname, this.filename);
        const stream = new Stream();
        const tail = {
          file,
          start: options.start
        };
        stream.destroy = tailFile(tail, (err, line) => {
          if (err) {
            return stream.emit("error", err);
          }
          try {
            stream.emit("data", line);
            line = JSON.parse(line);
            stream.emit("log", line);
          } catch (e3) {
            stream.emit("error", e3);
          }
        });
        return stream;
      }
      /**
       * Checks to see the filesize of.
       * @returns {undefined}
       */
      open() {
        if (!this.filename) return;
        if (this._opening) return;
        this._opening = true;
        this.stat((err, size) => {
          if (err) {
            return this.emit("error", err);
          }
          debug("stat done: %s { size: %s }", this.filename, size);
          this._size = size;
          this._dest = this._createStream(this._stream);
          this._opening = false;
          this.once("open", () => {
            if (!this._stream.emit("rotate")) {
              this._rotate = false;
            }
          });
        });
      }
      /**
       * Stat the file and assess information in order to create the proper stream.
       * @param {function} callback - TODO: add param description.
       * @returns {undefined}
       */
      stat(callback) {
        const target = this._getFile();
        const fullpath = path2.join(this.dirname, target);
        fs2.stat(fullpath, (err, stat) => {
          if (err && err.code === "ENOENT") {
            debug("ENOENT\xA0ok", fullpath);
            this.filename = target;
            return callback(null, 0);
          }
          if (err) {
            debug(`err ${err.code} ${fullpath}`);
            return callback(err);
          }
          if (!stat || this._needsNewFile(stat.size)) {
            return this._incFile(() => this.stat(callback));
          }
          this.filename = target;
          callback(null, stat.size);
        });
      }
      /**
       * Closes the stream associated with this instance.
       * @param {function} cb - TODO: add param description.
       * @returns {undefined}
       */
      close(cb) {
        if (!this._stream) {
          return;
        }
        this._stream.end(() => {
          if (cb) {
            cb();
          }
          this.emit("flush");
          this.emit("closed");
        });
      }
      /**
       * TODO: add method description.
       * @param {number} size - TODO: add param description.
       * @returns {undefined}
       */
      _needsNewFile(size) {
        size = size || this._size;
        return this.maxsize && size >= this.maxsize;
      }
      /**
       * TODO: add method description.
       * @param {Error} err - TODO: add param description.
       * @returns {undefined}
       */
      _onError(err) {
        this.emit("error", err);
      }
      /**
       * TODO: add method description.
       * @param {Stream} stream - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
      _setupStream(stream) {
        stream.on("error", this._onError);
        return stream;
      }
      /**
       * TODO: add method description.
       * @param {Stream} stream - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
      _cleanupStream(stream) {
        stream.removeListener("error", this._onError);
        stream.destroy();
        return stream;
      }
      /**
       * TODO: add method description.
       */
      _rotateFile() {
        this._incFile(() => this.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
       */
      _endStream(callback = () => {
      }) {
        if (this._dest) {
          this._stream.unpipe(this._dest);
          this._dest.end(() => {
            this._cleanupStream(this._dest);
            callback();
          });
        } else {
          callback();
        }
      }
      /**
       * 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.
       */
      _createStream(source) {
        const fullpath = path2.join(this.dirname, this.filename);
        debug("create stream start", fullpath, this.options);
        const dest = fs2.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => {
          debug("file open ok", fullpath);
          this.emit("open", fullpath);
          source.pipe(dest);
          if (this.rotatedWhileOpening) {
            this._stream = new PassThrough();
            this._stream.setMaxListeners(30);
            this._rotateFile();
            this.rotatedWhileOpening = false;
            this._cleanupStream(dest);
            source.end();
          }
        });
        debug("create stream ok", fullpath);
        return dest;
      }
      /**
       * TODO: add method description.
       * @param {function} callback - TODO: add param description.
       * @returns {undefined}
       */
      _incFile(callback) {
        debug("_incFile", this.filename);
        const ext = path2.extname(this._basename);
        const basename = path2.basename(this._basename, ext);
        const tasks = [];
        if (this.zippedArchive) {
          tasks.push(
            function(cb) {
              const num = this._created > 0 && !this.tailable ? this._created : "";
              this._compressFile(
                path2.join(this.dirname, `${basename}${num}${ext}`),
                path2.join(this.dirname, `${basename}${num}${ext}.gz`),
                cb
              );
            }.bind(this)
          );
        }
        tasks.push(
          function(cb) {
            if (!this.tailable) {
              this._created += 1;
              this._checkMaxFilesIncrementing(ext, basename, cb);
            } else {
              this._checkMaxFilesTailable(ext, basename, cb);
            }
          }.bind(this)
        );
        asyncSeries(tasks, callback);
      }
      /**
       * 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
       */
      _getFile() {
        const ext = path2.extname(this._basename);
        const basename = path2.basename(this._basename, ext);
        const isRotation = this.rotationFormat ? this.rotationFormat() : this._created;
        return !this.tailable && this._created ? `${basename}${isRotation}${ext}` : `${basename}${ext}`;
      }
      /**
       * 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
       */
      _checkMaxFilesIncrementing(ext, basename, callback) {
        if (!this.maxFiles || this._created < this.maxFiles) {
          return setImmediate(callback);
        }
        const oldest = this._created - this.maxFiles;
        const isOldest = oldest !== 0 ? oldest : "";
        const isZipped = this.zippedArchive ? ".gz" : "";
        const filePath = `${basename}${isOldest}${ext}${isZipped}`;
        const target = path2.join(this.dirname, filePath);
        fs2.unlink(target, callback);
      }
      /**
       * 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
       */
      _checkMaxFilesTailable(ext, basename, callback) {
        const tasks = [];
        if (!this.maxFiles) {
          return;
        }
        const isZipped = this.zippedArchive ? ".gz" : "";
        for (let x3 = this.maxFiles - 1; x3 > 1; x3--) {
          tasks.push(function(i3, cb) {
            let fileName = `${basename}${i3 - 1}${ext}${isZipped}`;
            const tmppath = path2.join(this.dirname, fileName);
            fs2.exists(tmppath, (exists) => {
              if (!exists) {
                return cb(null);
              }
              fileName = `${basename}${i3}${ext}${isZipped}`;
              fs2.rename(tmppath, path2.join(this.dirname, fileName), cb);
            });
          }.bind(this, x3));
        }
        asyncSeries(tasks, () => {
          fs2.rename(
            path2.join(this.dirname, `${basename}${ext}${isZipped}`),
            path2.join(this.dirname, `${basename}1${ext}${isZipped}`),
            callback
          );
        });
      }
      /**
       * 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
       */
      _compressFile(src, dest, callback) {
        fs2.access(src, fs2.F_OK, (err) => {
          if (err) {
            return callback();
          }
          var gzip = zlib.createGzip();
          var inp = fs2.createReadStream(src);
          var out = fs2.createWriteStream(dest);
          out.on("finish", () => {
            fs2.unlink(src, callback);
          });
          inp.pipe(gzip).pipe(out);
        });
      }
      _createLogDirIfNotExist(dirPath) {
        if (!fs2.existsSync(dirPath)) {
          fs2.mkdirSync(dirPath, { recursive: true });
        }
      }
    };
  }
});
var require_http = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/http.js"(exports$1, module2) {
    var http = __require("http");
    var https = __require("https");
    var { Stream } = require_readable();
    var TransportStream = require_winston_transport();
    var { configure } = require_safe_stable_stringify();
    module2.exports = class Http extends TransportStream {
      /**
       * Constructor function for the Http transport object responsible for
       * persisting log messages and metadata to a terminal or TTY.
       * @param {!Object} [options={}] - Options for this instance.
       */
      // eslint-disable-next-line max-statements
      constructor(options = {}) {
        super(options);
        this.options = options;
        this.name = options.name || "http";
        this.ssl = !!options.ssl;
        this.host = options.host || "localhost";
        this.port = options.port;
        this.auth = options.auth;
        this.path = options.path || "";
        this.maximumDepth = options.maximumDepth;
        this.agent = options.agent;
        this.headers = options.headers || {};
        this.headers["content-type"] = "application/json";
        this.batch = options.batch || false;
        this.batchInterval = options.batchInterval || 5e3;
        this.batchCount = options.batchCount || 10;
        this.batchOptions = [];
        this.batchTimeoutID = -1;
        this.batchCallback = {};
        if (!this.port) {
          this.port = this.ssl ? 443 : 80;
        }
      }
      /**
       * Core logging method exposed to Winston.
       * @param {Object} info - TODO: add param description.
       * @param {function} callback - TODO: add param description.
       * @returns {undefined}
       */
      log(info, callback) {
        this._request(info, null, null, (err, res) => {
          if (res && res.statusCode !== 200) {
            err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
          }
          if (err) {
            this.emit("warn", err);
          } else {
            this.emit("logged", info);
          }
        });
        if (callback) {
          setImmediate(callback);
        }
      }
      /**
       * 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}
       */
      query(options, callback) {
        if (typeof options === "function") {
          callback = options;
          options = {};
        }
        options = {
          method: "query",
          params: this.normalizeQuery(options)
        };
        const auth = options.params.auth || null;
        delete options.params.auth;
        const path2 = options.params.path || null;
        delete options.params.path;
        this._request(options, auth, path2, (err, res, body) => {
          if (res && res.statusCode !== 200) {
            err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
          }
          if (err) {
            return callback(err);
          }
          if (typeof body === "string") {
            try {
              body = JSON.parse(body);
            } catch (e3) {
              return callback(e3);
            }
          }
          callback(null, body);
        });
      }
      /**
       * 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
       */
      stream(options = {}) {
        const stream = new Stream();
        options = {
          method: "stream",
          params: options
        };
        const path2 = options.params.path || null;
        delete options.params.path;
        const auth = options.params.auth || null;
        delete options.params.auth;
        let buff = "";
        const req = this._request(options, auth, path2);
        stream.destroy = () => req.destroy();
        req.on("data", (data) => {
          data = (buff + data).split(/\n+/);
          const l3 = data.length - 1;
          let i3 = 0;
          for (; i3 < l3; i3++) {
            try {
              stream.emit("log", JSON.parse(data[i3]));
            } catch (e3) {
              stream.emit("error", e3);
            }
          }
          buff = data[l3];
        });
        req.on("error", (err) => stream.emit("error", err));
        return stream;
      }
      /**
       * 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.
       */
      _request(options, auth, path2, callback) {
        options = options || {};
        auth = auth || this.auth;
        path2 = path2 || this.path || "";
        if (this.batch) {
          this._doBatch(options, callback, auth, path2);
        } else {
          this._doRequest(options, callback, auth, path2);
        }
      }
      /**
       * 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
       */
      _doBatch(options, callback, auth, path2) {
        this.batchOptions.push(options);
        if (this.batchOptions.length === 1) {
          const me = this;
          this.batchCallback = callback;
          this.batchTimeoutID = setTimeout(function() {
            me.batchTimeoutID = -1;
            me._doBatchRequest(me.batchCallback, auth, path2);
          }, this.batchInterval);
        }
        if (this.batchOptions.length === this.batchCount) {
          this._doBatchRequest(this.batchCallback, auth, path2);
        }
      }
      /**
       * 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
       */
      _doBatchRequest(callback, auth, path2) {
        if (this.batchTimeoutID > 0) {
          clearTimeout(this.batchTimeoutID);
          this.batchTimeoutID = -1;
        }
        const batchOptionsCopy = this.batchOptions.slice();
        this.batchOptions = [];
        this._doRequest(batchOptionsCopy, callback, auth, path2);
      }
      /**
       * 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
       */
      _doRequest(options, callback, auth, path2) {
        const headers = Object.assign({}, this.headers);
        if (auth && auth.bearer) {
          headers.Authorization = `Bearer ${auth.bearer}`;
        }
        const req = (this.ssl ? https : http).request({
          ...this.options,
          method: "POST",
          host: this.host,
          port: this.port,
          path: `/${path2.replace(/^\//, "")}`,
          headers,
          auth: auth && auth.username && auth.password ? `${auth.username}:${auth.password}` : "",
          agent: this.agent
        });
        req.on("error", callback);
        req.on("response", (res) => res.on("end", () => callback(null, res)).resume());
        const jsonStringify = configure({
          ...this.maximumDepth && { maximumDepth: this.maximumDepth }
        });
        req.end(Buffer.from(jsonStringify(options, this.options.replacer), "utf8"));
      }
    };
  }
});
var require_is_stream = __commonJS2({
  "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports$1, module2) {
    var isStream = (stream) => stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
    isStream.writable = (stream) => isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
    isStream.readable = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
    isStream.duplex = (stream) => isStream.writable(stream) && isStream.readable(stream);
    isStream.transform = (stream) => isStream.duplex(stream) && typeof stream._transform === "function";
    module2.exports = isStream;
  }
});
var require_stream22 = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/stream.js"(exports$1, module2) {
    var isStream = require_is_stream();
    var { MESSAGE } = require_triple_beam();
    var os2 = __require("os");
    var TransportStream = require_winston_transport();
    module2.exports = class Stream extends TransportStream {
      /**
       * Constructor function for the Console transport object responsible for
       * persisting log messages and metadata to a terminal or TTY.
       * @param {!Object} [options={}] - Options for this instance.
       */
      constructor(options = {}) {
        super(options);
        if (!options.stream || !isStream(options.stream)) {
          throw new Error("options.stream is required.");
        }
        this._stream = options.stream;
        this._stream.setMaxListeners(Infinity);
        this.isObjectMode = options.stream._writableState.objectMode;
        this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
      }
      /**
       * Core logging method exposed to Winston.
       * @param {Object} info - TODO: add param description.
       * @param {Function} callback - TODO: add param description.
       * @returns {undefined}
       */
      log(info, callback) {
        setImmediate(() => this.emit("logged", info));
        if (this.isObjectMode) {
          this._stream.write(info);
          if (callback) {
            callback();
          }
          return;
        }
        this._stream.write(`${info[MESSAGE]}${this.eol}`);
        if (callback) {
          callback();
        }
        return;
      }
    };
  }
});
var require_transports = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/index.js"(exports$1) {
    Object.defineProperty(exports$1, "Console", {
      configurable: true,
      enumerable: true,
      get() {
        return require_console();
      }
    });
    Object.defineProperty(exports$1, "File", {
      configurable: true,
      enumerable: true,
      get() {
        return require_file();
      }
    });
    Object.defineProperty(exports$1, "Http", {
      configurable: true,
      enumerable: true,
      get() {
        return require_http();
      }
    });
    Object.defineProperty(exports$1, "Stream", {
      configurable: true,
      enumerable: true,
      get() {
        return require_stream22();
      }
    });
  }
});
var require_config22 = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/config/index.js"(exports$1) {
    var logform = require_logform();
    var { configs } = require_triple_beam();
    exports$1.cli = logform.levels(configs.cli);
    exports$1.npm = logform.levels(configs.npm);
    exports$1.syslog = logform.levels(configs.syslog);
    exports$1.addColors = logform.levels;
  }
});
var require_eachOf = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/eachOf.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _isArrayLike = require_isArrayLike2();
    var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
    var _breakLoop = require_breakLoop();
    var _breakLoop2 = _interopRequireDefault(_breakLoop);
    var _eachOfLimit = require_eachOfLimit2();
    var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
    var _once = require_once();
    var _once2 = _interopRequireDefault(_once);
    var _onlyOnce = require_onlyOnce();
    var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
    var _wrapAsync = require_wrapAsync();
    var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
    var _awaitify = require_awaitify();
    var _awaitify2 = _interopRequireDefault(_awaitify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function eachOfArrayLike(coll, iteratee, callback) {
      callback = (0, _once2.default)(callback);
      var index = 0, completed = 0, { length } = coll, canceled = false;
      if (length === 0) {
        callback(null);
      }
      function iteratorCallback(err, value) {
        if (err === false) {
          canceled = true;
        }
        if (canceled === true) return;
        if (err) {
          callback(err);
        } else if (++completed === length || value === _breakLoop2.default) {
          callback(null);
        }
      }
      for (; index < length; index++) {
        iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
      }
    }
    function eachOfGeneric(coll, iteratee, callback) {
      return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback);
    }
    function eachOf(coll, iteratee, callback) {
      var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
      return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
    }
    exports$1.default = (0, _awaitify2.default)(eachOf, 3);
    module2.exports = exports$1.default;
  }
});
var require_withoutIndex = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/internal/withoutIndex.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    exports$1.default = _withoutIndex;
    function _withoutIndex(iteratee) {
      return (value, index, callback) => iteratee(value, callback);
    }
    module2.exports = exports$1.default;
  }
});
var require_forEach = __commonJS2({
  "../../node_modules/.pnpm/async@3.2.6/node_modules/async/forEach.js"(exports$1, module2) {
    Object.defineProperty(exports$1, "__esModule", {
      value: true
    });
    var _eachOf = require_eachOf();
    var _eachOf2 = _interopRequireDefault(_eachOf);
    var _withoutIndex = require_withoutIndex();
    var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
    var _wrapAsync = require_wrapAsync();
    var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
    var _awaitify = require_awaitify();
    var _awaitify2 = _interopRequireDefault(_awaitify);
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function eachLimit(coll, iteratee, callback) {
      return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
    }
    exports$1.default = (0, _awaitify2.default)(eachLimit, 3);
    module2.exports = exports$1.default;
  }
});
var require_fn = __commonJS2({
  "../../node_modules/.pnpm/fn.name@1.1.0/node_modules/fn.name/index.js"(exports$1, module2) {
    var toString = Object.prototype.toString;
    module2.exports = function name(fn) {
      if ("string" === typeof fn.displayName && fn.constructor.name) {
        return fn.displayName;
      } else if ("string" === typeof fn.name && fn.name) {
        return fn.name;
      }
      if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) return fn.constructor.name;
      var named = fn.toString(), type = toString.call(fn).slice(8, -1);
      if ("Function" === type) {
        named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
      } else {
        named = type;
      }
      return named || "anonymous";
    };
  }
});
var require_one_time = __commonJS2({
  "../../node_modules/.pnpm/one-time@1.0.0/node_modules/one-time/index.js"(exports$1, module2) {
    var name = require_fn();
    module2.exports = function one(fn) {
      var called = 0, value;
      function onetime() {
        if (called) return value;
        called = 1;
        value = fn.apply(this, arguments);
        fn = null;
        return value;
      }
      onetime.displayName = name(fn);
      return onetime;
    };
  }
});
var require_stack_trace = __commonJS2({
  "../../node_modules/.pnpm/stack-trace@0.0.10/node_modules/stack-trace/lib/stack-trace.js"(exports$1) {
    exports$1.get = function(belowFn) {
      var oldLimit = Error.stackTraceLimit;
      Error.stackTraceLimit = Infinity;
      var dummyObject = {};
      var v8Handler = Error.prepareStackTrace;
      Error.prepareStackTrace = function(dummyObject2, v8StackTrace2) {
        return v8StackTrace2;
      };
      Error.captureStackTrace(dummyObject, belowFn || exports$1.get);
      var v8StackTrace = dummyObject.stack;
      Error.prepareStackTrace = v8Handler;
      Error.stackTraceLimit = oldLimit;
      return v8StackTrace;
    };
    exports$1.parse = function(err) {
      if (!err.stack) {
        return [];
      }
      var self2 = this;
      var lines = err.stack.split("\n").slice(1);
      return lines.map(function(line) {
        if (line.match(/^\s*[-]{4,}$/)) {
          return self2._createParsedCallSite({
            fileName: line,
            lineNumber: null,
            functionName: null,
            typeName: null,
            methodName: null,
            columnNumber: null,
            "native": null
          });
        }
        var lineMatch = line.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);
        if (!lineMatch) {
          return;
        }
        var object = null;
        var method = null;
        var functionName = null;
        var typeName = null;
        var methodName = null;
        var isNative = lineMatch[5] === "native";
        if (lineMatch[1]) {
          functionName = lineMatch[1];
          var methodStart = functionName.lastIndexOf(".");
          if (functionName[methodStart - 1] == ".")
            methodStart--;
          if (methodStart > 0) {
            object = functionName.substr(0, methodStart);
            method = functionName.substr(methodStart + 1);
            var objectEnd = object.indexOf(".Module");
            if (objectEnd > 0) {
              functionName = functionName.substr(objectEnd + 1);
              object = object.substr(0, objectEnd);
            }
          }
          typeName = null;
        }
        if (method) {
          typeName = object;
          methodName = method;
        }
        if (method === "<anonymous>") {
          methodName = null;
          functionName = null;
        }
        var properties = {
          fileName: lineMatch[2] || null,
          lineNumber: parseInt(lineMatch[3], 10) || null,
          functionName,
          typeName,
          methodName,
          columnNumber: parseInt(lineMatch[4], 10) || null,
          "native": isNative
        };
        return self2._createParsedCallSite(properties);
      }).filter(function(callSite) {
        return !!callSite;
      });
    };
    function CallSite(properties) {
      for (var property in properties) {
        this[property] = properties[property];
      }
    }
    var strProperties = [
      "this",
      "typeName",
      "functionName",
      "methodName",
      "fileName",
      "lineNumber",
      "columnNumber",
      "function",
      "evalOrigin"
    ];
    var boolProperties = [
      "topLevel",
      "eval",
      "native",
      "constructor"
    ];
    strProperties.forEach(function(property) {
      CallSite.prototype[property] = null;
      CallSite.prototype["get" + property[0].toUpperCase() + property.substr(1)] = function() {
        return this[property];
      };
    });
    boolProperties.forEach(function(property) {
      CallSite.prototype[property] = false;
      CallSite.prototype["is" + property[0].toUpperCase() + property.substr(1)] = function() {
        return this[property];
      };
    });
    exports$1._createParsedCallSite = function(properties) {
      return new CallSite(properties);
    };
  }
});
var require_exception_stream = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/exception-stream.js"(exports$1, module2) {
    var { Writable } = require_readable();
    module2.exports = class ExceptionStream extends Writable {
      /**
       * Constructor function for the ExceptionStream responsible for wrapping a
       * TransportStream; only allowing writes of `info` objects with
       * `info.exception` set to true.
       * @param {!TransportStream} transport - Stream to filter to exceptions
       */
      constructor(transport) {
        super({ objectMode: true });
        if (!transport) {
          throw new Error("ExceptionStream requires a TransportStream instance.");
        }
        this.handleExceptions = true;
        this.transport = transport;
      }
      /**
       * Writes the info object to our transport instance if (and only if) the
       * `exception` property is set on the info.
       * @param {mixed} info - TODO: add param description.
       * @param {mixed} enc - TODO: add param description.
       * @param {mixed} callback - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       * @private
       */
      _write(info, enc, callback) {
        if (info.exception) {
          return this.transport.log(info, callback);
        }
        callback();
        return true;
      }
    };
  }
});
var require_exception_handler = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/exception-handler.js"(exports$1, module2) {
    var os2 = __require("os");
    var asyncForEach = require_forEach();
    var debug = require_node2()("winston:exception");
    var once = require_one_time();
    var stackTrace = require_stack_trace();
    var ExceptionStream = require_exception_stream();
    module2.exports = class ExceptionHandler {
      /**
       * TODO: add contructor description
       * @param {!Logger} logger - TODO: add param description
       */
      constructor(logger18) {
        if (!logger18) {
          throw new Error("Logger is required to handle exceptions");
        }
        this.logger = logger18;
        this.handlers = /* @__PURE__ */ new Map();
      }
      /**
       * Handles `uncaughtException` events for the current process by adding any
       * handlers passed in.
       * @returns {undefined}
       */
      handle(...args) {
        args.forEach((arg) => {
          if (Array.isArray(arg)) {
            return arg.forEach((handler) => this._addHandler(handler));
          }
          this._addHandler(arg);
        });
        if (!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}
       */
      unhandle() {
        if (this.catcher) {
          process.removeListener("uncaughtException", this.catcher);
          this.catcher = false;
          Array.from(this.handlers.values()).forEach((wrapper) => this.logger.unpipe(wrapper));
        }
      }
      /**
       * TODO: add method description
       * @param {Error} err - Error to get information about.
       * @returns {mixed} - TODO: add return description.
       */
      getAllInfo(err) {
        let message = null;
        if (err) {
          message = typeof err === "string" ? err : err.message;
        }
        return {
          error: err,
          // TODO (indexzero): how do we configure this?
          level: "error",
          message: [
            `uncaughtException: ${message || "(no error message)"}`,
            err && err.stack || "  No stack trace"
          ].join("\n"),
          stack: err && err.stack,
          exception: true,
          date: (/* @__PURE__ */ new Date()).toString(),
          process: this.getProcessInfo(),
          os: this.getOsInfo(),
          trace: this.getTrace(err)
        };
      }
      /**
       * Gets all relevant process information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
      getProcessInfo() {
        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.
       */
      getOsInfo() {
        return {
          loadavg: os2.loadavg(),
          uptime: os2.uptime()
        };
      }
      /**
       * Gets a stack trace for the specified error.
       * @param {mixed} err - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
      getTrace(err) {
        const trace = err ? stackTrace.parse(err) : stackTrace.get();
        return trace.map((site) => {
          return {
            column: site.getColumnNumber(),
            file: site.getFileName(),
            function: site.getFunctionName(),
            line: site.getLineNumber(),
            method: site.getMethodName(),
            native: site.isNative()
          };
        });
      }
      /**
       * Helper method to add a transport as an exception handler.
       * @param {Transport} handler - The transport to add as an exception handler.
       * @returns {void}
       */
      _addHandler(handler) {
        if (!this.handlers.has(handler)) {
          handler.handleExceptions = true;
          const wrapper = new ExceptionStream(handler);
          this.handlers.set(handler, wrapper);
          this.logger.pipe(wrapper);
        }
      }
      /**
       * 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
       */
      _uncaughtException(err) {
        const info = this.getAllInfo(err);
        const handlers = this._getExceptionHandlers();
        let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError;
        let timeout;
        if (!handlers.length && doExit) {
          console.warn("winston: exitOnError cannot be true with no exception handlers.");
          console.warn("winston: not exiting process.");
          doExit = false;
        }
        function gracefulExit() {
          debug("doExit", doExit);
          debug("process._exiting", process._exiting);
          if (doExit && !process._exiting) {
            if (timeout) {
              clearTimeout(timeout);
            }
            process.exit(1);
          }
        }
        if (!handlers || handlers.length === 0) {
          return process.nextTick(gracefulExit);
        }
        asyncForEach(handlers, (handler, next) => {
          const done = once(next);
          const transport = handler.transport || handler;
          function onDone(event) {
            return () => {
              debug(event);
              done();
            };
          }
          transport._ending = true;
          transport.once("finish", onDone("finished"));
          transport.once("error", onDone("error"));
        }, () => doExit && gracefulExit());
        this.logger.log(info);
        if (doExit) {
          timeout = setTimeout(gracefulExit, 3e3);
        }
      }
      /**
       * Returns the list of transports and exceptionHandlers for this instance.
       * @returns {Array} - List of transports and exceptionHandlers for this
       * instance.
       * @private
       */
      _getExceptionHandlers() {
        return this.logger.transports.filter((wrap) => {
          const transport = wrap.transport || wrap;
          return transport.handleExceptions;
        });
      }
    };
  }
});
var require_rejection_stream = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/rejection-stream.js"(exports$1, module2) {
    var { Writable } = require_readable();
    module2.exports = class RejectionStream extends Writable {
      /**
       * Constructor function for the RejectionStream responsible for wrapping a
       * TransportStream; only allowing writes of `info` objects with
       * `info.rejection` set to true.
       * @param {!TransportStream} transport - Stream to filter to rejections
       */
      constructor(transport) {
        super({ objectMode: true });
        if (!transport) {
          throw new Error("RejectionStream requires a TransportStream instance.");
        }
        this.handleRejections = true;
        this.transport = transport;
      }
      /**
       * Writes the info object to our transport instance if (and only if) the
       * `rejection` property is set on the info.
       * @param {mixed} info - TODO: add param description.
       * @param {mixed} enc - TODO: add param description.
       * @param {mixed} callback - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       * @private
       */
      _write(info, enc, callback) {
        if (info.rejection) {
          return this.transport.log(info, callback);
        }
        callback();
        return true;
      }
    };
  }
});
var require_rejection_handler = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/rejection-handler.js"(exports$1, module2) {
    var os2 = __require("os");
    var asyncForEach = require_forEach();
    var debug = require_node2()("winston:rejection");
    var once = require_one_time();
    var stackTrace = require_stack_trace();
    var RejectionStream = require_rejection_stream();
    module2.exports = class RejectionHandler {
      /**
       * TODO: add contructor description
       * @param {!Logger} logger - TODO: add param description
       */
      constructor(logger18) {
        if (!logger18) {
          throw new Error("Logger is required to handle rejections");
        }
        this.logger = logger18;
        this.handlers = /* @__PURE__ */ new Map();
      }
      /**
       * Handles `unhandledRejection` events for the current process by adding any
       * handlers passed in.
       * @returns {undefined}
       */
      handle(...args) {
        args.forEach((arg) => {
          if (Array.isArray(arg)) {
            return arg.forEach((handler) => this._addHandler(handler));
          }
          this._addHandler(arg);
        });
        if (!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}
       */
      unhandle() {
        if (this.catcher) {
          process.removeListener("unhandledRejection", this.catcher);
          this.catcher = false;
          Array.from(this.handlers.values()).forEach(
            (wrapper) => this.logger.unpipe(wrapper)
          );
        }
      }
      /**
       * TODO: add method description
       * @param {Error} err - Error to get information about.
       * @returns {mixed} - TODO: add return description.
       */
      getAllInfo(err) {
        let message = null;
        if (err) {
          message = typeof err === "string" ? err : err.message;
        }
        return {
          error: err,
          // TODO (indexzero): how do we configure this?
          level: "error",
          message: [
            `unhandledRejection: ${message || "(no error message)"}`,
            err && err.stack || "  No stack trace"
          ].join("\n"),
          stack: err && err.stack,
          rejection: true,
          date: (/* @__PURE__ */ new Date()).toString(),
          process: this.getProcessInfo(),
          os: this.getOsInfo(),
          trace: this.getTrace(err)
        };
      }
      /**
       * Gets all relevant process information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
      getProcessInfo() {
        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.
       */
      getOsInfo() {
        return {
          loadavg: os2.loadavg(),
          uptime: os2.uptime()
        };
      }
      /**
       * Gets a stack trace for the specified error.
       * @param {mixed} err - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
      getTrace(err) {
        const trace = err ? stackTrace.parse(err) : stackTrace.get();
        return trace.map((site) => {
          return {
            column: site.getColumnNumber(),
            file: site.getFileName(),
            function: site.getFunctionName(),
            line: site.getLineNumber(),
            method: site.getMethodName(),
            native: site.isNative()
          };
        });
      }
      /**
       * Helper method to add a transport as an exception handler.
       * @param {Transport} handler - The transport to add as an exception handler.
       * @returns {void}
       */
      _addHandler(handler) {
        if (!this.handlers.has(handler)) {
          handler.handleRejections = true;
          const wrapper = new RejectionStream(handler);
          this.handlers.set(handler, wrapper);
          this.logger.pipe(wrapper);
        }
      }
      /**
       * 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
       */
      _unhandledRejection(err) {
        const info = this.getAllInfo(err);
        const handlers = this._getRejectionHandlers();
        let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError;
        let timeout;
        if (!handlers.length && doExit) {
          console.warn("winston: exitOnError cannot be true with no rejection handlers.");
          console.warn("winston: not exiting process.");
          doExit = false;
        }
        function gracefulExit() {
          debug("doExit", doExit);
          debug("process._exiting", process._exiting);
          if (doExit && !process._exiting) {
            if (timeout) {
              clearTimeout(timeout);
            }
            process.exit(1);
          }
        }
        if (!handlers || handlers.length === 0) {
          return process.nextTick(gracefulExit);
        }
        asyncForEach(
          handlers,
          (handler, next) => {
            const done = once(next);
            const transport = handler.transport || handler;
            function onDone(event) {
              return () => {
                debug(event);
                done();
              };
            }
            transport._ending = true;
            transport.once("finish", onDone("finished"));
            transport.once("error", onDone("error"));
          },
          () => doExit && gracefulExit()
        );
        this.logger.log(info);
        if (doExit) {
          timeout = setTimeout(gracefulExit, 3e3);
        }
      }
      /**
       * Returns the list of transports and exceptionHandlers for this instance.
       * @returns {Array} - List of transports and exceptionHandlers for this
       * instance.
       * @private
       */
      _getRejectionHandlers() {
        return this.logger.transports.filter((wrap) => {
          const transport = wrap.transport || wrap;
          return transport.handleRejections;
        });
      }
    };
  }
});
var require_profiler = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/profiler.js"(exports$1, module2) {
    var Profiler = class {
      /**
       * Constructor function for the Profiler instance used by
       * `Logger.prototype.startTimer`. When done is called the timer will finish
       * and log the duration.
       * @param {!Logger} logger - TODO: add param description.
       * @private
       */
      constructor(logger18) {
        const Logger = require_logger();
        if (typeof logger18 !== "object" || Array.isArray(logger18) || !(logger18 instanceof Logger)) {
          throw new Error("Logger is required for profiling");
        } else {
          this.logger = logger18;
          this.start = Date.now();
        }
      }
      /**
       * Ends the current timer (i.e. Profiler) instance and logs the `msg` along
       * with the duration since creation.
       * @returns {mixed} - TODO: add return description.
       * @private
       */
      done(...args) {
        if (typeof args[args.length - 1] === "function") {
          console.warn("Callback function no longer supported as of winston@3.0.0");
          args.pop();
        }
        const info = typeof args[args.length - 1] === "object" ? args.pop() : {};
        info.level = info.level || "info";
        info.durationMs = Date.now() - this.start;
        return this.logger.write(info);
      }
    };
    module2.exports = Profiler;
  }
});
var require_logger = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/logger.js"(exports$1, module2) {
    var { Stream, Transform } = require_readable();
    var asyncForEach = require_forEach();
    var { LEVEL, SPLAT } = require_triple_beam();
    var isStream = require_is_stream();
    var ExceptionHandler = require_exception_handler();
    var RejectionHandler = require_rejection_handler();
    var LegacyTransportStream = require_legacy();
    var Profiler = require_profiler();
    var { warn } = require_common();
    var config = require_config22();
    var formatRegExp = /%[scdjifoO%]/g;
    var Logger = class extends Transform {
      /**
       * Constructor function for the Logger object responsible for persisting log
       * messages and metadata to one or more transports.
       * @param {!Object} options - foo
       */
      constructor(options) {
        super({ objectMode: true });
        this.configure(options);
      }
      child(defaultRequestMetadata) {
        const logger18 = this;
        return Object.create(logger18, {
          write: {
            value: function(info) {
              const infoClone = Object.assign(
                {},
                defaultRequestMetadata,
                info
              );
              if (info instanceof Error) {
                infoClone.stack = info.stack;
                infoClone.message = info.message;
                infoClone.cause = info.cause;
              }
              logger18.write(infoClone);
            }
          }
        });
      }
      /**
       * 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}
       */
      configure({
        silent,
        format: format2,
        defaultMeta,
        levels,
        level = "info",
        exitOnError = true,
        transports,
        colors,
        emitErrs,
        formatters,
        padLevels,
        rewriters,
        stripColors,
        exceptionHandlers,
        rejectionHandlers
      } = {}) {
        if (this.transports.length) {
          this.clear();
        }
        this.silent = silent;
        this.format = format2 || this.format || require_json()();
        this.defaultMeta = defaultMeta || null;
        this.levels = levels || this.levels || config.npm.levels;
        this.level = level;
        if (this.exceptions) {
          this.exceptions.unhandle();
        }
        if (this.rejections) {
          this.rejections.unhandle();
        }
        this.exceptions = new ExceptionHandler(this);
        this.rejections = new RejectionHandler(this);
        this.profilers = {};
        this.exitOnError = exitOnError;
        if (transports) {
          transports = Array.isArray(transports) ? transports : [transports];
          transports.forEach((transport) => this.add(transport));
        }
        if (colors || emitErrs || formatters || padLevels || rewriters || stripColors) {
          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("\n")
          );
        }
        if (exceptionHandlers) {
          this.exceptions.handle(exceptionHandlers);
        }
        if (rejectionHandlers) {
          this.rejections.handle(rejectionHandlers);
        }
      }
      /* 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
       */
      getHighestLogLevel() {
        const configuredLevelValue = getLevelValue(this.levels, this.level);
        if (!this.transports || this.transports.length === 0) {
          return configuredLevelValue;
        }
        return this.transports.reduce((max, transport) => {
          const levelValue = getLevelValue(this.levels, transport.level);
          return levelValue !== null && levelValue > max ? levelValue : max;
        }, configuredLevelValue);
      }
      isLevelEnabled(level) {
        const givenLevelValue = getLevelValue(this.levels, level);
        if (givenLevelValue === null) {
          return false;
        }
        const configuredLevelValue = getLevelValue(this.levels, this.level);
        if (configuredLevelValue === null) {
          return false;
        }
        if (!this.transports || this.transports.length === 0) {
          return configuredLevelValue >= givenLevelValue;
        }
        const index = this.transports.findIndex((transport) => {
          let transportLevelValue = getLevelValue(this.levels, transport.level);
          if (transportLevelValue === null) {
            transportLevelValue = configuredLevelValue;
          }
          return transportLevelValue >= givenLevelValue;
        });
        return index !== -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 */
      log(level, msg, ...splat) {
        if (arguments.length === 1) {
          level[LEVEL] = level.level;
          this._addDefaultMeta(level);
          this.write(level);
          return this;
        }
        if (arguments.length === 2) {
          if (msg && typeof msg === "object") {
            msg[LEVEL] = msg.level = level;
            this._addDefaultMeta(msg);
            this.write(msg);
            return this;
          }
          msg = { [LEVEL]: level, level, message: msg };
          this._addDefaultMeta(msg);
          this.write(msg);
          return this;
        }
        const [meta] = splat;
        if (typeof meta === "object" && meta !== null) {
          const tokens = msg && msg.match && msg.match(formatRegExp);
          if (!tokens) {
            const info = Object.assign({}, this.defaultMeta, meta, {
              [LEVEL]: level,
              [SPLAT]: splat,
              level,
              message: msg
            });
            if (meta.message) info.message = `${info.message} ${meta.message}`;
            if (meta.stack) info.stack = meta.stack;
            if (meta.cause) info.cause = meta.cause;
            this.write(info);
            return this;
          }
        }
        this.write(Object.assign({}, this.defaultMeta, {
          [LEVEL]: level,
          [SPLAT]: splat,
          level,
          message: msg
        }));
        return 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
       */
      _transform(info, enc, callback) {
        if (this.silent) {
          return callback();
        }
        if (!info[LEVEL]) {
          info[LEVEL] = info.level;
        }
        if (!this.levels[info[LEVEL]] && this.levels[info[LEVEL]] !== 0) {
          console.error("[winston] Unknown logger level: %s", info[LEVEL]);
        }
        if (!this._readableState.pipes) {
          console.error(
            "[winston] Attempt to write logs with no transports, which can increase memory usage: %j",
            info
          );
        }
        try {
          this.push(this.format.transform(info, this.format.options));
        } finally {
          this._writableState.sync = false;
          callback();
        }
      }
      /**
       * Delays the 'finish' event until all transport pipe targets have
       * also emitted 'finish' or are already finished.
       * @param {mixed} callback - Continues stream processing.
       */
      _final(callback) {
        const transports = this.transports.slice();
        asyncForEach(
          transports,
          (transport, next) => {
            if (!transport || transport.finished) return setImmediate(next);
            transport.once("finish", next);
            transport.end();
          },
          callback
        );
      }
      /**
       * Adds the transport to this logger instance by piping to it.
       * @param {mixed} transport - TODO: add param description.
       * @returns {Logger} - TODO: add return description.
       */
      add(transport) {
        const target = !isStream(transport) || transport.log.length > 2 ? new LegacyTransportStream({ transport }) : transport;
        if (!target._writableState || !target._writableState.objectMode) {
          throw new Error(
            "Transports must WritableStreams in objectMode. Set { objectMode: true }."
          );
        }
        this._onEvent("error", target);
        this._onEvent("warn", target);
        this.pipe(target);
        if (transport.handleExceptions) {
          this.exceptions.handle();
        }
        if (transport.handleRejections) {
          this.rejections.handle();
        }
        return 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.
       */
      remove(transport) {
        if (!transport) return this;
        let target = transport;
        if (!isStream(transport) || transport.log.length > 2) {
          target = this.transports.filter(
            (match) => match.transport === transport
          )[0];
        }
        if (target) {
          this.unpipe(target);
        }
        return this;
      }
      /**
       * Removes all transports from this logger instance.
       * @returns {Logger} - TODO: add return description.
       */
      clear() {
        this.unpipe();
        return this;
      }
      /**
       * Cleans up resources (streams, event listeners) for all transports
       * associated with this instance (if necessary).
       * @returns {Logger} - TODO: add return description.
       */
      close() {
        this.exceptions.unhandle();
        this.rejections.unhandle();
        this.clear();
        this.emit("close");
        return this;
      }
      /**
       * Sets the `target` levels specified on this instance.
       * @param {Object} Target levels to use on this instance.
       */
      setLevels() {
        warn.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.
       */
      query(options, callback) {
        if (typeof options === "function") {
          callback = options;
          options = {};
        }
        options = options || {};
        const results = {};
        const queryObject = Object.assign({}, options.query || {});
        function queryTransport(transport, next) {
          if (options.query && typeof transport.formatQuery === "function") {
            options.query = transport.formatQuery(queryObject);
          }
          transport.query(options, (err, res) => {
            if (err) {
              return next(err);
            }
            if (typeof transport.formatResults === "function") {
              res = transport.formatResults(res, options.format);
            }
            next(null, res);
          });
        }
        function addResults(transport, next) {
          queryTransport(transport, (err, result) => {
            if (next) {
              result = err || result;
              if (result) {
                results[transport.name] = result;
              }
              next();
            }
            next = null;
          });
        }
        asyncForEach(
          this.transports.filter((transport) => !!transport.query),
          addResults,
          () => callback(null, results)
        );
      }
      /**
       * 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.
       */
      stream(options = {}) {
        const out = new Stream();
        const streams = [];
        out._streams = streams;
        out.destroy = () => {
          let i3 = streams.length;
          while (i3--) {
            streams[i3].destroy();
          }
        };
        this.transports.filter((transport) => !!transport.stream).forEach((transport) => {
          const str = transport.stream(options);
          if (!str) {
            return;
          }
          streams.push(str);
          str.on("log", (log) => {
            log.transport = log.transport || [];
            log.transport.push(transport.name);
            out.emit("log", log);
          });
          str.on("error", (err) => {
            err.transport = err.transport || [];
            err.transport.push(transport.name);
            out.emit("error", err);
          });
        });
        return out;
      }
      /**
       * 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);
       */
      startTimer() {
        return new Profiler(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.
       */
      profile(id, ...args) {
        const time = Date.now();
        if (this.profilers[id]) {
          const timeEnd = this.profilers[id];
          delete this.profilers[id];
          if (typeof args[args.length - 2] === "function") {
            console.warn(
              "Callback function no longer supported as of winston@3.0.0"
            );
            args.pop();
          }
          const info = typeof args[args.length - 1] === "object" ? args.pop() : {};
          info.level = info.level || "info";
          info.durationMs = time - timeEnd;
          info.message = info.message || id;
          return this.write(info);
        }
        this.profilers[id] = time;
        return this;
      }
      /**
       * Backwards compatibility to `exceptions.handle` in winston < 3.0.0.
       * @returns {undefined}
       * @deprecated
       */
      handleExceptions(...args) {
        console.warn(
          "Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"
        );
        this.exceptions.handle(...args);
      }
      /**
       * Backwards compatibility to `exceptions.handle` in winston < 3.0.0.
       * @returns {undefined}
       * @deprecated
       */
      unhandleExceptions(...args) {
        console.warn(
          "Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"
        );
        this.exceptions.unhandle(...args);
      }
      /**
       * Throw a more meaningful deprecation notice
       * @throws {Error} - TODO: add throws description.
       */
      cli() {
        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("\n")
        );
      }
      /**
       * 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
       */
      _onEvent(event, transport) {
        function transportEvent(err) {
          if (event === "error" && !this.transports.includes(transport)) {
            this.add(transport);
          }
          this.emit(event, err, transport);
        }
        if (!transport["__winston" + event]) {
          transport["__winston" + event] = transportEvent.bind(this);
          transport.on(event, transport["__winston" + event]);
        }
      }
      _addDefaultMeta(msg) {
        if (this.defaultMeta) {
          Object.assign(msg, this.defaultMeta);
        }
      }
    };
    function getLevelValue(levels, level) {
      const value = levels[level];
      if (!value && value !== 0) {
        return null;
      }
      return value;
    }
    Object.defineProperty(Logger.prototype, "transports", {
      configurable: false,
      enumerable: true,
      get() {
        const { pipes } = this._readableState;
        return !Array.isArray(pipes) ? [pipes].filter(Boolean) : pipes;
      }
    });
    module2.exports = Logger;
  }
});
var require_create_logger = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/create-logger.js"(exports$1, module2) {
    var { LEVEL } = require_triple_beam();
    var config = require_config22();
    var Logger = require_logger();
    var debug = require_node2()("winston:create-logger");
    function isLevelEnabledFunctionName(level) {
      return "is" + level.charAt(0).toUpperCase() + level.slice(1) + "Enabled";
    }
    module2.exports = function(opts = {}) {
      opts.levels = opts.levels || config.npm.levels;
      class DerivedLogger extends Logger {
        /**
         * Create a new class derived logger for which the levels can be attached to
         * the prototype of. This is a V8 optimization that is well know to increase
         * performance of prototype functions.
         * @param {!Object} options - Options for the created logger.
         */
        constructor(options) {
          super(options);
        }
      }
      const logger18 = new DerivedLogger(opts);
      Object.keys(opts.levels).forEach(function(level) {
        debug('Define prototype method for "%s"', level);
        if (level === "log") {
          console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');
          return;
        }
        DerivedLogger.prototype[level] = function(...args) {
          const self2 = this || logger18;
          if (args.length === 1) {
            const [msg] = args;
            const info = msg && msg.message && msg || { message: msg };
            info.level = info[LEVEL] = level;
            self2._addDefaultMeta(info);
            self2.write(info);
            return this || logger18;
          }
          if (args.length === 0) {
            self2.log(level, "");
            return self2;
          }
          return self2.log(level, ...args);
        };
        DerivedLogger.prototype[isLevelEnabledFunctionName(level)] = function() {
          return (this || logger18).isLevelEnabled(level);
        };
      });
      return logger18;
    };
  }
});
var require_container = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/container.js"(exports$1, module2) {
    var createLogger22 = require_create_logger();
    module2.exports = class Container {
      /**
       * Constructor function for the Container object responsible for managing a
       * set of `winston.Logger` instances based on string ids.
       * @param {!Object} [options={}] - Default pass-thru options for Loggers.
       */
      constructor(options = {}) {
        this.loggers = /* @__PURE__ */ new Map();
        this.options = options;
      }
      /**
       * Retrieves 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.
       */
      add(id, options) {
        if (!this.loggers.has(id)) {
          options = Object.assign({}, options || this.options);
          const existing = options.transports || this.options.transports;
          if (existing) {
            options.transports = Array.isArray(existing) ? existing.slice() : [existing];
          } else {
            options.transports = [];
          }
          const logger18 = createLogger22(options);
          logger18.on("close", () => this._delete(id));
          this.loggers.set(id, logger18);
        }
        return this.loggers.get(id);
      }
      /**
       * 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.
       */
      get(id, options) {
        return this.add(id, options);
      }
      /**
       * 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`.
       */
      has(id) {
        return !!this.loggers.has(id);
      }
      /**
       * 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}
       */
      close(id) {
        if (id) {
          return this._removeLogger(id);
        }
        this.loggers.forEach((val, key) => this._removeLogger(key));
      }
      /**
       * Remove a logger based on the id.
       * @param {!string} id - The id of the logger to remove.
       * @returns {undefined}
       * @private
       */
      _removeLogger(id) {
        if (!this.loggers.has(id)) {
          return;
        }
        const logger18 = this.loggers.get(id);
        logger18.close();
        this._delete(id);
      }
      /**
       * Deletes a `Logger` instance with the specified `id`.
       * @param {!string} id - The id of the Logger instance to delete from
       * container.
       * @returns {undefined}
       * @private
       */
      _delete(id) {
        this.loggers.delete(id);
      }
    };
  }
});
var require_winston = __commonJS2({
  "../../node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston.js"(exports$1) {
    var logform = require_logform();
    var { warn } = require_common();
    exports$1.version = require_package().version;
    exports$1.transports = require_transports();
    exports$1.config = require_config22();
    exports$1.addColors = logform.levels;
    exports$1.format = logform.format;
    exports$1.createLogger = require_create_logger();
    exports$1.Logger = require_logger();
    exports$1.ExceptionHandler = require_exception_handler();
    exports$1.RejectionHandler = require_rejection_handler();
    exports$1.Container = require_container();
    exports$1.Transport = require_winston_transport();
    exports$1.loggers = new exports$1.Container();
    var defaultLogger = exports$1.createLogger();
    Object.keys(exports$1.config.npm.levels).concat([
      "log",
      "query",
      "stream",
      "add",
      "remove",
      "clear",
      "profile",
      "startTimer",
      "handleExceptions",
      "unhandleExceptions",
      "handleRejections",
      "unhandleRejections",
      "configure",
      "child"
    ]).forEach(
      (method) => exports$1[method] = (...args) => defaultLogger[method](...args)
    );
    Object.defineProperty(exports$1, "level", {
      get() {
        return defaultLogger.level;
      },
      set(val) {
        defaultLogger.level = val;
      }
    });
    Object.defineProperty(exports$1, "exceptions", {
      get() {
        return defaultLogger.exceptions;
      }
    });
    Object.defineProperty(exports$1, "rejections", {
      get() {
        return defaultLogger.rejections;
      }
    });
    ["exitOnError"].forEach((prop) => {
      Object.defineProperty(exports$1, prop, {
        get() {
          return defaultLogger[prop];
        },
        set(val) {
          defaultLogger[prop] = val;
        }
      });
    });
    Object.defineProperty(exports$1, "default", {
      get() {
        return {
          exceptionHandlers: defaultLogger.exceptionHandlers,
          rejectionHandlers: defaultLogger.rejectionHandlers,
          transports: defaultLogger.transports
        };
      }
    });
    warn.deprecated(exports$1, "setLevels");
    warn.forFunctions(exports$1, "useFormat", ["cli"]);
    warn.forProperties(exports$1, "useFormat", ["padLevels", "stripColors"]);
    warn.forFunctions(exports$1, "deprecated", [
      "addRewriter",
      "addFilter",
      "clone",
      "extend"
    ]);
    warn.forProperties(exports$1, "deprecated", ["emitErrs", "levelLength"]);
  }
});
var require_object_hash = __commonJS2({
  "../../node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js"(exports$1, module2) {
    var crypto = __require("crypto");
    exports$1 = module2.exports = objectHash;
    function objectHash(object, options) {
      options = applyDefaults(object, options);
      return hash(object, options);
    }
    exports$1.sha1 = function(object) {
      return objectHash(object);
    };
    exports$1.keys = function(object) {
      return objectHash(object, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
    };
    exports$1.MD5 = function(object) {
      return objectHash(object, { algorithm: "md5", encoding: "hex" });
    };
    exports$1.keysMD5 = function(object) {
      return objectHash(object, { algorithm: "md5", encoding: "hex", excludeValues: true });
    };
    var hashes = crypto.getHashes ? crypto.getHashes().slice() : ["sha1", "md5"];
    hashes.push("passthrough");
    var encodings = ["buffer", "hex", "binary", "base64"];
    function applyDefaults(object, sourceOptions) {
      sourceOptions = sourceOptions || {};
      var options = {};
      options.algorithm = sourceOptions.algorithm || "sha1";
      options.encoding = sourceOptions.encoding || "hex";
      options.excludeValues = sourceOptions.excludeValues ? true : false;
      options.algorithm = options.algorithm.toLowerCase();
      options.encoding = options.encoding.toLowerCase();
      options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true;
      options.respectType = sourceOptions.respectType === false ? false : true;
      options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
      options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
      options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true;
      options.unorderedSets = sourceOptions.unorderedSets === false ? false : true;
      options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true;
      options.replacer = sourceOptions.replacer || void 0;
      options.excludeKeys = sourceOptions.excludeKeys || void 0;
      if (typeof object === "undefined") {
        throw new Error("Object argument required.");
      }
      for (var i3 = 0; i3 < hashes.length; ++i3) {
        if (hashes[i3].toLowerCase() === options.algorithm.toLowerCase()) {
          options.algorithm = hashes[i3];
        }
      }
      if (hashes.indexOf(options.algorithm) === -1) {
        throw new Error('Algorithm "' + options.algorithm + '"  not supported. supported values: ' + hashes.join(", "));
      }
      if (encodings.indexOf(options.encoding) === -1 && options.algorithm !== "passthrough") {
        throw new Error('Encoding "' + options.encoding + '"  not supported. supported values: ' + encodings.join(", "));
      }
      return options;
    }
    function isNativeFunction(f) {
      if (typeof f !== "function") {
        return false;
      }
      var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
      return exp.exec(Function.prototype.toString.call(f)) != null;
    }
    function hash(object, options) {
      var hashingStream;
      if (options.algorithm !== "passthrough") {
        hashingStream = crypto.createHash(options.algorithm);
      } else {
        hashingStream = new PassThrough();
      }
      if (typeof hashingStream.write === "undefined") {
        hashingStream.write = hashingStream.update;
        hashingStream.end = hashingStream.update;
      }
      var hasher = typeHasher(options, hashingStream);
      hasher.dispatch(object);
      if (!hashingStream.update) {
        hashingStream.end("");
      }
      if (hashingStream.digest) {
        return hashingStream.digest(options.encoding === "buffer" ? void 0 : options.encoding);
      }
      var buf = hashingStream.read();
      if (options.encoding === "buffer") {
        return buf;
      }
      return buf.toString(options.encoding);
    }
    exports$1.writeToStream = function(object, options, stream) {
      if (typeof stream === "undefined") {
        stream = options;
        options = {};
      }
      options = applyDefaults(object, options);
      return typeHasher(options, stream).dispatch(object);
    };
    function typeHasher(options, writeTo, context) {
      context = context || [];
      var write = function(str) {
        if (writeTo.update) {
          return writeTo.update(str, "utf8");
        } else {
          return writeTo.write(str, "utf8");
        }
      };
      return {
        dispatch: function(value) {
          if (options.replacer) {
            value = options.replacer(value);
          }
          var type = typeof value;
          if (value === null) {
            type = "null";
          }
          return this["_" + type](value);
        },
        _object: function(object) {
          var pattern = /\[object (.*)\]/i;
          var objString = Object.prototype.toString.call(object);
          var objType = pattern.exec(objString);
          if (!objType) {
            objType = "unknown:[" + objString + "]";
          } else {
            objType = objType[1];
          }
          objType = objType.toLowerCase();
          var objectNumber = null;
          if ((objectNumber = context.indexOf(object)) >= 0) {
            return this.dispatch("[CIRCULAR:" + objectNumber + "]");
          } else {
            context.push(object);
          }
          if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
            write("buffer:");
            return write(object);
          }
          if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
            if (this["_" + objType]) {
              this["_" + objType](object);
            } else if (options.ignoreUnknown) {
              return write("[" + objType + "]");
            } else {
              throw new Error('Unknown object type "' + objType + '"');
            }
          } else {
            var keys = Object.keys(object);
            if (options.unorderedObjects) {
              keys = keys.sort();
            }
            if (options.respectType !== false && !isNativeFunction(object)) {
              keys.splice(0, 0, "prototype", "__proto__", "constructor");
            }
            if (options.excludeKeys) {
              keys = keys.filter(function(key) {
                return !options.excludeKeys(key);
              });
            }
            write("object:" + keys.length + ":");
            var self2 = this;
            return keys.forEach(function(key) {
              self2.dispatch(key);
              write(":");
              if (!options.excludeValues) {
                self2.dispatch(object[key]);
              }
              write(",");
            });
          }
        },
        _array: function(arr, unordered) {
          unordered = typeof unordered !== "undefined" ? unordered : options.unorderedArrays !== false;
          var self2 = this;
          write("array:" + arr.length + ":");
          if (!unordered || arr.length <= 1) {
            return arr.forEach(function(entry) {
              return self2.dispatch(entry);
            });
          }
          var contextAdditions = [];
          var entries = arr.map(function(entry) {
            var strm = new PassThrough();
            var localContext = context.slice();
            var hasher = typeHasher(options, strm, localContext);
            hasher.dispatch(entry);
            contextAdditions = contextAdditions.concat(localContext.slice(context.length));
            return strm.read().toString();
          });
          context = context.concat(contextAdditions);
          entries.sort();
          return this._array(entries, false);
        },
        _date: function(date) {
          return write("date:" + date.toJSON());
        },
        _symbol: function(sym) {
          return write("symbol:" + sym.toString());
        },
        _error: function(err) {
          return write("error:" + err.toString());
        },
        _boolean: function(bool) {
          return write("bool:" + bool.toString());
        },
        _string: function(string) {
          write("string:" + string.length + ":");
          write(string.toString());
        },
        _function: function(fn) {
          write("fn:");
          if (isNativeFunction(fn)) {
            this.dispatch("[native]");
          } else {
            this.dispatch(fn.toString());
          }
          if (options.respectFunctionNames !== false) {
            this.dispatch("function-name:" + String(fn.name));
          }
          if (options.respectFunctionProperties) {
            this._object(fn);
          }
        },
        _number: function(number) {
          return write("number:" + number.toString());
        },
        _xml: function(xml) {
          return write("xml:" + xml.toString());
        },
        _null: function() {
          return write("Null");
        },
        _undefined: function() {
          return write("Undefined");
        },
        _regexp: function(regex) {
          return write("regex:" + regex.toString());
        },
        _uint8array: function(arr) {
          write("uint8array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _uint8clampedarray: function(arr) {
          write("uint8clampedarray:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _int8array: function(arr) {
          write("int8array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _uint16array: function(arr) {
          write("uint16array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _int16array: function(arr) {
          write("int16array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _uint32array: function(arr) {
          write("uint32array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _int32array: function(arr) {
          write("int32array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _float32array: function(arr) {
          write("float32array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _float64array: function(arr) {
          write("float64array:");
          return this.dispatch(Array.prototype.slice.call(arr));
        },
        _arraybuffer: function(arr) {
          write("arraybuffer:");
          return this.dispatch(new Uint8Array(arr));
        },
        _url: function(url) {
          return write("url:" + url.toString());
        },
        _map: function(map) {
          write("map:");
          var arr = Array.from(map);
          return this._array(arr, options.unorderedSets !== false);
        },
        _set: function(set) {
          write("set:");
          var arr = Array.from(set);
          return this._array(arr, options.unorderedSets !== false);
        },
        _file: function(file) {
          write("file:");
          return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
        },
        _blob: function() {
          if (options.ignoreUnknown) {
            return write("[blob]");
          }
          throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
        },
        _domwindow: function() {
          return write("domwindow");
        },
        _bigint: function(number) {
          return write("bigint:" + number.toString());
        },
        /* Node.js standard native objects */
        _process: function() {
          return write("process");
        },
        _timer: function() {
          return write("timer");
        },
        _pipe: function() {
          return write("pipe");
        },
        _tcp: function() {
          return write("tcp");
        },
        _udp: function() {
          return write("udp");
        },
        _tty: function() {
          return write("tty");
        },
        _statwatcher: function() {
          return write("statwatcher");
        },
        _securecontext: function() {
          return write("securecontext");
        },
        _connection: function() {
          return write("connection");
        },
        _zlib: function() {
          return write("zlib");
        },
        _context: function() {
          return write("context");
        },
        _nodescript: function() {
          return write("nodescript");
        },
        _httpparser: function() {
          return write("httpparser");
        },
        _dataview: function() {
          return write("dataview");
        },
        _signal: function() {
          return write("signal");
        },
        _fsevent: function() {
          return write("fsevent");
        },
        _tlswrap: function() {
          return write("tlswrap");
        }
      };
    }
    function PassThrough() {
      return {
        buf: "",
        write: function(b3) {
          this.buf += b3;
        },
        end: function(b3) {
          this.buf += b3;
        },
        read: function() {
          return this.buf;
        }
      };
    }
  }
});
var require_moment = __commonJS2({
  "../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js"(exports$1, module2) {
    (function(global2, factory) {
      typeof exports$1 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.moment = factory();
    })(exports$1, function() {
      var hookCallback;
      function hooks() {
        return hookCallback.apply(null, arguments);
      }
      function setHookCallback(callback) {
        hookCallback = callback;
      }
      function isArray(input) {
        return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
      }
      function isObject(input) {
        return input != null && Object.prototype.toString.call(input) === "[object Object]";
      }
      function hasOwnProp(a, b3) {
        return Object.prototype.hasOwnProperty.call(a, b3);
      }
      function isObjectEmpty(obj) {
        if (Object.getOwnPropertyNames) {
          return Object.getOwnPropertyNames(obj).length === 0;
        } else {
          var k;
          for (k in obj) {
            if (hasOwnProp(obj, k)) {
              return false;
            }
          }
          return true;
        }
      }
      function isUndefined(input) {
        return input === void 0;
      }
      function isNumber(input) {
        return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
      }
      function isDate(input) {
        return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
      }
      function map(arr, fn) {
        var res = [], i3, arrLen = arr.length;
        for (i3 = 0; i3 < arrLen; ++i3) {
          res.push(fn(arr[i3], i3));
        }
        return res;
      }
      function extend(a, b3) {
        for (var i3 in b3) {
          if (hasOwnProp(b3, i3)) {
            a[i3] = b3[i3];
          }
        }
        if (hasOwnProp(b3, "toString")) {
          a.toString = b3.toString;
        }
        if (hasOwnProp(b3, "valueOf")) {
          a.valueOf = b3.valueOf;
        }
        return a;
      }
      function createUTC(input, format3, locale2, strict) {
        return createLocalOrUTC(input, format3, locale2, strict, true).utc();
      }
      function defaultParsingFlags() {
        return {
          empty: false,
          unusedTokens: [],
          unusedInput: [],
          overflow: -2,
          charsLeftOver: 0,
          nullInput: false,
          invalidEra: null,
          invalidMonth: null,
          invalidFormat: false,
          userInvalidated: false,
          iso: false,
          parsedDateParts: [],
          era: null,
          meridiem: null,
          rfc2822: false,
          weekdayMismatch: false
        };
      }
      function getParsingFlags(m) {
        if (m._pf == null) {
          m._pf = defaultParsingFlags();
        }
        return m._pf;
      }
      var some;
      if (Array.prototype.some) {
        some = Array.prototype.some;
      } else {
        some = function(fun) {
          var t = Object(this), len = t.length >>> 0, i3;
          for (i3 = 0; i3 < len; i3++) {
            if (i3 in t && fun.call(this, t[i3], i3, t)) {
              return true;
            }
          }
          return false;
        };
      }
      function isValid(m) {
        var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
        if (isNowValid) {
          flags = getParsingFlags(m);
          parsedParts = some.call(flags.parsedDateParts, function(i3) {
            return i3 != null;
          });
          isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
          if (m._strict) {
            isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
          }
        }
        if (Object.isFrozen == null || !Object.isFrozen(m)) {
          m._isValid = isNowValid;
        } else {
          return isNowValid;
        }
        return m._isValid;
      }
      function createInvalid(flags) {
        var m = createUTC(NaN);
        if (flags != null) {
          extend(getParsingFlags(m), flags);
        } else {
          getParsingFlags(m).userInvalidated = true;
        }
        return m;
      }
      var momentProperties = hooks.momentProperties = [], updateInProgress = false;
      function copyConfig(to2, from2) {
        var i3, prop, val, momentPropertiesLen = momentProperties.length;
        if (!isUndefined(from2._isAMomentObject)) {
          to2._isAMomentObject = from2._isAMomentObject;
        }
        if (!isUndefined(from2._i)) {
          to2._i = from2._i;
        }
        if (!isUndefined(from2._f)) {
          to2._f = from2._f;
        }
        if (!isUndefined(from2._l)) {
          to2._l = from2._l;
        }
        if (!isUndefined(from2._strict)) {
          to2._strict = from2._strict;
        }
        if (!isUndefined(from2._tzm)) {
          to2._tzm = from2._tzm;
        }
        if (!isUndefined(from2._isUTC)) {
          to2._isUTC = from2._isUTC;
        }
        if (!isUndefined(from2._offset)) {
          to2._offset = from2._offset;
        }
        if (!isUndefined(from2._pf)) {
          to2._pf = getParsingFlags(from2);
        }
        if (!isUndefined(from2._locale)) {
          to2._locale = from2._locale;
        }
        if (momentPropertiesLen > 0) {
          for (i3 = 0; i3 < momentPropertiesLen; i3++) {
            prop = momentProperties[i3];
            val = from2[prop];
            if (!isUndefined(val)) {
              to2[prop] = val;
            }
          }
        }
        return to2;
      }
      function Moment(config) {
        copyConfig(this, config);
        this._d = new Date(config._d != null ? config._d.getTime() : NaN);
        if (!this.isValid()) {
          this._d = /* @__PURE__ */ new Date(NaN);
        }
        if (updateInProgress === false) {
          updateInProgress = true;
          hooks.updateOffset(this);
          updateInProgress = false;
        }
      }
      function isMoment(obj) {
        return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
      }
      function warn(msg) {
        if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
          console.warn("Deprecation warning: " + msg);
        }
      }
      function deprecate(msg, fn) {
        var firstTime = true;
        return extend(function() {
          if (hooks.deprecationHandler != null) {
            hooks.deprecationHandler(null, msg);
          }
          if (firstTime) {
            var args = [], arg, i3, key, argLen = arguments.length;
            for (i3 = 0; i3 < argLen; i3++) {
              arg = "";
              if (typeof arguments[i3] === "object") {
                arg += "\n[" + i3 + "] ";
                for (key in arguments[0]) {
                  if (hasOwnProp(arguments[0], key)) {
                    arg += key + ": " + arguments[0][key] + ", ";
                  }
                }
                arg = arg.slice(0, -2);
              } else {
                arg = arguments[i3];
              }
              args.push(arg);
            }
            warn(
              msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
            );
            firstTime = false;
          }
          return fn.apply(this, arguments);
        }, fn);
      }
      var deprecations = {};
      function deprecateSimple(name, msg) {
        if (hooks.deprecationHandler != null) {
          hooks.deprecationHandler(name, msg);
        }
        if (!deprecations[name]) {
          warn(msg);
          deprecations[name] = true;
        }
      }
      hooks.suppressDeprecationWarnings = false;
      hooks.deprecationHandler = null;
      function isFunction(input) {
        return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
      }
      function set(config) {
        var prop, i3;
        for (i3 in config) {
          if (hasOwnProp(config, i3)) {
            prop = config[i3];
            if (isFunction(prop)) {
              this[i3] = prop;
            } else {
              this["_" + i3] = prop;
            }
          }
        }
        this._config = config;
        this._dayOfMonthOrdinalParseLenient = new RegExp(
          (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
        );
      }
      function mergeConfigs(parentConfig, childConfig) {
        var res = extend({}, parentConfig), prop;
        for (prop in childConfig) {
          if (hasOwnProp(childConfig, prop)) {
            if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
              res[prop] = {};
              extend(res[prop], parentConfig[prop]);
              extend(res[prop], childConfig[prop]);
            } else if (childConfig[prop] != null) {
              res[prop] = childConfig[prop];
            } else {
              delete res[prop];
            }
          }
        }
        for (prop in parentConfig) {
          if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
            res[prop] = extend({}, res[prop]);
          }
        }
        return res;
      }
      function Locale(config) {
        if (config != null) {
          this.set(config);
        }
      }
      var keys;
      if (Object.keys) {
        keys = Object.keys;
      } else {
        keys = function(obj) {
          var i3, res = [];
          for (i3 in obj) {
            if (hasOwnProp(obj, i3)) {
              res.push(i3);
            }
          }
          return res;
        };
      }
      var defaultCalendar = {
        sameDay: "[Today at] LT",
        nextDay: "[Tomorrow at] LT",
        nextWeek: "dddd [at] LT",
        lastDay: "[Yesterday at] LT",
        lastWeek: "[Last] dddd [at] LT",
        sameElse: "L"
      };
      function calendar(key, mom, now2) {
        var output = this._calendar[key] || this._calendar["sameElse"];
        return isFunction(output) ? output.call(mom, now2) : output;
      }
      function zeroFill(number, targetLength, forceSign) {
        var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
        return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
      }
      var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
      function addFormatToken(token3, padded, ordinal2, callback) {
        var func = callback;
        if (typeof callback === "string") {
          func = function() {
            return this[callback]();
          };
        }
        if (token3) {
          formatTokenFunctions[token3] = func;
        }
        if (padded) {
          formatTokenFunctions[padded[0]] = function() {
            return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
          };
        }
        if (ordinal2) {
          formatTokenFunctions[ordinal2] = function() {
            return this.localeData().ordinal(
              func.apply(this, arguments),
              token3
            );
          };
        }
      }
      function removeFormattingTokens(input) {
        if (input.match(/\[[\s\S]/)) {
          return input.replace(/^\[|\]$/g, "");
        }
        return input.replace(/\\/g, "");
      }
      function makeFormatFunction(format3) {
        var array = format3.match(formattingTokens), i3, length;
        for (i3 = 0, length = array.length; i3 < length; i3++) {
          if (formatTokenFunctions[array[i3]]) {
            array[i3] = formatTokenFunctions[array[i3]];
          } else {
            array[i3] = removeFormattingTokens(array[i3]);
          }
        }
        return function(mom) {
          var output = "", i22;
          for (i22 = 0; i22 < length; i22++) {
            output += isFunction(array[i22]) ? array[i22].call(mom, format3) : array[i22];
          }
          return output;
        };
      }
      function formatMoment(m, format3) {
        if (!m.isValid()) {
          return m.localeData().invalidDate();
        }
        format3 = expandFormat(format3, m.localeData());
        formatFunctions[format3] = formatFunctions[format3] || makeFormatFunction(format3);
        return formatFunctions[format3](m);
      }
      function expandFormat(format3, locale2) {
        var i3 = 5;
        function replaceLongDateFormatTokens(input) {
          return locale2.longDateFormat(input) || input;
        }
        localFormattingTokens.lastIndex = 0;
        while (i3 >= 0 && localFormattingTokens.test(format3)) {
          format3 = format3.replace(
            localFormattingTokens,
            replaceLongDateFormatTokens
          );
          localFormattingTokens.lastIndex = 0;
          i3 -= 1;
        }
        return format3;
      }
      var defaultLongDateFormat = {
        LTS: "h:mm:ss A",
        LT: "h:mm A",
        L: "MM/DD/YYYY",
        LL: "MMMM D, YYYY",
        LLL: "MMMM D, YYYY h:mm A",
        LLLL: "dddd, MMMM D, YYYY h:mm A"
      };
      function longDateFormat(key) {
        var format3 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
        if (format3 || !formatUpper) {
          return format3;
        }
        this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
          if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
            return tok.slice(1);
          }
          return tok;
        }).join("");
        return this._longDateFormat[key];
      }
      var defaultInvalidDate = "Invalid date";
      function invalidDate() {
        return this._invalidDate;
      }
      var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
      function ordinal(number) {
        return this._ordinal.replace("%d", number);
      }
      var defaultRelativeTime = {
        future: "in %s",
        past: "%s ago",
        s: "a few seconds",
        ss: "%d seconds",
        m: "a minute",
        mm: "%d minutes",
        h: "an hour",
        hh: "%d hours",
        d: "a day",
        dd: "%d days",
        w: "a week",
        ww: "%d weeks",
        M: "a month",
        MM: "%d months",
        y: "a year",
        yy: "%d years"
      };
      function relativeTime(number, withoutSuffix, string, isFuture) {
        var output = this._relativeTime[string];
        return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
      }
      function pastFuture(diff2, output) {
        var format3 = this._relativeTime[diff2 > 0 ? "future" : "past"];
        return isFunction(format3) ? format3(output) : format3.replace(/%s/i, output);
      }
      var aliases = {
        D: "date",
        dates: "date",
        date: "date",
        d: "day",
        days: "day",
        day: "day",
        e: "weekday",
        weekdays: "weekday",
        weekday: "weekday",
        E: "isoWeekday",
        isoweekdays: "isoWeekday",
        isoweekday: "isoWeekday",
        DDD: "dayOfYear",
        dayofyears: "dayOfYear",
        dayofyear: "dayOfYear",
        h: "hour",
        hours: "hour",
        hour: "hour",
        ms: "millisecond",
        milliseconds: "millisecond",
        millisecond: "millisecond",
        m: "minute",
        minutes: "minute",
        minute: "minute",
        M: "month",
        months: "month",
        month: "month",
        Q: "quarter",
        quarters: "quarter",
        quarter: "quarter",
        s: "second",
        seconds: "second",
        second: "second",
        gg: "weekYear",
        weekyears: "weekYear",
        weekyear: "weekYear",
        GG: "isoWeekYear",
        isoweekyears: "isoWeekYear",
        isoweekyear: "isoWeekYear",
        w: "week",
        weeks: "week",
        week: "week",
        W: "isoWeek",
        isoweeks: "isoWeek",
        isoweek: "isoWeek",
        y: "year",
        years: "year",
        year: "year"
      };
      function normalizeUnits(units) {
        return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
      }
      function normalizeObjectUnits(inputObject) {
        var normalizedInput = {}, normalizedProp, prop;
        for (prop in inputObject) {
          if (hasOwnProp(inputObject, prop)) {
            normalizedProp = normalizeUnits(prop);
            if (normalizedProp) {
              normalizedInput[normalizedProp] = inputObject[prop];
            }
          }
        }
        return normalizedInput;
      }
      var priorities = {
        date: 9,
        day: 11,
        weekday: 11,
        isoWeekday: 11,
        dayOfYear: 4,
        hour: 13,
        millisecond: 16,
        minute: 14,
        month: 8,
        quarter: 7,
        second: 15,
        weekYear: 1,
        isoWeekYear: 1,
        week: 5,
        isoWeek: 5,
        year: 1
      };
      function getPrioritizedUnits(unitsObj) {
        var units = [], u;
        for (u in unitsObj) {
          if (hasOwnProp(unitsObj, u)) {
            units.push({ unit: u, priority: priorities[u] });
          }
        }
        units.sort(function(a, b3) {
          return a.priority - b3.priority;
        });
        return units;
      }
      var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
      regexes = {};
      function addRegexToken(token3, regex, strictRegex) {
        regexes[token3] = isFunction(regex) ? regex : function(isStrict, localeData2) {
          return isStrict && strictRegex ? strictRegex : regex;
        };
      }
      function getParseRegexForToken(token3, config) {
        if (!hasOwnProp(regexes, token3)) {
          return new RegExp(unescapeFormat(token3));
        }
        return regexes[token3](config._strict, config._locale);
      }
      function unescapeFormat(s) {
        return regexEscape2(
          s.replace("\\", "").replace(
            /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
            function(matched, p1, p22, p3, p4) {
              return p1 || p22 || p3 || p4;
            }
          )
        );
      }
      function regexEscape2(s) {
        return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
      }
      function absFloor(number) {
        if (number < 0) {
          return Math.ceil(number) || 0;
        } else {
          return Math.floor(number);
        }
      }
      function toInt(argumentForCoercion) {
        var coercedNumber = +argumentForCoercion, value = 0;
        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
          value = absFloor(coercedNumber);
        }
        return value;
      }
      var tokens = {};
      function addParseToken(token3, callback) {
        var i3, func = callback, tokenLen;
        if (typeof token3 === "string") {
          token3 = [token3];
        }
        if (isNumber(callback)) {
          func = function(input, array) {
            array[callback] = toInt(input);
          };
        }
        tokenLen = token3.length;
        for (i3 = 0; i3 < tokenLen; i3++) {
          tokens[token3[i3]] = func;
        }
      }
      function addWeekParseToken(token3, callback) {
        addParseToken(token3, function(input, array, config, token4) {
          config._w = config._w || {};
          callback(input, config._w, config, token4);
        });
      }
      function addTimeToArrayFromToken(token3, input, config) {
        if (input != null && hasOwnProp(tokens, token3)) {
          tokens[token3](input, config._a, config, token3);
        }
      }
      function isLeapYear(year) {
        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
      }
      var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
      addFormatToken("Y", 0, 0, function() {
        var y3 = this.year();
        return y3 <= 9999 ? zeroFill(y3, 4) : "+" + y3;
      });
      addFormatToken(0, ["YY", 2], 0, function() {
        return this.year() % 100;
      });
      addFormatToken(0, ["YYYY", 4], 0, "year");
      addFormatToken(0, ["YYYYY", 5], 0, "year");
      addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
      addRegexToken("Y", matchSigned);
      addRegexToken("YY", match1to2, match2);
      addRegexToken("YYYY", match1to4, match4);
      addRegexToken("YYYYY", match1to6, match6);
      addRegexToken("YYYYYY", match1to6, match6);
      addParseToken(["YYYYY", "YYYYYY"], YEAR);
      addParseToken("YYYY", function(input, array) {
        array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
      });
      addParseToken("YY", function(input, array) {
        array[YEAR] = hooks.parseTwoDigitYear(input);
      });
      addParseToken("Y", function(input, array) {
        array[YEAR] = parseInt(input, 10);
      });
      function daysInYear(year) {
        return isLeapYear(year) ? 366 : 365;
      }
      hooks.parseTwoDigitYear = function(input) {
        return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
      };
      var getSetYear = makeGetSet("FullYear", true);
      function getIsLeapYear() {
        return isLeapYear(this.year());
      }
      function makeGetSet(unit, keepTime) {
        return function(value) {
          if (value != null) {
            set$1(this, unit, value);
            hooks.updateOffset(this, keepTime);
            return this;
          } else {
            return get(this, unit);
          }
        };
      }
      function get(mom, unit) {
        if (!mom.isValid()) {
          return NaN;
        }
        var d3 = mom._d, isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return isUTC ? d3.getUTCMilliseconds() : d3.getMilliseconds();
          case "Seconds":
            return isUTC ? d3.getUTCSeconds() : d3.getSeconds();
          case "Minutes":
            return isUTC ? d3.getUTCMinutes() : d3.getMinutes();
          case "Hours":
            return isUTC ? d3.getUTCHours() : d3.getHours();
          case "Date":
            return isUTC ? d3.getUTCDate() : d3.getDate();
          case "Day":
            return isUTC ? d3.getUTCDay() : d3.getDay();
          case "Month":
            return isUTC ? d3.getUTCMonth() : d3.getMonth();
          case "FullYear":
            return isUTC ? d3.getUTCFullYear() : d3.getFullYear();
          default:
            return NaN;
        }
      }
      function set$1(mom, unit, value) {
        var d3, isUTC, year, month, date;
        if (!mom.isValid() || isNaN(value)) {
          return;
        }
        d3 = mom._d;
        isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return void (isUTC ? d3.setUTCMilliseconds(value) : d3.setMilliseconds(value));
          case "Seconds":
            return void (isUTC ? d3.setUTCSeconds(value) : d3.setSeconds(value));
          case "Minutes":
            return void (isUTC ? d3.setUTCMinutes(value) : d3.setMinutes(value));
          case "Hours":
            return void (isUTC ? d3.setUTCHours(value) : d3.setHours(value));
          case "Date":
            return void (isUTC ? d3.setUTCDate(value) : d3.setDate(value));
          // case 'Day': // Not real
          //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
          // case 'Month': // Not used because we need to pass two variables
          //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
          case "FullYear":
            break;
          // See below ...
          default:
            return;
        }
        year = value;
        month = mom.month();
        date = mom.date();
        date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
        void (isUTC ? d3.setUTCFullYear(year, month, date) : d3.setFullYear(year, month, date));
      }
      function stringGet(units) {
        units = normalizeUnits(units);
        if (isFunction(this[units])) {
          return this[units]();
        }
        return this;
      }
      function stringSet(units, value) {
        if (typeof units === "object") {
          units = normalizeObjectUnits(units);
          var prioritized = getPrioritizedUnits(units), i3, prioritizedLen = prioritized.length;
          for (i3 = 0; i3 < prioritizedLen; i3++) {
            this[prioritized[i3].unit](units[prioritized[i3].unit]);
          }
        } else {
          units = normalizeUnits(units);
          if (isFunction(this[units])) {
            return this[units](value);
          }
        }
        return this;
      }
      function mod2(n3, x3) {
        return (n3 % x3 + x3) % x3;
      }
      var indexOf;
      if (Array.prototype.indexOf) {
        indexOf = Array.prototype.indexOf;
      } else {
        indexOf = function(o) {
          var i3;
          for (i3 = 0; i3 < this.length; ++i3) {
            if (this[i3] === o) {
              return i3;
            }
          }
          return -1;
        };
      }
      function daysInMonth(year, month) {
        if (isNaN(year) || isNaN(month)) {
          return NaN;
        }
        var modMonth = mod2(month, 12);
        year += (month - modMonth) / 12;
        return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
      }
      addFormatToken("M", ["MM", 2], "Mo", function() {
        return this.month() + 1;
      });
      addFormatToken("MMM", 0, 0, function(format3) {
        return this.localeData().monthsShort(this, format3);
      });
      addFormatToken("MMMM", 0, 0, function(format3) {
        return this.localeData().months(this, format3);
      });
      addRegexToken("M", match1to2, match1to2NoLeadingZero);
      addRegexToken("MM", match1to2, match2);
      addRegexToken("MMM", function(isStrict, locale2) {
        return locale2.monthsShortRegex(isStrict);
      });
      addRegexToken("MMMM", function(isStrict, locale2) {
        return locale2.monthsRegex(isStrict);
      });
      addParseToken(["M", "MM"], function(input, array) {
        array[MONTH] = toInt(input) - 1;
      });
      addParseToken(["MMM", "MMMM"], function(input, array, config, token3) {
        var month = config._locale.monthsParse(input, token3, config._strict);
        if (month != null) {
          array[MONTH] = month;
        } else {
          getParsingFlags(config).invalidMonth = input;
        }
      });
      var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
        "_"
      ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
      function localeMonths(m, format3) {
        if (!m) {
          return isArray(this._months) ? this._months : this._months["standalone"];
        }
        return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format3) ? "format" : "standalone"][m.month()];
      }
      function localeMonthsShort(m, format3) {
        if (!m) {
          return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
        }
        return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format3) ? "format" : "standalone"][m.month()];
      }
      function handleStrictParse(monthName, format3, strict) {
        var i3, ii, mom, llc = monthName.toLocaleLowerCase();
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
          for (i3 = 0; i3 < 12; ++i3) {
            mom = createUTC([2e3, i3]);
            this._shortMonthsParse[i3] = this.monthsShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._longMonthsParse[i3] = this.months(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format3 === "MMM") {
            ii = indexOf.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format3 === "MMM") {
            ii = indexOf.call(this._shortMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._longMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeMonthsParse(monthName, format3, strict) {
        var i3, mom, regex;
        if (this._monthsParseExact) {
          return handleStrictParse.call(this, monthName, format3, strict);
        }
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
        }
        for (i3 = 0; i3 < 12; i3++) {
          mom = createUTC([2e3, i3]);
          if (strict && !this._longMonthsParse[i3]) {
            this._longMonthsParse[i3] = new RegExp(
              "^" + this.months(mom, "").replace(".", "") + "$",
              "i"
            );
            this._shortMonthsParse[i3] = new RegExp(
              "^" + this.monthsShort(mom, "").replace(".", "") + "$",
              "i"
            );
          }
          if (!strict && !this._monthsParse[i3]) {
            regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
            this._monthsParse[i3] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format3 === "MMMM" && this._longMonthsParse[i3].test(monthName)) {
            return i3;
          } else if (strict && format3 === "MMM" && this._shortMonthsParse[i3].test(monthName)) {
            return i3;
          } else if (!strict && this._monthsParse[i3].test(monthName)) {
            return i3;
          }
        }
      }
      function setMonth(mom, value) {
        if (!mom.isValid()) {
          return mom;
        }
        if (typeof value === "string") {
          if (/^\d+$/.test(value)) {
            value = toInt(value);
          } else {
            value = mom.localeData().monthsParse(value);
            if (!isNumber(value)) {
              return mom;
            }
          }
        }
        var month = value, date = mom.date();
        date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
        void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
        return mom;
      }
      function getSetMonth(value) {
        if (value != null) {
          setMonth(this, value);
          hooks.updateOffset(this, true);
          return this;
        } else {
          return get(this, "Month");
        }
      }
      function getDaysInMonth() {
        return daysInMonth(this.year(), this.month());
      }
      function monthsShortRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsShortStrictRegex;
          } else {
            return this._monthsShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsShortRegex")) {
            this._monthsShortRegex = defaultMonthsShortRegex;
          }
          return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
        }
      }
      function monthsRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsStrictRegex;
          } else {
            return this._monthsRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsRegex")) {
            this._monthsRegex = defaultMonthsRegex;
          }
          return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
        }
      }
      function computeMonthsParse() {
        function cmpLenRev(a, b3) {
          return b3.length - a.length;
        }
        var shortPieces = [], longPieces = [], mixedPieces = [], i3, mom, shortP, longP;
        for (i3 = 0; i3 < 12; i3++) {
          mom = createUTC([2e3, i3]);
          shortP = regexEscape2(this.monthsShort(mom, ""));
          longP = regexEscape2(this.months(mom, ""));
          shortPieces.push(shortP);
          longPieces.push(longP);
          mixedPieces.push(longP);
          mixedPieces.push(shortP);
        }
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._monthsShortRegex = this._monthsRegex;
        this._monthsStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._monthsShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
      }
      function createDate(y3, m, d3, h3, M, s, ms) {
        var date;
        if (y3 < 100 && y3 >= 0) {
          date = new Date(y3 + 400, m, d3, h3, M, s, ms);
          if (isFinite(date.getFullYear())) {
            date.setFullYear(y3);
          }
        } else {
          date = new Date(y3, m, d3, h3, M, s, ms);
        }
        return date;
      }
      function createUTCDate(y3) {
        var date, args;
        if (y3 < 100 && y3 >= 0) {
          args = Array.prototype.slice.call(arguments);
          args[0] = y3 + 400;
          date = new Date(Date.UTC.apply(null, args));
          if (isFinite(date.getUTCFullYear())) {
            date.setUTCFullYear(y3);
          }
        } else {
          date = new Date(Date.UTC.apply(null, arguments));
        }
        return date;
      }
      function firstWeekOffset(year, dow, doy) {
        var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
        return -fwdlw + fwd - 1;
      }
      function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
        var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
        if (dayOfYear <= 0) {
          resYear = year - 1;
          resDayOfYear = daysInYear(resYear) + dayOfYear;
        } else if (dayOfYear > daysInYear(year)) {
          resYear = year + 1;
          resDayOfYear = dayOfYear - daysInYear(year);
        } else {
          resYear = year;
          resDayOfYear = dayOfYear;
        }
        return {
          year: resYear,
          dayOfYear: resDayOfYear
        };
      }
      function weekOfYear(mom, dow, doy) {
        var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
        if (week < 1) {
          resYear = mom.year() - 1;
          resWeek = week + weeksInYear(resYear, dow, doy);
        } else if (week > weeksInYear(mom.year(), dow, doy)) {
          resWeek = week - weeksInYear(mom.year(), dow, doy);
          resYear = mom.year() + 1;
        } else {
          resYear = mom.year();
          resWeek = week;
        }
        return {
          week: resWeek,
          year: resYear
        };
      }
      function weeksInYear(year, dow, doy) {
        var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
      }
      addFormatToken("w", ["ww", 2], "wo", "week");
      addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
      addRegexToken("w", match1to2, match1to2NoLeadingZero);
      addRegexToken("ww", match1to2, match2);
      addRegexToken("W", match1to2, match1to2NoLeadingZero);
      addRegexToken("WW", match1to2, match2);
      addWeekParseToken(
        ["w", "ww", "W", "WW"],
        function(input, week, config, token3) {
          week[token3.substr(0, 1)] = toInt(input);
        }
      );
      function localeWeek(mom) {
        return weekOfYear(mom, this._week.dow, this._week.doy).week;
      }
      var defaultLocaleWeek = {
        dow: 0,
        // Sunday is the first day of the week.
        doy: 6
        // The week that contains Jan 6th is the first week of the year.
      };
      function localeFirstDayOfWeek() {
        return this._week.dow;
      }
      function localeFirstDayOfYear() {
        return this._week.doy;
      }
      function getSetWeek(input) {
        var week = this.localeData().week(this);
        return input == null ? week : this.add((input - week) * 7, "d");
      }
      function getSetISOWeek(input) {
        var week = weekOfYear(this, 1, 4).week;
        return input == null ? week : this.add((input - week) * 7, "d");
      }
      addFormatToken("d", 0, "do", "day");
      addFormatToken("dd", 0, 0, function(format3) {
        return this.localeData().weekdaysMin(this, format3);
      });
      addFormatToken("ddd", 0, 0, function(format3) {
        return this.localeData().weekdaysShort(this, format3);
      });
      addFormatToken("dddd", 0, 0, function(format3) {
        return this.localeData().weekdays(this, format3);
      });
      addFormatToken("e", 0, 0, "weekday");
      addFormatToken("E", 0, 0, "isoWeekday");
      addRegexToken("d", match1to2);
      addRegexToken("e", match1to2);
      addRegexToken("E", match1to2);
      addRegexToken("dd", function(isStrict, locale2) {
        return locale2.weekdaysMinRegex(isStrict);
      });
      addRegexToken("ddd", function(isStrict, locale2) {
        return locale2.weekdaysShortRegex(isStrict);
      });
      addRegexToken("dddd", function(isStrict, locale2) {
        return locale2.weekdaysRegex(isStrict);
      });
      addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token3) {
        var weekday = config._locale.weekdaysParse(input, token3, config._strict);
        if (weekday != null) {
          week.d = weekday;
        } else {
          getParsingFlags(config).invalidWeekday = input;
        }
      });
      addWeekParseToken(["d", "e", "E"], function(input, week, config, token3) {
        week[token3] = toInt(input);
      });
      function parseWeekday(input, locale2) {
        if (typeof input !== "string") {
          return input;
        }
        if (!isNaN(input)) {
          return parseInt(input, 10);
        }
        input = locale2.weekdaysParse(input);
        if (typeof input === "number") {
          return input;
        }
        return null;
      }
      function parseIsoWeekday(input, locale2) {
        if (typeof input === "string") {
          return locale2.weekdaysParse(input) % 7 || 7;
        }
        return isNaN(input) ? null : input;
      }
      function shiftWeekdays(ws, n3) {
        return ws.slice(n3, 7).concat(ws.slice(0, n3));
      }
      var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
      function localeWeekdays(m, format3) {
        var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format3) ? "format" : "standalone"];
        return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
      }
      function localeWeekdaysShort(m) {
        return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
      }
      function localeWeekdaysMin(m) {
        return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
      }
      function handleStrictParse$1(weekdayName, format3, strict) {
        var i3, ii, mom, llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._minWeekdaysParse = [];
          for (i3 = 0; i3 < 7; ++i3) {
            mom = createUTC([2e3, 1]).day(i3);
            this._minWeekdaysParse[i3] = this.weekdaysMin(
              mom,
              ""
            ).toLocaleLowerCase();
            this._shortWeekdaysParse[i3] = this.weekdaysShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._weekdaysParse[i3] = this.weekdays(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format3 === "dddd") {
            ii = indexOf.call(this._weekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format3 === "ddd") {
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format3 === "dddd") {
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format3 === "ddd") {
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._minWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeWeekdaysParse(weekdayName, format3, strict) {
        var i3, mom, regex;
        if (this._weekdaysParseExact) {
          return handleStrictParse$1.call(this, weekdayName, format3, strict);
        }
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._minWeekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._fullWeekdaysParse = [];
        }
        for (i3 = 0; i3 < 7; i3++) {
          mom = createUTC([2e3, 1]).day(i3);
          if (strict && !this._fullWeekdaysParse[i3]) {
            this._fullWeekdaysParse[i3] = new RegExp(
              "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._shortWeekdaysParse[i3] = new RegExp(
              "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._minWeekdaysParse[i3] = new RegExp(
              "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
          }
          if (!this._weekdaysParse[i3]) {
            regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
            this._weekdaysParse[i3] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format3 === "dddd" && this._fullWeekdaysParse[i3].test(weekdayName)) {
            return i3;
          } else if (strict && format3 === "ddd" && this._shortWeekdaysParse[i3].test(weekdayName)) {
            return i3;
          } else if (strict && format3 === "dd" && this._minWeekdaysParse[i3].test(weekdayName)) {
            return i3;
          } else if (!strict && this._weekdaysParse[i3].test(weekdayName)) {
            return i3;
          }
        }
      }
      function getSetDayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        var day = get(this, "Day");
        if (input != null) {
          input = parseWeekday(input, this.localeData());
          return this.add(input - day, "d");
        } else {
          return day;
        }
      }
      function getSetLocaleDayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
        return input == null ? weekday : this.add(input - weekday, "d");
      }
      function getSetISODayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        if (input != null) {
          var weekday = parseIsoWeekday(input, this.localeData());
          return this.day(this.day() % 7 ? weekday : weekday - 7);
        } else {
          return this.day() || 7;
        }
      }
      function weekdaysRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysStrictRegex;
          } else {
            return this._weekdaysRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            this._weekdaysRegex = defaultWeekdaysRegex;
          }
          return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
        }
      }
      function weekdaysShortRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysShortStrictRegex;
          } else {
            return this._weekdaysShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysShortRegex")) {
            this._weekdaysShortRegex = defaultWeekdaysShortRegex;
          }
          return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
        }
      }
      function weekdaysMinRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysMinStrictRegex;
          } else {
            return this._weekdaysMinRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysMinRegex")) {
            this._weekdaysMinRegex = defaultWeekdaysMinRegex;
          }
          return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
        }
      }
      function computeWeekdaysParse() {
        function cmpLenRev(a, b3) {
          return b3.length - a.length;
        }
        var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i3, mom, minp, shortp, longp;
        for (i3 = 0; i3 < 7; i3++) {
          mom = createUTC([2e3, 1]).day(i3);
          minp = regexEscape2(this.weekdaysMin(mom, ""));
          shortp = regexEscape2(this.weekdaysShort(mom, ""));
          longp = regexEscape2(this.weekdays(mom, ""));
          minPieces.push(minp);
          shortPieces.push(shortp);
          longPieces.push(longp);
          mixedPieces.push(minp);
          mixedPieces.push(shortp);
          mixedPieces.push(longp);
        }
        minPieces.sort(cmpLenRev);
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._weekdaysShortRegex = this._weekdaysRegex;
        this._weekdaysMinRegex = this._weekdaysRegex;
        this._weekdaysStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._weekdaysShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
        this._weekdaysMinStrictRegex = new RegExp(
          "^(" + minPieces.join("|") + ")",
          "i"
        );
      }
      function hFormat() {
        return this.hours() % 12 || 12;
      }
      function kFormat() {
        return this.hours() || 24;
      }
      addFormatToken("H", ["HH", 2], 0, "hour");
      addFormatToken("h", ["hh", 2], 0, hFormat);
      addFormatToken("k", ["kk", 2], 0, kFormat);
      addFormatToken("hmm", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
      });
      addFormatToken("hmmss", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      addFormatToken("Hmm", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2);
      });
      addFormatToken("Hmmss", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      function meridiem(token3, lowercase) {
        addFormatToken(token3, 0, 0, function() {
          return this.localeData().meridiem(
            this.hours(),
            this.minutes(),
            lowercase
          );
        });
      }
      meridiem("a", true);
      meridiem("A", false);
      function matchMeridiem(isStrict, locale2) {
        return locale2._meridiemParse;
      }
      addRegexToken("a", matchMeridiem);
      addRegexToken("A", matchMeridiem);
      addRegexToken("H", match1to2, match1to2HasZero);
      addRegexToken("h", match1to2, match1to2NoLeadingZero);
      addRegexToken("k", match1to2, match1to2NoLeadingZero);
      addRegexToken("HH", match1to2, match2);
      addRegexToken("hh", match1to2, match2);
      addRegexToken("kk", match1to2, match2);
      addRegexToken("hmm", match3to4);
      addRegexToken("hmmss", match5to6);
      addRegexToken("Hmm", match3to4);
      addRegexToken("Hmmss", match5to6);
      addParseToken(["H", "HH"], HOUR);
      addParseToken(["k", "kk"], function(input, array, config) {
        var kInput = toInt(input);
        array[HOUR] = kInput === 24 ? 0 : kInput;
      });
      addParseToken(["a", "A"], function(input, array, config) {
        config._isPm = config._locale.isPM(input);
        config._meridiem = input;
      });
      addParseToken(["h", "hh"], function(input, array, config) {
        array[HOUR] = toInt(input);
        getParsingFlags(config).bigHour = true;
      });
      addParseToken("hmm", function(input, array, config) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
        getParsingFlags(config).bigHour = true;
      });
      addParseToken("hmmss", function(input, array, config) {
        var pos1 = input.length - 4, pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
        getParsingFlags(config).bigHour = true;
      });
      addParseToken("Hmm", function(input, array, config) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
      });
      addParseToken("Hmmss", function(input, array, config) {
        var pos1 = input.length - 4, pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
      });
      function localeIsPM(input) {
        return (input + "").toLowerCase().charAt(0) === "p";
      }
      var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
      function localeMeridiem(hours2, minutes2, isLower) {
        if (hours2 > 11) {
          return isLower ? "pm" : "PM";
        } else {
          return isLower ? "am" : "AM";
        }
      }
      var baseConfig = {
        calendar: defaultCalendar,
        longDateFormat: defaultLongDateFormat,
        invalidDate: defaultInvalidDate,
        ordinal: defaultOrdinal,
        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
        relativeTime: defaultRelativeTime,
        months: defaultLocaleMonths,
        monthsShort: defaultLocaleMonthsShort,
        week: defaultLocaleWeek,
        weekdays: defaultLocaleWeekdays,
        weekdaysMin: defaultLocaleWeekdaysMin,
        weekdaysShort: defaultLocaleWeekdaysShort,
        meridiemParse: defaultLocaleMeridiemParse
      };
      var locales = {}, localeFamilies = {}, globalLocale;
      function commonPrefix(arr1, arr2) {
        var i3, minl = Math.min(arr1.length, arr2.length);
        for (i3 = 0; i3 < minl; i3 += 1) {
          if (arr1[i3] !== arr2[i3]) {
            return i3;
          }
        }
        return minl;
      }
      function normalizeLocale(key) {
        return key ? key.toLowerCase().replace("_", "-") : key;
      }
      function chooseLocale(names) {
        var i3 = 0, j3, next, locale2, split;
        while (i3 < names.length) {
          split = normalizeLocale(names[i3]).split("-");
          j3 = split.length;
          next = normalizeLocale(names[i3 + 1]);
          next = next ? next.split("-") : null;
          while (j3 > 0) {
            locale2 = loadLocale(split.slice(0, j3).join("-"));
            if (locale2) {
              return locale2;
            }
            if (next && next.length >= j3 && commonPrefix(split, next) >= j3 - 1) {
              break;
            }
            j3--;
          }
          i3++;
        }
        return globalLocale;
      }
      function isLocaleNameSane(name) {
        return !!(name && name.match("^[^/\\\\]*$"));
      }
      function loadLocale(name) {
        var oldLocale = null, aliasedRequire;
        if (locales[name] === void 0 && typeof module2 !== "undefined" && module2 && module2.exports && isLocaleNameSane(name)) {
          try {
            oldLocale = globalLocale._abbr;
            aliasedRequire = __require;
            aliasedRequire("./locale/" + name);
            getSetGlobalLocale(oldLocale);
          } catch (e3) {
            locales[name] = null;
          }
        }
        return locales[name];
      }
      function getSetGlobalLocale(key, values) {
        var data;
        if (key) {
          if (isUndefined(values)) {
            data = getLocale(key);
          } else {
            data = defineLocale(key, values);
          }
          if (data) {
            globalLocale = data;
          } else {
            if (typeof console !== "undefined" && console.warn) {
              console.warn(
                "Locale " + key + " not found. Did you forget to load it?"
              );
            }
          }
        }
        return globalLocale._abbr;
      }
      function defineLocale(name, config) {
        if (config !== null) {
          var locale2, parentConfig = baseConfig;
          config.abbr = name;
          if (locales[name] != null) {
            deprecateSimple(
              "defineLocaleOverride",
              "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
            );
            parentConfig = locales[name]._config;
          } else if (config.parentLocale != null) {
            if (locales[config.parentLocale] != null) {
              parentConfig = locales[config.parentLocale]._config;
            } else {
              locale2 = loadLocale(config.parentLocale);
              if (locale2 != null) {
                parentConfig = locale2._config;
              } else {
                if (!localeFamilies[config.parentLocale]) {
                  localeFamilies[config.parentLocale] = [];
                }
                localeFamilies[config.parentLocale].push({
                  name,
                  config
                });
                return null;
              }
            }
          }
          locales[name] = new Locale(mergeConfigs(parentConfig, config));
          if (localeFamilies[name]) {
            localeFamilies[name].forEach(function(x3) {
              defineLocale(x3.name, x3.config);
            });
          }
          getSetGlobalLocale(name);
          return locales[name];
        } else {
          delete locales[name];
          return null;
        }
      }
      function updateLocale(name, config) {
        if (config != null) {
          var locale2, tmpLocale, parentConfig = baseConfig;
          if (locales[name] != null && locales[name].parentLocale != null) {
            locales[name].set(mergeConfigs(locales[name]._config, config));
          } else {
            tmpLocale = loadLocale(name);
            if (tmpLocale != null) {
              parentConfig = tmpLocale._config;
            }
            config = mergeConfigs(parentConfig, config);
            if (tmpLocale == null) {
              config.abbr = name;
            }
            locale2 = new Locale(config);
            locale2.parentLocale = locales[name];
            locales[name] = locale2;
          }
          getSetGlobalLocale(name);
        } else {
          if (locales[name] != null) {
            if (locales[name].parentLocale != null) {
              locales[name] = locales[name].parentLocale;
              if (name === getSetGlobalLocale()) {
                getSetGlobalLocale(name);
              }
            } else if (locales[name] != null) {
              delete locales[name];
            }
          }
        }
        return locales[name];
      }
      function getLocale(key) {
        var locale2;
        if (key && key._locale && key._locale._abbr) {
          key = key._locale._abbr;
        }
        if (!key) {
          return globalLocale;
        }
        if (!isArray(key)) {
          locale2 = loadLocale(key);
          if (locale2) {
            return locale2;
          }
          key = [key];
        }
        return chooseLocale(key);
      }
      function listLocales() {
        return keys(locales);
      }
      function checkOverflow(m) {
        var overflow, a = m._a;
        if (a && getParsingFlags(m).overflow === -2) {
          overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
          if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
            overflow = DATE;
          }
          if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
            overflow = WEEK;
          }
          if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
            overflow = WEEKDAY;
          }
          getParsingFlags(m).overflow = overflow;
        }
        return m;
      }
      var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
        ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
        ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
        ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
        ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
        ["YYYY-DDD", /\d{4}-\d{3}/],
        ["YYYY-MM", /\d{4}-\d\d/, false],
        ["YYYYYYMMDD", /[+-]\d{10}/],
        ["YYYYMMDD", /\d{8}/],
        ["GGGG[W]WWE", /\d{4}W\d{3}/],
        ["GGGG[W]WW", /\d{4}W\d{2}/, false],
        ["YYYYDDD", /\d{7}/],
        ["YYYYMM", /\d{6}/, false],
        ["YYYY", /\d{4}/, false]
      ], isoTimes = [
        ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
        ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
        ["HH:mm:ss", /\d\d:\d\d:\d\d/],
        ["HH:mm", /\d\d:\d\d/],
        ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
        ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
        ["HHmmss", /\d\d\d\d\d\d/],
        ["HHmm", /\d\d\d\d/],
        ["HH", /\d\d/]
      ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
        UT: 0,
        GMT: 0,
        EDT: -4 * 60,
        EST: -5 * 60,
        CDT: -5 * 60,
        CST: -6 * 60,
        MDT: -6 * 60,
        MST: -7 * 60,
        PDT: -7 * 60,
        PST: -8 * 60
      };
      function configFromISO(config) {
        var i3, l3, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
        if (match) {
          getParsingFlags(config).iso = true;
          for (i3 = 0, l3 = isoDatesLen; i3 < l3; i3++) {
            if (isoDates[i3][1].exec(match[1])) {
              dateFormat = isoDates[i3][0];
              allowTime = isoDates[i3][2] !== false;
              break;
            }
          }
          if (dateFormat == null) {
            config._isValid = false;
            return;
          }
          if (match[3]) {
            for (i3 = 0, l3 = isoTimesLen; i3 < l3; i3++) {
              if (isoTimes[i3][1].exec(match[3])) {
                timeFormat = (match[2] || " ") + isoTimes[i3][0];
                break;
              }
            }
            if (timeFormat == null) {
              config._isValid = false;
              return;
            }
          }
          if (!allowTime && timeFormat != null) {
            config._isValid = false;
            return;
          }
          if (match[4]) {
            if (tzRegex.exec(match[4])) {
              tzFormat = "Z";
            } else {
              config._isValid = false;
              return;
            }
          }
          config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
          configFromStringAndFormat(config);
        } else {
          config._isValid = false;
        }
      }
      function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
        var result = [
          untruncateYear(yearStr),
          defaultLocaleMonthsShort.indexOf(monthStr),
          parseInt(dayStr, 10),
          parseInt(hourStr, 10),
          parseInt(minuteStr, 10)
        ];
        if (secondStr) {
          result.push(parseInt(secondStr, 10));
        }
        return result;
      }
      function untruncateYear(yearStr) {
        var year = parseInt(yearStr, 10);
        if (year <= 49) {
          return 2e3 + year;
        } else if (year <= 999) {
          return 1900 + year;
        }
        return year;
      }
      function preprocessRFC2822(s) {
        return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
      }
      function checkWeekday(weekdayStr, parsedInput, config) {
        if (weekdayStr) {
          var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
            parsedInput[0],
            parsedInput[1],
            parsedInput[2]
          ).getDay();
          if (weekdayProvided !== weekdayActual) {
            getParsingFlags(config).weekdayMismatch = true;
            config._isValid = false;
            return false;
          }
        }
        return true;
      }
      function calculateOffset(obsOffset, militaryOffset, numOffset) {
        if (obsOffset) {
          return obsOffsets[obsOffset];
        } else if (militaryOffset) {
          return 0;
        } else {
          var hm = parseInt(numOffset, 10), m = hm % 100, h3 = (hm - m) / 100;
          return h3 * 60 + m;
        }
      }
      function configFromRFC2822(config) {
        var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
        if (match) {
          parsedArray = extractFromRFC2822Strings(
            match[4],
            match[3],
            match[2],
            match[5],
            match[6],
            match[7]
          );
          if (!checkWeekday(match[1], parsedArray, config)) {
            return;
          }
          config._a = parsedArray;
          config._tzm = calculateOffset(match[8], match[9], match[10]);
          config._d = createUTCDate.apply(null, config._a);
          config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
          getParsingFlags(config).rfc2822 = true;
        } else {
          config._isValid = false;
        }
      }
      function configFromString(config) {
        var matched = aspNetJsonRegex.exec(config._i);
        if (matched !== null) {
          config._d = /* @__PURE__ */ new Date(+matched[1]);
          return;
        }
        configFromISO(config);
        if (config._isValid === false) {
          delete config._isValid;
        } else {
          return;
        }
        configFromRFC2822(config);
        if (config._isValid === false) {
          delete config._isValid;
        } else {
          return;
        }
        if (config._strict) {
          config._isValid = false;
        } else {
          hooks.createFromInputFallback(config);
        }
      }
      hooks.createFromInputFallback = deprecate(
        "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
        function(config) {
          config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
        }
      );
      function defaults(a, b3, c3) {
        if (a != null) {
          return a;
        }
        if (b3 != null) {
          return b3;
        }
        return c3;
      }
      function currentDateArray(config) {
        var nowValue = new Date(hooks.now());
        if (config._useUTC) {
          return [
            nowValue.getUTCFullYear(),
            nowValue.getUTCMonth(),
            nowValue.getUTCDate()
          ];
        }
        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
      }
      function configFromArray(config) {
        var i3, date, input = [], currentDate, expectedWeekday, yearToUse;
        if (config._d) {
          return;
        }
        currentDate = currentDateArray(config);
        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
          dayOfYearFromWeekInfo(config);
        }
        if (config._dayOfYear != null) {
          yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
          if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
            getParsingFlags(config)._overflowDayOfYear = true;
          }
          date = createUTCDate(yearToUse, 0, config._dayOfYear);
          config._a[MONTH] = date.getUTCMonth();
          config._a[DATE] = date.getUTCDate();
        }
        for (i3 = 0; i3 < 3 && config._a[i3] == null; ++i3) {
          config._a[i3] = input[i3] = currentDate[i3];
        }
        for (; i3 < 7; i3++) {
          config._a[i3] = input[i3] = config._a[i3] == null ? i3 === 2 ? 1 : 0 : config._a[i3];
        }
        if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
          config._nextDay = true;
          config._a[HOUR] = 0;
        }
        config._d = (config._useUTC ? createUTCDate : createDate).apply(
          null,
          input
        );
        expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
        if (config._tzm != null) {
          config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
        }
        if (config._nextDay) {
          config._a[HOUR] = 24;
        }
        if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
          getParsingFlags(config).weekdayMismatch = true;
        }
      }
      function dayOfYearFromWeekInfo(config) {
        var w5, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
        w5 = config._w;
        if (w5.GG != null || w5.W != null || w5.E != null) {
          dow = 1;
          doy = 4;
          weekYear = defaults(
            w5.GG,
            config._a[YEAR],
            weekOfYear(createLocal(), 1, 4).year
          );
          week = defaults(w5.W, 1);
          weekday = defaults(w5.E, 1);
          if (weekday < 1 || weekday > 7) {
            weekdayOverflow = true;
          }
        } else {
          dow = config._locale._week.dow;
          doy = config._locale._week.doy;
          curWeek = weekOfYear(createLocal(), dow, doy);
          weekYear = defaults(w5.gg, config._a[YEAR], curWeek.year);
          week = defaults(w5.w, curWeek.week);
          if (w5.d != null) {
            weekday = w5.d;
            if (weekday < 0 || weekday > 6) {
              weekdayOverflow = true;
            }
          } else if (w5.e != null) {
            weekday = w5.e + dow;
            if (w5.e < 0 || w5.e > 6) {
              weekdayOverflow = true;
            }
          } else {
            weekday = dow;
          }
        }
        if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
          getParsingFlags(config)._overflowWeeks = true;
        } else if (weekdayOverflow != null) {
          getParsingFlags(config)._overflowWeekday = true;
        } else {
          temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
          config._a[YEAR] = temp.year;
          config._dayOfYear = temp.dayOfYear;
        }
      }
      hooks.ISO_8601 = function() {
      };
      hooks.RFC_2822 = function() {
      };
      function configFromStringAndFormat(config) {
        if (config._f === hooks.ISO_8601) {
          configFromISO(config);
          return;
        }
        if (config._f === hooks.RFC_2822) {
          configFromRFC2822(config);
          return;
        }
        config._a = [];
        getParsingFlags(config).empty = true;
        var string = "" + config._i, i3, parsedInput, tokens2, token3, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
        tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
        tokenLen = tokens2.length;
        for (i3 = 0; i3 < tokenLen; i3++) {
          token3 = tokens2[i3];
          parsedInput = (string.match(getParseRegexForToken(token3, config)) || [])[0];
          if (parsedInput) {
            skipped = string.substr(0, string.indexOf(parsedInput));
            if (skipped.length > 0) {
              getParsingFlags(config).unusedInput.push(skipped);
            }
            string = string.slice(
              string.indexOf(parsedInput) + parsedInput.length
            );
            totalParsedInputLength += parsedInput.length;
          }
          if (formatTokenFunctions[token3]) {
            if (parsedInput) {
              getParsingFlags(config).empty = false;
            } else {
              getParsingFlags(config).unusedTokens.push(token3);
            }
            addTimeToArrayFromToken(token3, parsedInput, config);
          } else if (config._strict && !parsedInput) {
            getParsingFlags(config).unusedTokens.push(token3);
          }
        }
        getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
        if (string.length > 0) {
          getParsingFlags(config).unusedInput.push(string);
        }
        if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
          getParsingFlags(config).bigHour = void 0;
        }
        getParsingFlags(config).parsedDateParts = config._a.slice(0);
        getParsingFlags(config).meridiem = config._meridiem;
        config._a[HOUR] = meridiemFixWrap(
          config._locale,
          config._a[HOUR],
          config._meridiem
        );
        era = getParsingFlags(config).era;
        if (era !== null) {
          config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
        }
        configFromArray(config);
        checkOverflow(config);
      }
      function meridiemFixWrap(locale2, hour, meridiem2) {
        var isPm;
        if (meridiem2 == null) {
          return hour;
        }
        if (locale2.meridiemHour != null) {
          return locale2.meridiemHour(hour, meridiem2);
        } else if (locale2.isPM != null) {
          isPm = locale2.isPM(meridiem2);
          if (isPm && hour < 12) {
            hour += 12;
          }
          if (!isPm && hour === 12) {
            hour = 0;
          }
          return hour;
        } else {
          return hour;
        }
      }
      function configFromStringAndArray(config) {
        var tempConfig, bestMoment, scoreToBeat, i3, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
        if (configfLen === 0) {
          getParsingFlags(config).invalidFormat = true;
          config._d = /* @__PURE__ */ new Date(NaN);
          return;
        }
        for (i3 = 0; i3 < configfLen; i3++) {
          currentScore = 0;
          validFormatFound = false;
          tempConfig = copyConfig({}, config);
          if (config._useUTC != null) {
            tempConfig._useUTC = config._useUTC;
          }
          tempConfig._f = config._f[i3];
          configFromStringAndFormat(tempConfig);
          if (isValid(tempConfig)) {
            validFormatFound = true;
          }
          currentScore += getParsingFlags(tempConfig).charsLeftOver;
          currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
          getParsingFlags(tempConfig).score = currentScore;
          if (!bestFormatIsValid) {
            if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
              if (validFormatFound) {
                bestFormatIsValid = true;
              }
            }
          } else {
            if (currentScore < scoreToBeat) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
            }
          }
        }
        extend(config, bestMoment || tempConfig);
      }
      function configFromObject(config) {
        if (config._d) {
          return;
        }
        var i3 = normalizeObjectUnits(config._i), dayOrDate = i3.day === void 0 ? i3.date : i3.day;
        config._a = map(
          [i3.year, i3.month, dayOrDate, i3.hour, i3.minute, i3.second, i3.millisecond],
          function(obj) {
            return obj && parseInt(obj, 10);
          }
        );
        configFromArray(config);
      }
      function createFromConfig(config) {
        var res = new Moment(checkOverflow(prepareConfig(config)));
        if (res._nextDay) {
          res.add(1, "d");
          res._nextDay = void 0;
        }
        return res;
      }
      function prepareConfig(config) {
        var input = config._i, format3 = config._f;
        config._locale = config._locale || getLocale(config._l);
        if (input === null || format3 === void 0 && input === "") {
          return createInvalid({ nullInput: true });
        }
        if (typeof input === "string") {
          config._i = input = config._locale.preparse(input);
        }
        if (isMoment(input)) {
          return new Moment(checkOverflow(input));
        } else if (isDate(input)) {
          config._d = input;
        } else if (isArray(format3)) {
          configFromStringAndArray(config);
        } else if (format3) {
          configFromStringAndFormat(config);
        } else {
          configFromInput(config);
        }
        if (!isValid(config)) {
          config._d = null;
        }
        return config;
      }
      function configFromInput(config) {
        var input = config._i;
        if (isUndefined(input)) {
          config._d = new Date(hooks.now());
        } else if (isDate(input)) {
          config._d = new Date(input.valueOf());
        } else if (typeof input === "string") {
          configFromString(config);
        } else if (isArray(input)) {
          config._a = map(input.slice(0), function(obj) {
            return parseInt(obj, 10);
          });
          configFromArray(config);
        } else if (isObject(input)) {
          configFromObject(config);
        } else if (isNumber(input)) {
          config._d = new Date(input);
        } else {
          hooks.createFromInputFallback(config);
        }
      }
      function createLocalOrUTC(input, format3, locale2, strict, isUTC) {
        var c3 = {};
        if (format3 === true || format3 === false) {
          strict = format3;
          format3 = void 0;
        }
        if (locale2 === true || locale2 === false) {
          strict = locale2;
          locale2 = void 0;
        }
        if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
          input = void 0;
        }
        c3._isAMomentObject = true;
        c3._useUTC = c3._isUTC = isUTC;
        c3._l = locale2;
        c3._i = input;
        c3._f = format3;
        c3._strict = strict;
        return createFromConfig(c3);
      }
      function createLocal(input, format3, locale2, strict) {
        return createLocalOrUTC(input, format3, locale2, strict, false);
      }
      var prototypeMin = deprecate(
        "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other < this ? this : other;
          } else {
            return createInvalid();
          }
        }
      ), prototypeMax = deprecate(
        "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other > this ? this : other;
          } else {
            return createInvalid();
          }
        }
      );
      function pickBy(fn, moments) {
        var res, i3;
        if (moments.length === 1 && isArray(moments[0])) {
          moments = moments[0];
        }
        if (!moments.length) {
          return createLocal();
        }
        res = moments[0];
        for (i3 = 1; i3 < moments.length; ++i3) {
          if (!moments[i3].isValid() || moments[i3][fn](res)) {
            res = moments[i3];
          }
        }
        return res;
      }
      function min() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isBefore", args);
      }
      function max() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isAfter", args);
      }
      var now = function() {
        return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
      };
      var ordering = [
        "year",
        "quarter",
        "month",
        "week",
        "day",
        "hour",
        "minute",
        "second",
        "millisecond"
      ];
      function isDurationValid(m) {
        var key, unitHasDecimal = false, i3, orderLen = ordering.length;
        for (key in m) {
          if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
            return false;
          }
        }
        for (i3 = 0; i3 < orderLen; ++i3) {
          if (m[ordering[i3]]) {
            if (unitHasDecimal) {
              return false;
            }
            if (parseFloat(m[ordering[i3]]) !== toInt(m[ordering[i3]])) {
              unitHasDecimal = true;
            }
          }
        }
        return true;
      }
      function isValid$1() {
        return this._isValid;
      }
      function createInvalid$1() {
        return createDuration(NaN);
      }
      function Duration(duration) {
        var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
        this._isValid = isDurationValid(normalizedInput);
        this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
        minutes2 * 6e4 + // 1000 * 60
        hours2 * 1e3 * 60 * 60;
        this._days = +days2 + weeks2 * 7;
        this._months = +months2 + quarters * 3 + years2 * 12;
        this._data = {};
        this._locale = getLocale();
        this._bubble();
      }
      function isDuration(obj) {
        return obj instanceof Duration;
      }
      function absRound(number) {
        if (number < 0) {
          return Math.round(-1 * number) * -1;
        } else {
          return Math.round(number);
        }
      }
      function compareArrays(array1, array2, dontConvert) {
        var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i3;
        for (i3 = 0; i3 < len; i3++) {
          if (toInt(array1[i3]) !== toInt(array2[i3])) {
            diffs++;
          }
        }
        return diffs + lengthDiff;
      }
      function offset(token3, separator) {
        addFormatToken(token3, 0, 0, function() {
          var offset2 = this.utcOffset(), sign2 = "+";
          if (offset2 < 0) {
            offset2 = -offset2;
            sign2 = "-";
          }
          return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
        });
      }
      offset("Z", ":");
      offset("ZZ", "");
      addRegexToken("Z", matchShortOffset);
      addRegexToken("ZZ", matchShortOffset);
      addParseToken(["Z", "ZZ"], function(input, array, config) {
        config._useUTC = true;
        config._tzm = offsetFromString(matchShortOffset, input);
      });
      var chunkOffset = /([\+\-]|\d\d)/gi;
      function offsetFromString(matcher, string) {
        var matches = (string || "").match(matcher), chunk, parts, minutes2;
        if (matches === null) {
          return null;
        }
        chunk = matches[matches.length - 1] || [];
        parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
        minutes2 = +(parts[1] * 60) + toInt(parts[2]);
        return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
      }
      function cloneWithOffset(input, model) {
        var res, diff2;
        if (model._isUTC) {
          res = model.clone();
          diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
          res._d.setTime(res._d.valueOf() + diff2);
          hooks.updateOffset(res, false);
          return res;
        } else {
          return createLocal(input).local();
        }
      }
      function getDateOffset(m) {
        return -Math.round(m._d.getTimezoneOffset());
      }
      hooks.updateOffset = function() {
      };
      function getSetOffset(input, keepLocalTime, keepMinutes) {
        var offset2 = this._offset || 0, localAdjust;
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        if (input != null) {
          if (typeof input === "string") {
            input = offsetFromString(matchShortOffset, input);
            if (input === null) {
              return this;
            }
          } else if (Math.abs(input) < 16 && !keepMinutes) {
            input = input * 60;
          }
          if (!this._isUTC && keepLocalTime) {
            localAdjust = getDateOffset(this);
          }
          this._offset = input;
          this._isUTC = true;
          if (localAdjust != null) {
            this.add(localAdjust, "m");
          }
          if (offset2 !== input) {
            if (!keepLocalTime || this._changeInProgress) {
              addSubtract(
                this,
                createDuration(input - offset2, "m"),
                1,
                false
              );
            } else if (!this._changeInProgress) {
              this._changeInProgress = true;
              hooks.updateOffset(this, true);
              this._changeInProgress = null;
            }
          }
          return this;
        } else {
          return this._isUTC ? offset2 : getDateOffset(this);
        }
      }
      function getSetZone(input, keepLocalTime) {
        if (input != null) {
          if (typeof input !== "string") {
            input = -input;
          }
          this.utcOffset(input, keepLocalTime);
          return this;
        } else {
          return -this.utcOffset();
        }
      }
      function setOffsetToUTC(keepLocalTime) {
        return this.utcOffset(0, keepLocalTime);
      }
      function setOffsetToLocal(keepLocalTime) {
        if (this._isUTC) {
          this.utcOffset(0, keepLocalTime);
          this._isUTC = false;
          if (keepLocalTime) {
            this.subtract(getDateOffset(this), "m");
          }
        }
        return this;
      }
      function setOffsetToParsedOffset() {
        if (this._tzm != null) {
          this.utcOffset(this._tzm, false, true);
        } else if (typeof this._i === "string") {
          var tZone = offsetFromString(matchOffset, this._i);
          if (tZone != null) {
            this.utcOffset(tZone);
          } else {
            this.utcOffset(0, true);
          }
        }
        return this;
      }
      function hasAlignedHourOffset(input) {
        if (!this.isValid()) {
          return false;
        }
        input = input ? createLocal(input).utcOffset() : 0;
        return (this.utcOffset() - input) % 60 === 0;
      }
      function isDaylightSavingTime() {
        return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
      }
      function isDaylightSavingTimeShifted() {
        if (!isUndefined(this._isDSTShifted)) {
          return this._isDSTShifted;
        }
        var c3 = {}, other;
        copyConfig(c3, this);
        c3 = prepareConfig(c3);
        if (c3._a) {
          other = c3._isUTC ? createUTC(c3._a) : createLocal(c3._a);
          this._isDSTShifted = this.isValid() && compareArrays(c3._a, other.toArray()) > 0;
        } else {
          this._isDSTShifted = false;
        }
        return this._isDSTShifted;
      }
      function isLocal() {
        return this.isValid() ? !this._isUTC : false;
      }
      function isUtcOffset() {
        return this.isValid() ? this._isUTC : false;
      }
      function isUtc() {
        return this.isValid() ? this._isUTC && this._offset === 0 : false;
      }
      var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
      function createDuration(input, key) {
        var duration = input, match = null, sign2, ret, diffRes;
        if (isDuration(input)) {
          duration = {
            ms: input._milliseconds,
            d: input._days,
            M: input._months
          };
        } else if (isNumber(input) || !isNaN(+input)) {
          duration = {};
          if (key) {
            duration[key] = +input;
          } else {
            duration.milliseconds = +input;
          }
        } else if (match = aspNetRegex.exec(input)) {
          sign2 = match[1] === "-" ? -1 : 1;
          duration = {
            y: 0,
            d: toInt(match[DATE]) * sign2,
            h: toInt(match[HOUR]) * sign2,
            m: toInt(match[MINUTE]) * sign2,
            s: toInt(match[SECOND]) * sign2,
            ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
            // the millisecond decimal point is included in the match
          };
        } else if (match = isoRegex.exec(input)) {
          sign2 = match[1] === "-" ? -1 : 1;
          duration = {
            y: parseIso(match[2], sign2),
            M: parseIso(match[3], sign2),
            w: parseIso(match[4], sign2),
            d: parseIso(match[5], sign2),
            h: parseIso(match[6], sign2),
            m: parseIso(match[7], sign2),
            s: parseIso(match[8], sign2)
          };
        } else if (duration == null) {
          duration = {};
        } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
          diffRes = momentsDifference(
            createLocal(duration.from),
            createLocal(duration.to)
          );
          duration = {};
          duration.ms = diffRes.milliseconds;
          duration.M = diffRes.months;
        }
        ret = new Duration(duration);
        if (isDuration(input) && hasOwnProp(input, "_locale")) {
          ret._locale = input._locale;
        }
        if (isDuration(input) && hasOwnProp(input, "_isValid")) {
          ret._isValid = input._isValid;
        }
        return ret;
      }
      createDuration.fn = Duration.prototype;
      createDuration.invalid = createInvalid$1;
      function parseIso(inp, sign2) {
        var res = inp && parseFloat(inp.replace(",", "."));
        return (isNaN(res) ? 0 : res) * sign2;
      }
      function positiveMomentsDifference(base, other) {
        var res = {};
        res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
        if (base.clone().add(res.months, "M").isAfter(other)) {
          --res.months;
        }
        res.milliseconds = +other - +base.clone().add(res.months, "M");
        return res;
      }
      function momentsDifference(base, other) {
        var res;
        if (!(base.isValid() && other.isValid())) {
          return { milliseconds: 0, months: 0 };
        }
        other = cloneWithOffset(other, base);
        if (base.isBefore(other)) {
          res = positiveMomentsDifference(base, other);
        } else {
          res = positiveMomentsDifference(other, base);
          res.milliseconds = -res.milliseconds;
          res.months = -res.months;
        }
        return res;
      }
      function createAdder(direction, name) {
        return function(val, period) {
          var dur, tmp;
          if (period !== null && !isNaN(+period)) {
            deprecateSimple(
              name,
              "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
            );
            tmp = val;
            val = period;
            period = tmp;
          }
          dur = createDuration(val, period);
          addSubtract(this, dur, direction);
          return this;
        };
      }
      function addSubtract(mom, duration, isAdding, updateOffset) {
        var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
        if (!mom.isValid()) {
          return;
        }
        updateOffset = updateOffset == null ? true : updateOffset;
        if (months2) {
          setMonth(mom, get(mom, "Month") + months2 * isAdding);
        }
        if (days2) {
          set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
        }
        if (milliseconds2) {
          mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
        }
        if (updateOffset) {
          hooks.updateOffset(mom, days2 || months2);
        }
      }
      var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
      function isString(input) {
        return typeof input === "string" || input instanceof String;
      }
      function isMomentInput(input) {
        return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
      }
      function isMomentInputObject(input) {
        var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
          "years",
          "year",
          "y",
          "months",
          "month",
          "M",
          "days",
          "day",
          "d",
          "dates",
          "date",
          "D",
          "hours",
          "hour",
          "h",
          "minutes",
          "minute",
          "m",
          "seconds",
          "second",
          "s",
          "milliseconds",
          "millisecond",
          "ms"
        ], i3, property, propertyLen = properties.length;
        for (i3 = 0; i3 < propertyLen; i3 += 1) {
          property = properties[i3];
          propertyTest = propertyTest || hasOwnProp(input, property);
        }
        return objectTest && propertyTest;
      }
      function isNumberOrStringArray(input) {
        var arrayTest = isArray(input), dataTypeTest = false;
        if (arrayTest) {
          dataTypeTest = input.filter(function(item) {
            return !isNumber(item) && isString(input);
          }).length === 0;
        }
        return arrayTest && dataTypeTest;
      }
      function isCalendarSpec(input) {
        var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
          "sameDay",
          "nextDay",
          "lastDay",
          "nextWeek",
          "lastWeek",
          "sameElse"
        ], i3, property;
        for (i3 = 0; i3 < properties.length; i3 += 1) {
          property = properties[i3];
          propertyTest = propertyTest || hasOwnProp(input, property);
        }
        return objectTest && propertyTest;
      }
      function getCalendarFormat(myMoment, now2) {
        var diff2 = myMoment.diff(now2, "days", true);
        return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
      }
      function calendar$1(time, formats) {
        if (arguments.length === 1) {
          if (!arguments[0]) {
            time = void 0;
            formats = void 0;
          } else if (isMomentInput(arguments[0])) {
            time = arguments[0];
            formats = void 0;
          } else if (isCalendarSpec(arguments[0])) {
            formats = arguments[0];
            time = void 0;
          }
        }
        var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format3 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format3]) ? formats[format3].call(this, now2) : formats[format3]);
        return this.format(
          output || this.localeData().calendar(format3, this, createLocal(now2))
        );
      }
      function clone() {
        return new Moment(this);
      }
      function isAfter(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() > localInput.valueOf();
        } else {
          return localInput.valueOf() < this.clone().startOf(units).valueOf();
        }
      }
      function isBefore(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() < localInput.valueOf();
        } else {
          return this.clone().endOf(units).valueOf() < localInput.valueOf();
        }
      }
      function isBetween(from2, to2, units, inclusivity) {
        var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
          return false;
        }
        inclusivity = inclusivity || "()";
        return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
      }
      function isSame(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input), inputMs;
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() === localInput.valueOf();
        } else {
          inputMs = localInput.valueOf();
          return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
        }
      }
      function isSameOrAfter(input, units) {
        return this.isSame(input, units) || this.isAfter(input, units);
      }
      function isSameOrBefore(input, units) {
        return this.isSame(input, units) || this.isBefore(input, units);
      }
      function diff(input, units, asFloat) {
        var that, zoneDelta, output;
        if (!this.isValid()) {
          return NaN;
        }
        that = cloneWithOffset(input, this);
        if (!that.isValid()) {
          return NaN;
        }
        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
        units = normalizeUnits(units);
        switch (units) {
          case "year":
            output = monthDiff(this, that) / 12;
            break;
          case "month":
            output = monthDiff(this, that);
            break;
          case "quarter":
            output = monthDiff(this, that) / 3;
            break;
          case "second":
            output = (this - that) / 1e3;
            break;
          // 1000
          case "minute":
            output = (this - that) / 6e4;
            break;
          // 1000 * 60
          case "hour":
            output = (this - that) / 36e5;
            break;
          // 1000 * 60 * 60
          case "day":
            output = (this - that - zoneDelta) / 864e5;
            break;
          // 1000 * 60 * 60 * 24, negate dst
          case "week":
            output = (this - that - zoneDelta) / 6048e5;
            break;
          // 1000 * 60 * 60 * 24 * 7, negate dst
          default:
            output = this - that;
        }
        return asFloat ? output : absFloor(output);
      }
      function monthDiff(a, b3) {
        if (a.date() < b3.date()) {
          return -monthDiff(b3, a);
        }
        var wholeMonthDiff = (b3.year() - a.year()) * 12 + (b3.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
        if (b3 - anchor < 0) {
          anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
          adjust = (b3 - anchor) / (anchor - anchor2);
        } else {
          anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
          adjust = (b3 - anchor) / (anchor2 - anchor);
        }
        return -(wholeMonthDiff + adjust) || 0;
      }
      hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
      hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
      function toString() {
        return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
      }
      function toISOString(keepOffset) {
        if (!this.isValid()) {
          return null;
        }
        var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
        if (m.year() < 0 || m.year() > 9999) {
          return formatMoment(
            m,
            utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
          );
        }
        if (isFunction(Date.prototype.toISOString)) {
          if (utc) {
            return this.toDate().toISOString();
          } else {
            return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
          }
        }
        return formatMoment(
          m,
          utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
        );
      }
      function inspect() {
        if (!this.isValid()) {
          return "moment.invalid(/* " + this._i + " */)";
        }
        var func = "moment", zone = "", prefix, year, datetime, suffix;
        if (!this.isLocal()) {
          func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
          zone = "Z";
        }
        prefix = "[" + func + '("]';
        year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
        datetime = "-MM-DD[T]HH:mm:ss.SSS";
        suffix = zone + '[")]';
        return this.format(prefix + year + datetime + suffix);
      }
      function format2(inputString) {
        if (!inputString) {
          inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
        }
        var output = formatMoment(this, inputString);
        return this.localeData().postformat(output);
      }
      function from(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function fromNow(withoutSuffix) {
        return this.from(createLocal(), withoutSuffix);
      }
      function to(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function toNow(withoutSuffix) {
        return this.to(createLocal(), withoutSuffix);
      }
      function locale(key) {
        var newLocaleData;
        if (key === void 0) {
          return this._locale._abbr;
        } else {
          newLocaleData = getLocale(key);
          if (newLocaleData != null) {
            this._locale = newLocaleData;
          }
          return this;
        }
      }
      var lang = deprecate(
        "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
        function(key) {
          if (key === void 0) {
            return this.localeData();
          } else {
            return this.locale(key);
          }
        }
      );
      function localeData() {
        return this._locale;
      }
      var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
      function mod$1(dividend, divisor) {
        return (dividend % divisor + divisor) % divisor;
      }
      function localStartOfDate(y3, m, d3) {
        if (y3 < 100 && y3 >= 0) {
          return new Date(y3 + 400, m, d3) - MS_PER_400_YEARS;
        } else {
          return new Date(y3, m, d3).valueOf();
        }
      }
      function utcStartOfDate(y3, m, d3) {
        if (y3 < 100 && y3 >= 0) {
          return Date.UTC(y3 + 400, m, d3) - MS_PER_400_YEARS;
        } else {
          return Date.UTC(y3, m, d3);
        }
      }
      function startOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year(), 0, 1);
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3,
              1
            );
            break;
          case "month":
            time = startOfDate(this.year(), this.month(), 1);
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday()
            );
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1)
            );
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date());
            break;
          case "hour":
            time = this._d.valueOf();
            time -= mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            );
            break;
          case "minute":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_MINUTE);
            break;
          case "second":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_SECOND);
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function endOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year() + 1, 0, 1) - 1;
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3 + 3,
              1
            ) - 1;
            break;
          case "month":
            time = startOfDate(this.year(), this.month() + 1, 1) - 1;
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday() + 7
            ) - 1;
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1) + 7
            ) - 1;
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
            break;
          case "hour":
            time = this._d.valueOf();
            time += MS_PER_HOUR - mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            ) - 1;
            break;
          case "minute":
            time = this._d.valueOf();
            time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
            break;
          case "second":
            time = this._d.valueOf();
            time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function valueOf() {
        return this._d.valueOf() - (this._offset || 0) * 6e4;
      }
      function unix() {
        return Math.floor(this.valueOf() / 1e3);
      }
      function toDate2() {
        return new Date(this.valueOf());
      }
      function toArray() {
        var m = this;
        return [
          m.year(),
          m.month(),
          m.date(),
          m.hour(),
          m.minute(),
          m.second(),
          m.millisecond()
        ];
      }
      function toObject() {
        var m = this;
        return {
          years: m.year(),
          months: m.month(),
          date: m.date(),
          hours: m.hours(),
          minutes: m.minutes(),
          seconds: m.seconds(),
          milliseconds: m.milliseconds()
        };
      }
      function toJSON() {
        return this.isValid() ? this.toISOString() : null;
      }
      function isValid$2() {
        return isValid(this);
      }
      function parsingFlags() {
        return extend({}, getParsingFlags(this));
      }
      function invalidAt() {
        return getParsingFlags(this).overflow;
      }
      function creationData() {
        return {
          input: this._i,
          format: this._f,
          locale: this._locale,
          isUTC: this._isUTC,
          strict: this._strict
        };
      }
      addFormatToken("N", 0, 0, "eraAbbr");
      addFormatToken("NN", 0, 0, "eraAbbr");
      addFormatToken("NNN", 0, 0, "eraAbbr");
      addFormatToken("NNNN", 0, 0, "eraName");
      addFormatToken("NNNNN", 0, 0, "eraNarrow");
      addFormatToken("y", ["y", 1], "yo", "eraYear");
      addFormatToken("y", ["yy", 2], 0, "eraYear");
      addFormatToken("y", ["yyy", 3], 0, "eraYear");
      addFormatToken("y", ["yyyy", 4], 0, "eraYear");
      addRegexToken("N", matchEraAbbr);
      addRegexToken("NN", matchEraAbbr);
      addRegexToken("NNN", matchEraAbbr);
      addRegexToken("NNNN", matchEraName);
      addRegexToken("NNNNN", matchEraNarrow);
      addParseToken(
        ["N", "NN", "NNN", "NNNN", "NNNNN"],
        function(input, array, config, token3) {
          var era = config._locale.erasParse(input, token3, config._strict);
          if (era) {
            getParsingFlags(config).era = era;
          } else {
            getParsingFlags(config).invalidEra = input;
          }
        }
      );
      addRegexToken("y", matchUnsigned);
      addRegexToken("yy", matchUnsigned);
      addRegexToken("yyy", matchUnsigned);
      addRegexToken("yyyy", matchUnsigned);
      addRegexToken("yo", matchEraYearOrdinal);
      addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
      addParseToken(["yo"], function(input, array, config, token3) {
        var match;
        if (config._locale._eraYearOrdinalRegex) {
          match = input.match(config._locale._eraYearOrdinalRegex);
        }
        if (config._locale.eraYearOrdinalParse) {
          array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
        } else {
          array[YEAR] = parseInt(input, 10);
        }
      });
      function localeEras(m, format3) {
        var i3, l3, date, eras = this._eras || getLocale("en")._eras;
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          switch (typeof eras[i3].since) {
            case "string":
              date = hooks(eras[i3].since).startOf("day");
              eras[i3].since = date.valueOf();
              break;
          }
          switch (typeof eras[i3].until) {
            case "undefined":
              eras[i3].until = Infinity;
              break;
            case "string":
              date = hooks(eras[i3].until).startOf("day").valueOf();
              eras[i3].until = date.valueOf();
              break;
          }
        }
        return eras;
      }
      function localeErasParse(eraName, format3, strict) {
        var i3, l3, eras = this.eras(), name, abbr, narrow;
        eraName = eraName.toUpperCase();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          name = eras[i3].name.toUpperCase();
          abbr = eras[i3].abbr.toUpperCase();
          narrow = eras[i3].narrow.toUpperCase();
          if (strict) {
            switch (format3) {
              case "N":
              case "NN":
              case "NNN":
                if (abbr === eraName) {
                  return eras[i3];
                }
                break;
              case "NNNN":
                if (name === eraName) {
                  return eras[i3];
                }
                break;
              case "NNNNN":
                if (narrow === eraName) {
                  return eras[i3];
                }
                break;
            }
          } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
            return eras[i3];
          }
        }
      }
      function localeErasConvertYear(era, year) {
        var dir = era.since <= era.until ? 1 : -1;
        if (year === void 0) {
          return hooks(era.since).year();
        } else {
          return hooks(era.since).year() + (year - era.offset) * dir;
        }
      }
      function getEraName() {
        var i3, l3, val, eras = this.localeData().eras();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i3].since <= val && val <= eras[i3].until) {
            return eras[i3].name;
          }
          if (eras[i3].until <= val && val <= eras[i3].since) {
            return eras[i3].name;
          }
        }
        return "";
      }
      function getEraNarrow() {
        var i3, l3, val, eras = this.localeData().eras();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i3].since <= val && val <= eras[i3].until) {
            return eras[i3].narrow;
          }
          if (eras[i3].until <= val && val <= eras[i3].since) {
            return eras[i3].narrow;
          }
        }
        return "";
      }
      function getEraAbbr() {
        var i3, l3, val, eras = this.localeData().eras();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i3].since <= val && val <= eras[i3].until) {
            return eras[i3].abbr;
          }
          if (eras[i3].until <= val && val <= eras[i3].since) {
            return eras[i3].abbr;
          }
        }
        return "";
      }
      function getEraYear() {
        var i3, l3, dir, val, eras = this.localeData().eras();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          dir = eras[i3].since <= eras[i3].until ? 1 : -1;
          val = this.clone().startOf("day").valueOf();
          if (eras[i3].since <= val && val <= eras[i3].until || eras[i3].until <= val && val <= eras[i3].since) {
            return (this.year() - hooks(eras[i3].since).year()) * dir + eras[i3].offset;
          }
        }
        return this.year();
      }
      function erasNameRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNameRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNameRegex : this._erasRegex;
      }
      function erasAbbrRegex(isStrict) {
        if (!hasOwnProp(this, "_erasAbbrRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasAbbrRegex : this._erasRegex;
      }
      function erasNarrowRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNarrowRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNarrowRegex : this._erasRegex;
      }
      function matchEraAbbr(isStrict, locale2) {
        return locale2.erasAbbrRegex(isStrict);
      }
      function matchEraName(isStrict, locale2) {
        return locale2.erasNameRegex(isStrict);
      }
      function matchEraNarrow(isStrict, locale2) {
        return locale2.erasNarrowRegex(isStrict);
      }
      function matchEraYearOrdinal(isStrict, locale2) {
        return locale2._eraYearOrdinalRegex || matchUnsigned;
      }
      function computeErasParse() {
        var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i3, l3, erasName, erasAbbr, erasNarrow, eras = this.eras();
        for (i3 = 0, l3 = eras.length; i3 < l3; ++i3) {
          erasName = regexEscape2(eras[i3].name);
          erasAbbr = regexEscape2(eras[i3].abbr);
          erasNarrow = regexEscape2(eras[i3].narrow);
          namePieces.push(erasName);
          abbrPieces.push(erasAbbr);
          narrowPieces.push(erasNarrow);
          mixedPieces.push(erasName);
          mixedPieces.push(erasAbbr);
          mixedPieces.push(erasNarrow);
        }
        this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
        this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
        this._erasNarrowRegex = new RegExp(
          "^(" + narrowPieces.join("|") + ")",
          "i"
        );
      }
      addFormatToken(0, ["gg", 2], 0, function() {
        return this.weekYear() % 100;
      });
      addFormatToken(0, ["GG", 2], 0, function() {
        return this.isoWeekYear() % 100;
      });
      function addWeekYearFormatToken(token3, getter) {
        addFormatToken(0, [token3, token3.length], 0, getter);
      }
      addWeekYearFormatToken("gggg", "weekYear");
      addWeekYearFormatToken("ggggg", "weekYear");
      addWeekYearFormatToken("GGGG", "isoWeekYear");
      addWeekYearFormatToken("GGGGG", "isoWeekYear");
      addRegexToken("G", matchSigned);
      addRegexToken("g", matchSigned);
      addRegexToken("GG", match1to2, match2);
      addRegexToken("gg", match1to2, match2);
      addRegexToken("GGGG", match1to4, match4);
      addRegexToken("gggg", match1to4, match4);
      addRegexToken("GGGGG", match1to6, match6);
      addRegexToken("ggggg", match1to6, match6);
      addWeekParseToken(
        ["gggg", "ggggg", "GGGG", "GGGGG"],
        function(input, week, config, token3) {
          week[token3.substr(0, 2)] = toInt(input);
        }
      );
      addWeekParseToken(["gg", "GG"], function(input, week, config, token3) {
        week[token3] = hooks.parseTwoDigitYear(input);
      });
      function getSetWeekYear(input) {
        return getSetWeekYearHelper.call(
          this,
          input,
          this.week(),
          this.weekday() + this.localeData()._week.dow,
          this.localeData()._week.dow,
          this.localeData()._week.doy
        );
      }
      function getSetISOWeekYear(input) {
        return getSetWeekYearHelper.call(
          this,
          input,
          this.isoWeek(),
          this.isoWeekday(),
          1,
          4
        );
      }
      function getISOWeeksInYear() {
        return weeksInYear(this.year(), 1, 4);
      }
      function getISOWeeksInISOWeekYear() {
        return weeksInYear(this.isoWeekYear(), 1, 4);
      }
      function getWeeksInYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
      }
      function getWeeksInWeekYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
      }
      function getSetWeekYearHelper(input, week, weekday, dow, doy) {
        var weeksTarget;
        if (input == null) {
          return weekOfYear(this, dow, doy).year;
        } else {
          weeksTarget = weeksInYear(input, dow, doy);
          if (week > weeksTarget) {
            week = weeksTarget;
          }
          return setWeekAll.call(this, input, week, weekday, dow, doy);
        }
      }
      function setWeekAll(weekYear, week, weekday, dow, doy) {
        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
        this.year(date.getUTCFullYear());
        this.month(date.getUTCMonth());
        this.date(date.getUTCDate());
        return this;
      }
      addFormatToken("Q", 0, "Qo", "quarter");
      addRegexToken("Q", match1);
      addParseToken("Q", function(input, array) {
        array[MONTH] = (toInt(input) - 1) * 3;
      });
      function getSetQuarter(input) {
        return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
      }
      addFormatToken("D", ["DD", 2], "Do", "date");
      addRegexToken("D", match1to2, match1to2NoLeadingZero);
      addRegexToken("DD", match1to2, match2);
      addRegexToken("Do", function(isStrict, locale2) {
        return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
      });
      addParseToken(["D", "DD"], DATE);
      addParseToken("Do", function(input, array) {
        array[DATE] = toInt(input.match(match1to2)[0]);
      });
      var getSetDayOfMonth = makeGetSet("Date", true);
      addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
      addRegexToken("DDD", match1to3);
      addRegexToken("DDDD", match3);
      addParseToken(["DDD", "DDDD"], function(input, array, config) {
        config._dayOfYear = toInt(input);
      });
      function getSetDayOfYear(input) {
        var dayOfYear = Math.round(
          (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
        ) + 1;
        return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
      }
      addFormatToken("m", ["mm", 2], 0, "minute");
      addRegexToken("m", match1to2, match1to2HasZero);
      addRegexToken("mm", match1to2, match2);
      addParseToken(["m", "mm"], MINUTE);
      var getSetMinute = makeGetSet("Minutes", false);
      addFormatToken("s", ["ss", 2], 0, "second");
      addRegexToken("s", match1to2, match1to2HasZero);
      addRegexToken("ss", match1to2, match2);
      addParseToken(["s", "ss"], SECOND);
      var getSetSecond = makeGetSet("Seconds", false);
      addFormatToken("S", 0, 0, function() {
        return ~~(this.millisecond() / 100);
      });
      addFormatToken(0, ["SS", 2], 0, function() {
        return ~~(this.millisecond() / 10);
      });
      addFormatToken(0, ["SSS", 3], 0, "millisecond");
      addFormatToken(0, ["SSSS", 4], 0, function() {
        return this.millisecond() * 10;
      });
      addFormatToken(0, ["SSSSS", 5], 0, function() {
        return this.millisecond() * 100;
      });
      addFormatToken(0, ["SSSSSS", 6], 0, function() {
        return this.millisecond() * 1e3;
      });
      addFormatToken(0, ["SSSSSSS", 7], 0, function() {
        return this.millisecond() * 1e4;
      });
      addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
        return this.millisecond() * 1e5;
      });
      addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
        return this.millisecond() * 1e6;
      });
      addRegexToken("S", match1to3, match1);
      addRegexToken("SS", match1to3, match2);
      addRegexToken("SSS", match1to3, match3);
      var token2, getSetMillisecond;
      for (token2 = "SSSS"; token2.length <= 9; token2 += "S") {
        addRegexToken(token2, matchUnsigned);
      }
      function parseMs(input, array) {
        array[MILLISECOND] = toInt(("0." + input) * 1e3);
      }
      for (token2 = "S"; token2.length <= 9; token2 += "S") {
        addParseToken(token2, parseMs);
      }
      getSetMillisecond = makeGetSet("Milliseconds", false);
      addFormatToken("z", 0, 0, "zoneAbbr");
      addFormatToken("zz", 0, 0, "zoneName");
      function getZoneAbbr() {
        return this._isUTC ? "UTC" : "";
      }
      function getZoneName() {
        return this._isUTC ? "Coordinated Universal Time" : "";
      }
      var proto = Moment.prototype;
      proto.add = add;
      proto.calendar = calendar$1;
      proto.clone = clone;
      proto.diff = diff;
      proto.endOf = endOf;
      proto.format = format2;
      proto.from = from;
      proto.fromNow = fromNow;
      proto.to = to;
      proto.toNow = toNow;
      proto.get = stringGet;
      proto.invalidAt = invalidAt;
      proto.isAfter = isAfter;
      proto.isBefore = isBefore;
      proto.isBetween = isBetween;
      proto.isSame = isSame;
      proto.isSameOrAfter = isSameOrAfter;
      proto.isSameOrBefore = isSameOrBefore;
      proto.isValid = isValid$2;
      proto.lang = lang;
      proto.locale = locale;
      proto.localeData = localeData;
      proto.max = prototypeMax;
      proto.min = prototypeMin;
      proto.parsingFlags = parsingFlags;
      proto.set = stringSet;
      proto.startOf = startOf;
      proto.subtract = subtract;
      proto.toArray = toArray;
      proto.toObject = toObject;
      proto.toDate = toDate2;
      proto.toISOString = toISOString;
      proto.inspect = inspect;
      if (typeof Symbol !== "undefined" && Symbol.for != null) {
        proto[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = function() {
          return "Moment<" + this.format() + ">";
        };
      }
      proto.toJSON = toJSON;
      proto.toString = toString;
      proto.unix = unix;
      proto.valueOf = valueOf;
      proto.creationData = creationData;
      proto.eraName = getEraName;
      proto.eraNarrow = getEraNarrow;
      proto.eraAbbr = getEraAbbr;
      proto.eraYear = getEraYear;
      proto.year = getSetYear;
      proto.isLeapYear = getIsLeapYear;
      proto.weekYear = getSetWeekYear;
      proto.isoWeekYear = getSetISOWeekYear;
      proto.quarter = proto.quarters = getSetQuarter;
      proto.month = getSetMonth;
      proto.daysInMonth = getDaysInMonth;
      proto.week = proto.weeks = getSetWeek;
      proto.isoWeek = proto.isoWeeks = getSetISOWeek;
      proto.weeksInYear = getWeeksInYear;
      proto.weeksInWeekYear = getWeeksInWeekYear;
      proto.isoWeeksInYear = getISOWeeksInYear;
      proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
      proto.date = getSetDayOfMonth;
      proto.day = proto.days = getSetDayOfWeek;
      proto.weekday = getSetLocaleDayOfWeek;
      proto.isoWeekday = getSetISODayOfWeek;
      proto.dayOfYear = getSetDayOfYear;
      proto.hour = proto.hours = getSetHour;
      proto.minute = proto.minutes = getSetMinute;
      proto.second = proto.seconds = getSetSecond;
      proto.millisecond = proto.milliseconds = getSetMillisecond;
      proto.utcOffset = getSetOffset;
      proto.utc = setOffsetToUTC;
      proto.local = setOffsetToLocal;
      proto.parseZone = setOffsetToParsedOffset;
      proto.hasAlignedHourOffset = hasAlignedHourOffset;
      proto.isDST = isDaylightSavingTime;
      proto.isLocal = isLocal;
      proto.isUtcOffset = isUtcOffset;
      proto.isUtc = isUtc;
      proto.isUTC = isUtc;
      proto.zoneAbbr = getZoneAbbr;
      proto.zoneName = getZoneName;
      proto.dates = deprecate(
        "dates accessor is deprecated. Use date instead.",
        getSetDayOfMonth
      );
      proto.months = deprecate(
        "months accessor is deprecated. Use month instead",
        getSetMonth
      );
      proto.years = deprecate(
        "years accessor is deprecated. Use year instead",
        getSetYear
      );
      proto.zone = deprecate(
        "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
        getSetZone
      );
      proto.isDSTShifted = deprecate(
        "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
        isDaylightSavingTimeShifted
      );
      function createUnix(input) {
        return createLocal(input * 1e3);
      }
      function createInZone() {
        return createLocal.apply(null, arguments).parseZone();
      }
      function preParsePostFormat(string) {
        return string;
      }
      var proto$1 = Locale.prototype;
      proto$1.calendar = calendar;
      proto$1.longDateFormat = longDateFormat;
      proto$1.invalidDate = invalidDate;
      proto$1.ordinal = ordinal;
      proto$1.preparse = preParsePostFormat;
      proto$1.postformat = preParsePostFormat;
      proto$1.relativeTime = relativeTime;
      proto$1.pastFuture = pastFuture;
      proto$1.set = set;
      proto$1.eras = localeEras;
      proto$1.erasParse = localeErasParse;
      proto$1.erasConvertYear = localeErasConvertYear;
      proto$1.erasAbbrRegex = erasAbbrRegex;
      proto$1.erasNameRegex = erasNameRegex;
      proto$1.erasNarrowRegex = erasNarrowRegex;
      proto$1.months = localeMonths;
      proto$1.monthsShort = localeMonthsShort;
      proto$1.monthsParse = localeMonthsParse;
      proto$1.monthsRegex = monthsRegex;
      proto$1.monthsShortRegex = monthsShortRegex;
      proto$1.week = localeWeek;
      proto$1.firstDayOfYear = localeFirstDayOfYear;
      proto$1.firstDayOfWeek = localeFirstDayOfWeek;
      proto$1.weekdays = localeWeekdays;
      proto$1.weekdaysMin = localeWeekdaysMin;
      proto$1.weekdaysShort = localeWeekdaysShort;
      proto$1.weekdaysParse = localeWeekdaysParse;
      proto$1.weekdaysRegex = weekdaysRegex;
      proto$1.weekdaysShortRegex = weekdaysShortRegex;
      proto$1.weekdaysMinRegex = weekdaysMinRegex;
      proto$1.isPM = localeIsPM;
      proto$1.meridiem = localeMeridiem;
      function get$1(format3, index, field, setter) {
        var locale2 = getLocale(), utc = createUTC().set(setter, index);
        return locale2[field](utc, format3);
      }
      function listMonthsImpl(format3, index, field) {
        if (isNumber(format3)) {
          index = format3;
          format3 = void 0;
        }
        format3 = format3 || "";
        if (index != null) {
          return get$1(format3, index, field, "month");
        }
        var i3, out = [];
        for (i3 = 0; i3 < 12; i3++) {
          out[i3] = get$1(format3, i3, field, "month");
        }
        return out;
      }
      function listWeekdaysImpl(localeSorted, format3, index, field) {
        if (typeof localeSorted === "boolean") {
          if (isNumber(format3)) {
            index = format3;
            format3 = void 0;
          }
          format3 = format3 || "";
        } else {
          format3 = localeSorted;
          index = format3;
          localeSorted = false;
          if (isNumber(format3)) {
            index = format3;
            format3 = void 0;
          }
          format3 = format3 || "";
        }
        var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i3, out = [];
        if (index != null) {
          return get$1(format3, (index + shift) % 7, field, "day");
        }
        for (i3 = 0; i3 < 7; i3++) {
          out[i3] = get$1(format3, (i3 + shift) % 7, field, "day");
        }
        return out;
      }
      function listMonths(format3, index) {
        return listMonthsImpl(format3, index, "months");
      }
      function listMonthsShort(format3, index) {
        return listMonthsImpl(format3, index, "monthsShort");
      }
      function listWeekdays(localeSorted, format3, index) {
        return listWeekdaysImpl(localeSorted, format3, index, "weekdays");
      }
      function listWeekdaysShort(localeSorted, format3, index) {
        return listWeekdaysImpl(localeSorted, format3, index, "weekdaysShort");
      }
      function listWeekdaysMin(localeSorted, format3, index) {
        return listWeekdaysImpl(localeSorted, format3, index, "weekdaysMin");
      }
      getSetGlobalLocale("en", {
        eras: [
          {
            since: "0001-01-01",
            until: Infinity,
            offset: 1,
            name: "Anno Domini",
            narrow: "AD",
            abbr: "AD"
          },
          {
            since: "0000-12-31",
            until: -Infinity,
            offset: 1,
            name: "Before Christ",
            narrow: "BC",
            abbr: "BC"
          }
        ],
        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
        ordinal: function(number) {
          var b3 = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b3 === 1 ? "st" : b3 === 2 ? "nd" : b3 === 3 ? "rd" : "th";
          return number + output;
        }
      });
      hooks.lang = deprecate(
        "moment.lang is deprecated. Use moment.locale instead.",
        getSetGlobalLocale
      );
      hooks.langData = deprecate(
        "moment.langData is deprecated. Use moment.localeData instead.",
        getLocale
      );
      var mathAbs = Math.abs;
      function abs() {
        var data = this._data;
        this._milliseconds = mathAbs(this._milliseconds);
        this._days = mathAbs(this._days);
        this._months = mathAbs(this._months);
        data.milliseconds = mathAbs(data.milliseconds);
        data.seconds = mathAbs(data.seconds);
        data.minutes = mathAbs(data.minutes);
        data.hours = mathAbs(data.hours);
        data.months = mathAbs(data.months);
        data.years = mathAbs(data.years);
        return this;
      }
      function addSubtract$1(duration, input, value, direction) {
        var other = createDuration(input, value);
        duration._milliseconds += direction * other._milliseconds;
        duration._days += direction * other._days;
        duration._months += direction * other._months;
        return duration._bubble();
      }
      function add$1(input, value) {
        return addSubtract$1(this, input, value, 1);
      }
      function subtract$1(input, value) {
        return addSubtract$1(this, input, value, -1);
      }
      function absCeil(number) {
        if (number < 0) {
          return Math.floor(number);
        } else {
          return Math.ceil(number);
        }
      }
      function bubble() {
        var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
        if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
          milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
          days2 = 0;
          months2 = 0;
        }
        data.milliseconds = milliseconds2 % 1e3;
        seconds2 = absFloor(milliseconds2 / 1e3);
        data.seconds = seconds2 % 60;
        minutes2 = absFloor(seconds2 / 60);
        data.minutes = minutes2 % 60;
        hours2 = absFloor(minutes2 / 60);
        data.hours = hours2 % 24;
        days2 += absFloor(hours2 / 24);
        monthsFromDays = absFloor(daysToMonths(days2));
        months2 += monthsFromDays;
        days2 -= absCeil(monthsToDays(monthsFromDays));
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        data.days = days2;
        data.months = months2;
        data.years = years2;
        return this;
      }
      function daysToMonths(days2) {
        return days2 * 4800 / 146097;
      }
      function monthsToDays(months2) {
        return months2 * 146097 / 4800;
      }
      function as(units) {
        if (!this.isValid()) {
          return NaN;
        }
        var days2, months2, milliseconds2 = this._milliseconds;
        units = normalizeUnits(units);
        if (units === "month" || units === "quarter" || units === "year") {
          days2 = this._days + milliseconds2 / 864e5;
          months2 = this._months + daysToMonths(days2);
          switch (units) {
            case "month":
              return months2;
            case "quarter":
              return months2 / 3;
            case "year":
              return months2 / 12;
          }
        } else {
          days2 = this._days + Math.round(monthsToDays(this._months));
          switch (units) {
            case "week":
              return days2 / 7 + milliseconds2 / 6048e5;
            case "day":
              return days2 + milliseconds2 / 864e5;
            case "hour":
              return days2 * 24 + milliseconds2 / 36e5;
            case "minute":
              return days2 * 1440 + milliseconds2 / 6e4;
            case "second":
              return days2 * 86400 + milliseconds2 / 1e3;
            // Math.floor prevents floating point math errors here
            case "millisecond":
              return Math.floor(days2 * 864e5) + milliseconds2;
            default:
              throw new Error("Unknown unit " + units);
          }
        }
      }
      function makeAs(alias) {
        return function() {
          return this.as(alias);
        };
      }
      var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf$1 = asMilliseconds;
      function clone$1() {
        return createDuration(this);
      }
      function get$2(units) {
        units = normalizeUnits(units);
        return this.isValid() ? this[units + "s"]() : NaN;
      }
      function makeGetter(name) {
        return function() {
          return this.isValid() ? this._data[name] : NaN;
        };
      }
      var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
      function weeks() {
        return absFloor(this.days() / 7);
      }
      var round = Math.round, thresholds = {
        ss: 44,
        // a few seconds to seconds
        s: 45,
        // seconds to minute
        m: 45,
        // minutes to hour
        h: 22,
        // hours to day
        d: 26,
        // days to month/week
        w: null,
        // weeks to month
        M: 11
        // months to year
      };
      function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
        return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
      }
      function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
        var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
        if (thresholds2.w != null) {
          a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
        }
        a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
        a[2] = withoutSuffix;
        a[3] = +posNegDuration > 0;
        a[4] = locale2;
        return substituteTimeAgo.apply(null, a);
      }
      function getSetRelativeTimeRounding(roundingFunction) {
        if (roundingFunction === void 0) {
          return round;
        }
        if (typeof roundingFunction === "function") {
          round = roundingFunction;
          return true;
        }
        return false;
      }
      function getSetRelativeTimeThreshold(threshold, limit) {
        if (thresholds[threshold] === void 0) {
          return false;
        }
        if (limit === void 0) {
          return thresholds[threshold];
        }
        thresholds[threshold] = limit;
        if (threshold === "s") {
          thresholds.ss = limit - 1;
        }
        return true;
      }
      function humanize(argWithSuffix, argThresholds) {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var withSuffix = false, th = thresholds, locale2, output;
        if (typeof argWithSuffix === "object") {
          argThresholds = argWithSuffix;
          argWithSuffix = false;
        }
        if (typeof argWithSuffix === "boolean") {
          withSuffix = argWithSuffix;
        }
        if (typeof argThresholds === "object") {
          th = Object.assign({}, thresholds, argThresholds);
          if (argThresholds.s != null && argThresholds.ss == null) {
            th.ss = argThresholds.s - 1;
          }
        }
        locale2 = this.localeData();
        output = relativeTime$1(this, !withSuffix, th, locale2);
        if (withSuffix) {
          output = locale2.pastFuture(+this, output);
        }
        return locale2.postformat(output);
      }
      var abs$1 = Math.abs;
      function sign(x3) {
        return (x3 > 0) - (x3 < 0) || +x3;
      }
      function toISOString$1() {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
        if (!total) {
          return "P0D";
        }
        minutes2 = absFloor(seconds2 / 60);
        hours2 = absFloor(minutes2 / 60);
        seconds2 %= 60;
        minutes2 %= 60;
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
        totalSign = total < 0 ? "-" : "";
        ymSign = sign(this._months) !== sign(total) ? "-" : "";
        daysSign = sign(this._days) !== sign(total) ? "-" : "";
        hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
        return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
      }
      var proto$2 = Duration.prototype;
      proto$2.isValid = isValid$1;
      proto$2.abs = abs;
      proto$2.add = add$1;
      proto$2.subtract = subtract$1;
      proto$2.as = as;
      proto$2.asMilliseconds = asMilliseconds;
      proto$2.asSeconds = asSeconds;
      proto$2.asMinutes = asMinutes;
      proto$2.asHours = asHours;
      proto$2.asDays = asDays;
      proto$2.asWeeks = asWeeks;
      proto$2.asMonths = asMonths;
      proto$2.asQuarters = asQuarters;
      proto$2.asYears = asYears;
      proto$2.valueOf = valueOf$1;
      proto$2._bubble = bubble;
      proto$2.clone = clone$1;
      proto$2.get = get$2;
      proto$2.milliseconds = milliseconds;
      proto$2.seconds = seconds;
      proto$2.minutes = minutes;
      proto$2.hours = hours;
      proto$2.days = days;
      proto$2.weeks = weeks;
      proto$2.months = months;
      proto$2.years = years;
      proto$2.humanize = humanize;
      proto$2.toISOString = toISOString$1;
      proto$2.toString = toISOString$1;
      proto$2.toJSON = toISOString$1;
      proto$2.locale = locale;
      proto$2.localeData = localeData;
      proto$2.toIsoString = deprecate(
        "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
        toISOString$1
      );
      proto$2.lang = lang;
      addFormatToken("X", 0, 0, "unix");
      addFormatToken("x", 0, 0, "valueOf");
      addRegexToken("x", matchSigned);
      addRegexToken("X", matchTimestamp);
      addParseToken("X", function(input, array, config) {
        config._d = new Date(parseFloat(input) * 1e3);
      });
      addParseToken("x", function(input, array, config) {
        config._d = new Date(toInt(input));
      });
      hooks.version = "2.30.1";
      setHookCallback(createLocal);
      hooks.fn = proto;
      hooks.min = min;
      hooks.max = max;
      hooks.now = now;
      hooks.utc = createUTC;
      hooks.unix = createUnix;
      hooks.months = listMonths;
      hooks.isDate = isDate;
      hooks.locale = getSetGlobalLocale;
      hooks.invalid = createInvalid;
      hooks.duration = createDuration;
      hooks.isMoment = isMoment;
      hooks.weekdays = listWeekdays;
      hooks.parseZone = createInZone;
      hooks.localeData = getLocale;
      hooks.isDuration = isDuration;
      hooks.monthsShort = listMonthsShort;
      hooks.weekdaysMin = listWeekdaysMin;
      hooks.defineLocale = defineLocale;
      hooks.updateLocale = updateLocale;
      hooks.locales = listLocales;
      hooks.weekdaysShort = listWeekdaysShort;
      hooks.normalizeUnits = normalizeUnits;
      hooks.relativeTimeRounding = getSetRelativeTimeRounding;
      hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
      hooks.calendarFormat = getCalendarFormat;
      hooks.prototype = proto;
      hooks.HTML5_FMT = {
        DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
        // <input type="datetime-local" />
        DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
        // <input type="datetime-local" step="1" />
        DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
        // <input type="datetime-local" step="0.001" />
        DATE: "YYYY-MM-DD",
        // <input type="date" />
        TIME: "HH:mm",
        // <input type="time" />
        TIME_SECONDS: "HH:mm:ss",
        // <input type="time" step="1" />
        TIME_MS: "HH:mm:ss.SSS",
        // <input type="time" step="0.001" />
        WEEK: "GGGG-[W]WW",
        // <input type="week" />
        MONTH: "YYYY-MM"
        // <input type="month" />
      };
      return hooks;
    });
  }
});
var require_FileStreamRotator = __commonJS2({
  "../../node_modules/.pnpm/file-stream-rotator@0.6.1/node_modules/file-stream-rotator/FileStreamRotator.js"(exports$1, module2) {
    var fs2 = __require("fs");
    var path2 = __require("path");
    var moment = require_moment();
    var crypto = __require("crypto");
    var EventEmitter = __require("events");
    var FileStreamRotator = {};
    module2.exports = FileStreamRotator;
    var staticFrequency = ["daily", "test", "m", "h", "custom"];
    var DATE_FORMAT = "YYYYMMDDHHmm";
    var _checkNumAndType = function(type, num) {
      if (typeof num == "number") {
        switch (type) {
          case "m":
            if (num < 0 || num > 60) {
              return false;
            }
            break;
          case "h":
            if (num < 0 || num > 24) {
              return false;
            }
            break;
        }
        return { type, digit: num };
      }
    };
    var _checkDailyAndTest = function(freqType) {
      switch (freqType) {
        case "custom":
        case "daily":
          return { type: freqType, digit: void 0 };
        case "test":
          return { type: freqType, digit: 0 };
      }
      return false;
    };
    FileStreamRotator.getFrequency = function(frequency) {
      var _f = frequency.toLowerCase().match(/^(\d+)([mh])$/);
      if (_f) {
        return _checkNumAndType(_f[2], parseInt(_f[1]));
      }
      var dailyOrTest = _checkDailyAndTest(frequency);
      if (dailyOrTest) {
        return dailyOrTest;
      }
      return false;
    };
    FileStreamRotator.parseFileSize = function(size) {
      if (size && typeof size == "string") {
        var _s = size.toLowerCase().match(/^((?:0\.)?\d+)([kmg])$/);
        if (_s) {
          switch (_s[2]) {
            case "k":
              return _s[1] * 1024;
            case "m":
              return _s[1] * 1024 * 1024;
            case "g":
              return _s[1] * 1024 * 1024 * 1024;
          }
        }
      }
      return null;
    };
    FileStreamRotator.getDate = function(format2, date_format, utc) {
      date_format = date_format || DATE_FORMAT;
      let currentMoment = utc ? moment.utc() : moment().local();
      if (format2 && staticFrequency.indexOf(format2.type) !== -1) {
        switch (format2.type) {
          case "m":
            var minute = Math.floor(currentMoment.minutes() / format2.digit) * format2.digit;
            return currentMoment.minutes(minute).format(date_format);
          case "h":
            var hour = Math.floor(currentMoment.hour() / format2.digit) * format2.digit;
            return currentMoment.hour(hour).format(date_format);
          case "daily":
          case "custom":
          case "test":
            return currentMoment.format(date_format);
        }
      }
      return currentMoment.format(date_format);
    };
    FileStreamRotator.setAuditLog = function(max_logs, audit_file, log_file) {
      var _rtn = null;
      if (max_logs) {
        var use_days = max_logs.toString().substr(-1);
        var _num = max_logs.toString().match(/^(\d+)/);
        if (Number(_num[1]) > 0) {
          var baseLog = path2.dirname(log_file.replace(/%DATE%.+/, "_filename"));
          try {
            if (audit_file) {
              var full_path = path2.resolve(audit_file);
              _rtn = JSON.parse(fs2.readFileSync(full_path, { encoding: "utf-8" }));
            } else {
              var full_path = path2.resolve(baseLog + "/.audit.json");
              _rtn = JSON.parse(fs2.readFileSync(full_path, { encoding: "utf-8" }));
            }
          } catch (e3) {
            if (e3.code !== "ENOENT") {
              return null;
            }
            _rtn = {
              keep: {
                days: false,
                amount: Number(_num[1])
              },
              auditLog: audit_file || baseLog + "/.audit.json",
              files: []
            };
          }
          _rtn.keep = {
            days: use_days === "d",
            amount: Number(_num[1])
          };
        }
      }
      return _rtn;
    };
    FileStreamRotator.writeAuditLog = function(audit, verbose) {
      try {
        mkDirForFile(audit.auditLog);
        fs2.writeFileSync(audit.auditLog, JSON.stringify(audit, null, 4));
      } catch (e3) {
        if (verbose) {
          console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] Failed to store log audit at:", audit.auditLog, "Error:", e3);
        }
      }
    };
    function removeFile(file, verbose) {
      if (file.hash === crypto.createHash(file.hashType).update(file.name + "LOG_FILE" + file.date).digest("hex")) {
        try {
          if (fs2.existsSync(file.name)) {
            fs2.unlinkSync(file.name);
          }
        } catch (e3) {
          if (verbose) {
            console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] Could not remove old log file: ", file.name);
          }
        }
      }
    }
    function createCurrentSymLink(logfile, name, verbose) {
      let symLinkName = name || "current.log";
      let logPath = path2.dirname(logfile);
      let logfileName = path2.basename(logfile);
      let current = logPath + "/" + symLinkName;
      try {
        let stats = fs2.lstatSync(current);
        if (stats.isSymbolicLink()) {
          fs2.unlinkSync(current);
          fs2.symlinkSync(logfileName, current);
        }
      } catch (err) {
        if (err && err.code == "ENOENT") {
          try {
            fs2.symlinkSync(logfileName, current);
          } catch (e3) {
            if (verbose) {
              console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] Could not create symlink file: ", current, " -> ", logfileName);
            }
          }
        }
      }
    }
    function createLogWatcher(logfile, verbose, cb) {
      if (!logfile) return null;
      try {
        let stats = fs2.lstatSync(logfile);
        return fs2.watch(logfile, function(event, filename) {
          if (event == "rename") {
            try {
              let stats2 = fs2.lstatSync(logfile);
            } catch (err) {
              cb(err, logfile);
            }
          }
        });
      } catch (err) {
        if (verbose) {
          console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] Could not add watcher for " + logfile);
        }
      }
    }
    FileStreamRotator.addLogToAudit = function(logfile, audit, stream, verbose) {
      if (audit && audit.files) {
        var index = audit.files.findIndex(function(file) {
          return file.name === logfile;
        });
        if (index !== -1) {
          return audit;
        }
        var time = Date.now();
        audit.files.push({
          date: time,
          name: logfile,
          hash: crypto.createHash(audit.hashType).update(logfile + "LOG_FILE" + time).digest("hex")
        });
        if (audit.keep.days) {
          var oldestDate = moment().subtract(audit.keep.amount, "days").valueOf();
          var recentFiles = audit.files.filter(function(file) {
            if (file.date > oldestDate) {
              return true;
            }
            file.hashType = audit.hashType;
            removeFile(file, verbose);
            stream.emit("logRemoved", file);
            return false;
          });
          audit.files = recentFiles;
        } else {
          var filesToKeep = audit.files.splice(-audit.keep.amount);
          if (audit.files.length > 0) {
            audit.files.filter(function(file) {
              file.hashType = audit.hashType;
              removeFile(file, verbose);
              stream.emit("logRemoved", file);
              return false;
            });
          }
          audit.files = filesToKeep;
        }
        FileStreamRotator.writeAuditLog(audit, verbose);
      }
      return audit;
    };
    FileStreamRotator.getStream = function(options) {
      var frequencyMetaData = null;
      var curDate = null;
      var self2 = this;
      if (!options.filename) {
        console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] No filename supplied. Defaulting to STDOUT");
        return process.stdout;
      }
      if (options.frequency) {
        frequencyMetaData = self2.getFrequency(options.frequency);
      }
      let auditLog = self2.setAuditLog(options.max_logs, options.audit_file, options.filename);
      if (auditLog != null) {
        auditLog.hashType = options.audit_hash_type !== void 0 ? options.audit_hash_type : "md5";
      }
      self2.verbose = options.verbose !== void 0 ? options.verbose : true;
      var fileSize = null;
      var fileCount = 0;
      var curSize = 0;
      if (options.size) {
        fileSize = FileStreamRotator.parseFileSize(options.size);
      }
      var dateFormat = options.date_format || DATE_FORMAT;
      if (frequencyMetaData && frequencyMetaData.type == "daily") {
        if (!options.date_format) {
          dateFormat = "YYYY-MM-DD";
        }
        if (moment().format(dateFormat) != moment().endOf("day").format(dateFormat) || moment().format(dateFormat) == moment().add(1, "day").format(dateFormat)) {
          if (self2.verbose) {
            console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] Changing type to custom as date format changes more often than once a day or not every day");
          }
          frequencyMetaData.type = "custom";
        }
      }
      if (frequencyMetaData) {
        curDate = options.frequency ? self2.getDate(frequencyMetaData, dateFormat, options.utc) : "";
      }
      options.create_symlink = options.create_symlink || false;
      options.extension = options.extension || "";
      var filename = options.filename;
      var oldFile = null;
      var logfile = filename + (curDate ? "." + curDate : "");
      if (filename.match(/%DATE%/)) {
        logfile = filename.replace(/%DATE%/g, curDate ? curDate : self2.getDate(null, dateFormat, options.utc));
      }
      if (fileSize) {
        var lastLogFile = null;
        var t_log = logfile;
        if (auditLog && auditLog.files && auditLog.files instanceof Array && auditLog.files.length > 0) {
          var lastEntry = auditLog.files[auditLog.files.length - 1].name;
          if (lastEntry.match(t_log)) {
            var lastCount = lastEntry.match(t_log + "\\.(\\d+)");
            if (lastCount) {
              t_log = lastEntry;
              fileCount = lastCount[1];
            }
          }
        }
        if (fileCount == 0 && t_log == logfile) {
          t_log += options.extension;
        }
        while (fs2.existsSync(t_log)) {
          lastLogFile = t_log;
          fileCount++;
          t_log = logfile + "." + fileCount + options.extension;
        }
        if (lastLogFile) {
          var lastLogFileStats = fs2.statSync(lastLogFile);
          if (lastLogFileStats.size < fileSize) {
            t_log = lastLogFile;
            fileCount--;
            curSize = lastLogFileStats.size;
          }
        }
        logfile = t_log;
      } else {
        logfile += options.extension;
      }
      if (self2.verbose) {
        console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] Logging to: ", logfile);
      }
      mkDirForFile(logfile);
      var file_options = options.file_options || { flags: "a" };
      var rotateStream = fs2.createWriteStream(logfile, file_options);
      if (curDate && frequencyMetaData && staticFrequency.indexOf(frequencyMetaData.type) > -1 || fileSize > 0) {
        if (self2.verbose) {
          console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] Rotating file: ", frequencyMetaData ? frequencyMetaData.type : "", fileSize ? "size: " + fileSize : "");
        }
        var stream = new EventEmitter();
        stream.auditLog = auditLog;
        stream.end = function() {
          rotateStream.end.apply(rotateStream, arguments);
        };
        BubbleEvents(rotateStream, stream);
        stream.on("close", function() {
          if (logWatcher) {
            logWatcher.close();
          }
        });
        stream.on("new", function(newLog) {
          stream.auditLog = self2.addLogToAudit(newLog, stream.auditLog, stream, self2.verbose);
          if (options.create_symlink) {
            createCurrentSymLink(newLog, options.symlink_name, self2.verbose);
          }
          if (options.watch_log) {
            stream.emit("addWatcher", newLog);
          }
        });
        var logWatcher;
        stream.on("addWatcher", function(newLog) {
          if (logWatcher) {
            logWatcher.close();
          }
          if (!options.watch_log) {
            return;
          }
          logWatcher = createLogWatcher(newLog, self2.verbose, function(err, newLog2) {
            stream.emit("createLog", newLog2);
          });
        });
        stream.on("createLog", function(file) {
          try {
            let stats = fs2.lstatSync(file);
          } catch (err) {
            if (rotateStream && rotateStream.end == "function") {
              rotateStream.end();
            }
            rotateStream = fs2.createWriteStream(file, file_options);
            stream.emit("new", file);
            BubbleEvents(rotateStream, stream);
          }
        });
        stream.write = function(str, encoding) {
          var newDate = frequencyMetaData ? this.getDate(frequencyMetaData, dateFormat, options.utc) : curDate;
          if (newDate != curDate || fileSize && curSize > fileSize) {
            var newLogfile = filename + (curDate && frequencyMetaData ? "." + newDate : "");
            if (filename.match(/%DATE%/) && curDate) {
              newLogfile = filename.replace(/%DATE%/g, newDate);
            }
            if (fileSize && curSize > fileSize) {
              fileCount++;
              newLogfile += "." + fileCount + options.extension;
            } else {
              fileCount = 0;
              newLogfile += options.extension;
            }
            curSize = 0;
            if (self2.verbose) {
              console.log(/* @__PURE__ */ new Date(), __require("util").format("[FileStreamRotator] Changing logs from %s to %s", logfile, newLogfile));
            }
            curDate = newDate;
            oldFile = logfile;
            logfile = newLogfile;
            if (options.end_stream === true) {
              rotateStream.end();
            } else {
              rotateStream.destroy();
            }
            mkDirForFile(logfile);
            rotateStream = fs2.createWriteStream(newLogfile, file_options);
            stream.emit("new", newLogfile);
            stream.emit("rotate", oldFile, newLogfile);
            BubbleEvents(rotateStream, stream);
          }
          rotateStream.write(str, encoding);
          curSize += Buffer.byteLength(str, encoding);
        }.bind(this);
        process.nextTick(function() {
          stream.emit("new", logfile);
        });
        stream.emit("new", logfile);
        return stream;
      } else {
        if (self2.verbose) {
          console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] File won't be rotated: ", options.frequency, options.size);
        }
        process.nextTick(function() {
          rotateStream.emit("new", logfile);
        });
        return rotateStream;
      }
    };
    var mkDirForFile = function(pathWithFile) {
      var _path = path2.dirname(pathWithFile);
      _path.split(path2.sep).reduce(
        function(fullPath, folder) {
          fullPath += folder + path2.sep;
          if (!fs2.existsSync(fullPath)) {
            try {
              fs2.mkdirSync(fullPath);
            } catch (e3) {
              if (e3.code !== "EEXIST") {
                throw e3;
              }
            }
          }
          return fullPath;
        },
        ""
      );
    };
    var BubbleEvents = function BubbleEvents2(emitter, proxy) {
      emitter.on("close", function() {
        proxy.emit("close");
      });
      emitter.on("finish", function() {
        proxy.emit("finish");
      });
      emitter.on("error", function(err) {
        proxy.emit("error", err);
      });
      emitter.on("open", function(fd) {
        proxy.emit("open", fd);
      });
    };
  }
});
var require_daily_rotate_file = __commonJS2({
  "../../node_modules/.pnpm/winston-daily-rotate-file@5.0.0_winston@3.19.0/node_modules/winston-daily-rotate-file/daily-rotate-file.js"(exports$1, module2) {
    var fs2 = __require("fs");
    var os2 = __require("os");
    var path2 = __require("path");
    var util = __require("util");
    var zlib = __require("zlib");
    var hash = require_object_hash();
    var MESSAGE = require_triple_beam().MESSAGE;
    var PassThrough = __require("stream").PassThrough;
    var Transport = require_winston_transport();
    var loggerDefaults = {
      json: false,
      colorize: false,
      eol: os2.EOL,
      logstash: null,
      prettyPrint: false,
      label: null,
      stringify: false,
      depth: null,
      showLevel: true,
      timestamp: () => {
        return (/* @__PURE__ */ new Date()).toISOString();
      }
    };
    var DailyRotateFile2 = function(options) {
      options = options || {};
      Transport.call(this, options);
      function throwIf(target) {
        Array.prototype.slice.call(arguments, 1).forEach((name) => {
          if (options[name]) {
            throw new Error("Cannot set " + name + " and " + target + " together");
          }
        });
      }
      function getMaxSize(size) {
        if (size && typeof size === "string") {
          if (size.toLowerCase().match(/^((?:0\.)?\d+)([kmg])$/)) {
            return size;
          }
        } else if (size && Number.isInteger(size)) {
          const sizeK = Math.round(size / 1024);
          return sizeK === 0 ? "1k" : sizeK + "k";
        }
        return null;
      }
      function isValidFileName(filename) {
        return !/["<>|:*?\\/\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]/g.test(
          filename
        );
      }
      function isValidDirName(dirname3) {
        return !/["<>|\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]/g.test(
          dirname3
        );
      }
      this.options = Object.assign({}, loggerDefaults, options);
      if (options.stream) {
        throwIf("stream", "filename", "maxsize");
        this.logStream = new PassThrough();
        this.logStream.pipe(options.stream);
      } else {
        this.filename = options.filename ? path2.basename(options.filename) : "winston.log";
        this.dirname = options.dirname || path2.dirname(options.filename);
        if (!isValidFileName(this.filename) || !isValidDirName(this.dirname)) {
          throw new Error("Your path or filename contain an invalid character.");
        }
        this.logStream = require_FileStreamRotator().getStream({
          filename: path2.join(this.dirname, this.filename),
          frequency: options.frequency ? options.frequency : "custom",
          date_format: options.datePattern ? options.datePattern : "YYYY-MM-DD",
          verbose: false,
          size: getMaxSize(options.maxSize),
          max_logs: options.maxFiles,
          end_stream: true,
          audit_file: options.auditFile ? options.auditFile : path2.join(this.dirname, "." + hash(options) + "-audit.json"),
          file_options: options.options ? options.options : { flags: "a" },
          utc: options.utc ? options.utc : false,
          extension: options.extension ? options.extension : "",
          create_symlink: options.createSymlink ? options.createSymlink : false,
          symlink_name: options.symlinkName ? options.symlinkName : "current.log",
          watch_log: options.watchLog ? options.watchLog : false,
          audit_hash_type: options.auditHashType ? options.auditHashType : "sha256"
        });
        this.logStream.on("new", (newFile) => {
          this.emit("new", newFile);
        });
        this.logStream.on("rotate", (oldFile, newFile) => {
          this.emit("rotate", oldFile, newFile);
        });
        this.logStream.on("logRemoved", (params) => {
          if (options.zippedArchive) {
            const gzName = params.name + ".gz";
            try {
              fs2.unlinkSync(gzName);
            } catch (err) {
              if (err.code !== "ENOENT") {
                err.message = `Error occurred while removing ${gzName}: ${err.message}`;
                this.emit("error", err);
                return;
              }
            }
            this.emit("logRemoved", gzName);
            return;
          }
          this.emit("logRemoved", params.name);
        });
        if (options.zippedArchive) {
          this.logStream.on("rotate", (oldFile) => {
            try {
              if (!fs2.existsSync(oldFile)) {
                return;
              }
            } catch (err) {
              err.message = `Error occurred while checking existence of ${oldFile}: ${err.message}`;
              this.emit("error", err);
              return;
            }
            try {
              if (fs2.existsSync(`${oldFile}.gz`)) {
                return;
              }
            } catch (err) {
              err.message = `Error occurred while checking existence of ${oldFile}.gz: ${err.message}`;
              this.emit("error", err);
              return;
            }
            const gzip = zlib.createGzip();
            const inp = fs2.createReadStream(oldFile);
            inp.on("error", (err) => {
              err.message = `Error occurred while reading ${oldFile}: ${err.message}`;
              this.emit("error", err);
            });
            const out = fs2.createWriteStream(oldFile + ".gz");
            out.on("error", (err) => {
              err.message = `Error occurred while writing ${oldFile}.gz: ${err.message}`;
              this.emit("error", err);
            });
            inp.pipe(gzip).pipe(out).on("finish", () => {
              try {
                fs2.unlinkSync(oldFile);
              } catch (err) {
                if (err.code !== "ENOENT") {
                  err.message = `Error occurred while removing ${oldFile}: ${err.message}`;
                  this.emit("error", err);
                  return;
                }
              }
              this.emit("archive", oldFile + ".gz");
            });
          });
        }
        if (options.watchLog) {
          this.logStream.on("addWatcher", (newFile) => {
            this.emit("addWatcher", newFile);
          });
        }
      }
    };
    module2.exports = DailyRotateFile2;
    util.inherits(DailyRotateFile2, Transport);
    DailyRotateFile2.prototype.name = "dailyRotateFile";
    var noop = function() {
    };
    DailyRotateFile2.prototype.log = function(info, callback) {
      callback = callback || noop;
      this.logStream.write(info[MESSAGE] + this.options.eol);
      this.emit("logged", info);
      callback(null, true);
    };
    DailyRotateFile2.prototype.close = function() {
      if (this.logStream) {
        this.logStream.end(() => {
          this.emit("finish");
        });
      }
    };
    DailyRotateFile2.prototype.query = function(options, callback) {
      if (typeof options === "function") {
        callback = options;
        options = {};
      }
      if (!this.options.json) {
        throw new Error(
          "query() may not be used without the json option being set to true"
        );
      }
      if (!this.filename) {
        throw new Error("query() may not be used when initializing with a stream");
      }
      let results = [];
      options = options || {};
      options.rows = options.rows || options.limit || 10;
      options.start = options.start || 0;
      options.until = options.until || /* @__PURE__ */ new Date();
      if (typeof options.until !== "object") {
        options.until = new Date(options.until);
      }
      options.from = options.from || options.until - 24 * 60 * 60 * 1e3;
      if (typeof options.from !== "object") {
        options.from = new Date(options.from);
      }
      options.order = options.order || "desc";
      const logFiles = (() => {
        const fileRegex = new RegExp(this.filename.replace("%DATE%", ".*"), "i");
        return fs2.readdirSync(this.dirname).filter((file) => path2.basename(file).match(fileRegex));
      })();
      if (logFiles.length === 0 && callback) {
        callback(null, results);
      }
      const processLogFile = (file) => {
        if (!file) {
          return;
        }
        const logFile = path2.join(this.dirname, file);
        let buff = "";
        let stream;
        if (file.endsWith(".gz")) {
          stream = new PassThrough();
          const inp = fs2.createReadStream(logFile);
          inp.on("error", (err) => {
            err.message = `Error occurred while reading ${logFile}: ${err.message}`;
            stream.emit("error", err);
          });
          inp.pipe(zlib.createGunzip()).pipe(stream);
        } else {
          stream = fs2.createReadStream(logFile, {
            encoding: "utf8"
          });
        }
        stream.on("error", (err) => {
          if (stream.readable) {
            stream.destroy();
          }
          if (!callback) {
            return;
          }
          return err.code === "ENOENT" ? callback(null, results) : callback(err);
        });
        stream.on("data", (data) => {
          data = (buff + data).split(/\n+/);
          const l3 = data.length - 1;
          for (let i3 = 0; i3 < l3; i3++) {
            add(data[i3]);
          }
          buff = data[l3];
        });
        stream.on("end", () => {
          if (buff) {
            add(buff, true);
          }
          if (logFiles.length) {
            processLogFile(logFiles.shift());
          } else if (callback) {
            results.sort((a, b3) => {
              const d1 = new Date(a.timestamp).getTime();
              const d22 = new Date(b3.timestamp).getTime();
              return d1 > d22 ? 1 : d1 < d22 ? -1 : 0;
            });
            if (options.order === "desc") {
              results = results.reverse();
            }
            const start = options.start || 0;
            const limit = options.limit || results.length;
            results = results.slice(start, start + limit);
            if (options.fields) {
              results = results.map((log) => {
                const obj = {};
                options.fields.forEach((key) => {
                  obj[key] = log[key];
                });
                return obj;
              });
            }
            callback(null, results);
          }
        });
        function add(buff2, attempt) {
          try {
            const log = JSON.parse(buff2);
            if (!log || typeof log !== "object") {
              return;
            }
            const time = new Date(log.timestamp);
            if (options.from && time < options.from || options.until && time > options.until || options.level && options.level !== log.level) {
              return;
            }
            results.push(log);
          } catch (e3) {
            if (!attempt) {
              stream.emit("error", e3);
            }
          }
        }
      };
      processLogFile(logFiles.shift());
    };
  }
});
var require_winston_daily_rotate_file = __commonJS2({
  "../../node_modules/.pnpm/winston-daily-rotate-file@5.0.0_winston@3.19.0/node_modules/winston-daily-rotate-file/index.js"(exports$1, module2) {
    var winston2 = require_winston();
    var DailyRotateFile2 = require_daily_rotate_file();
    winston2.transports.DailyRotateFile = DailyRotateFile2;
    module2.exports = DailyRotateFile2;
  }
});
var import_winston = __toESM2(require_winston());
var import_winston_daily_rotate_file = __toESM2(require_winston_daily_rotate_file());
var DEFAULT_OPTIONS = {
  logRootDir: (0, import_path5.join)((0, import_os2.homedir)(), ".shop-agent", "logs"),
  maxFiles: "30d",
  level: "debug",
  console: true,
  file: true,
  zippedArchive: false
};
function createLogger2(moduleName2, options) {
  const config = { ...DEFAULT_OPTIONS, ...options };
  const logDir = (0, import_path5.join)(config.logRootDir, moduleName2);
  const transports = [];
  if (config.console) {
    transports.push(
      new import_winston.default.transports.Console({
        format: import_winston.default.format.combine(
          import_winston.default.format.colorize(),
          import_winston.default.format.printf((info) => {
            const formatter = options?.formatter || defaultFormatter;
            return formatter(info);
          })
        )
      })
    );
  }
  if (config.file) {
    transports.push(
      new import_winston_daily_rotate_file.default({
        dirname: logDir,
        filename: "%DATE%.log",
        datePattern: "YYYY-MM-DD",
        maxFiles: config.maxFiles,
        zippedArchive: config.zippedArchive,
        format: import_winston.default.format.printf((info) => {
          const formatter = options?.formatter || defaultFormatter;
          return formatter(info);
        })
      })
    );
  }
  const winstonLogger = import_winston.default.createLogger({
    level: config.level,
    format: import_winston.default.format.combine(
      import_winston.default.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss.SSS" }),
      import_winston.default.format.errors({ stack: true }),
      import_winston.default.format.metadata()
    ),
    transports
  });
  winstonLogger.defaultMeta = { module: moduleName2 };
  return {
    info: (msg, ...args) => {
      winstonLogger.info(formatMessage(msg, args));
    },
    error: (msg, ...args) => {
      winstonLogger.error(formatMessage(msg, args));
    },
    warn: (msg, ...args) => {
      winstonLogger.warn(formatMessage(msg, args));
    },
    debug: (msg, ...args) => {
      winstonLogger.debug(formatMessage(msg, args));
    }
  };
}
function defaultFormatter(info) {
  const { timestamp, level, message, module: module2 } = info;
  const levelStr = level.toUpperCase().padEnd(5);
  const moduleStr = module2 ? `[${module2}]` : "";
  return `${timestamp} [${levelStr}] ${moduleStr} ${message}`;
}
function formatMessage(msg, args) {
  if (args.length === 0) return msg;
  const argsStr = args.map((arg) => {
    if (arg === null) return "null";
    if (arg === void 0) return "undefined";
    if (typeof arg === "object") {
      try {
        return JSON.stringify(arg);
      } catch {
        return String(arg);
      }
    }
    return String(arg);
  }).join(" ");
  return `${msg} ${argsStr}`;
}

// logger.js
var logger17 = createLogger2("agentx-server");

// config.js
var import_path6 = require("path");
var import_os3 = require("os");
var import_fs3 = require("fs");
function getAppDataDir() {
  const home = (0, import_os3.homedir)();
  const appName = "ShopAgent";
  switch ((0, import_os3.platform)()) {
    case "darwin":
      return (0, import_path6.join)(home, "Library", "Application Support", appName);
    case "win32":
      return (0, import_path6.join)(process.env.APPDATA || (0, import_path6.join)(home, "AppData", "Roaming"), appName);
    default:
      return (0, import_path6.join)(process.env.XDG_DATA_HOME || (0, import_path6.join)(home, ".local", "share"), appName);
  }
}
function detectClaudeCodePath2() {
  const execDir = (0, import_path6.dirname)(process.execPath);
  const isPkg = process.execPath.includes("agentx-server");
  const scriptDir = process.argv[1] ? (0, import_path6.dirname)(process.argv[1]) : null;
  const isNodeBundle = scriptDir && scriptDir.includes("agentx-server-node");
  const possiblePaths = [];
  if (isPkg) {
    possiblePaths.push(
      (0, import_path6.resolve)(execDir, "binaries", "claude-cli", "cli.js"),
      (0, import_path6.resolve)(execDir, "claude-cli", "cli.js"),
      (0, import_path6.resolve)(execDir, "..", "resources", "binaries", "claude-cli", "cli.js"),
      (0, import_path6.resolve)(execDir, "..", "Resources", "binaries", "claude-cli", "cli.js")
    );
  }
  if (isNodeBundle) {
    possiblePaths.push((0, import_path6.resolve)(scriptDir, "..", "claude-cli", "cli.js"));
  }
  possiblePaths.push(
    (0, import_path6.resolve)(process.env.APPDATA || "", "npm", "node_modules", "@anthropic-ai", "claude-code", "cli.js"),
    (0, import_path6.resolve)((0, import_os3.homedir)(), "AppData", "Roaming", "npm", "node_modules", "@anthropic-ai", "claude-code", "cli.js"),
    (0, import_path6.resolve)(process.cwd(), "node_modules", "@anthropic-ai", "claude-agent-sdk", "cli.js")
  );
  logger17.info("[Config] Searching for Claude Code CLI...");
  for (const p of possiblePaths) {
    try {
      if ((0, import_fs3.existsSync)(p)) {
        logger17.info("[Config] Found Claude Code CLI:", p);
        return p;
      }
    } catch {
    }
  }
  logger17.error("[Config] Claude Code CLI not found! Checked:", possiblePaths);
  return null;
}
function detectNodePath() {
  const execDir = (0, import_path6.dirname)(process.execPath);
  const isPkg = process.execPath.includes("agentx-server");
  const scriptDir = process.argv[1] ? (0, import_path6.dirname)(process.argv[1]) : null;
  const isNodeBundle = scriptDir && scriptDir.includes("agentx-server-node");
  const os2 = (0, import_os3.platform)();
  const arch = process.arch;
  let nodeBinaryName;
  if (os2 === "darwin") {
    nodeBinaryName = `node-darwin-${arch === "arm64" ? "arm64" : "x64"}`;
  } else if (os2 === "win32") {
    nodeBinaryName = `node-win-${arch === "arm64" ? "arm64" : "x64"}.exe`;
  } else {
    nodeBinaryName = `node-linux-${arch === "arm64" ? "arm64" : "x64"}`;
  }
  const possiblePaths = [];
  if (isPkg) {
    possiblePaths.push(
      (0, import_path6.resolve)(execDir, "..", "Resources", "binaries", "node", nodeBinaryName),
      (0, import_path6.resolve)(execDir, "binaries", "node", nodeBinaryName),
      (0, import_path6.resolve)(execDir, "..", "resources", "binaries", "node", nodeBinaryName)
    );
  }
  if (isNodeBundle) {
    let nodeBundleName;
    if (os2 === "darwin") {
      nodeBundleName = `node-darwin-${arch === "arm64" ? "arm64" : "x64"}`;
    } else if (os2 === "win32") {
      nodeBundleName = `node-win32-${arch === "arm64" ? "arm64" : "x64"}.exe`;
    } else {
      nodeBundleName = `node-linux-${arch === "arm64" ? "arm64" : "x64"}`;
    }
    possiblePaths.push((0, import_path6.resolve)(scriptDir, "..", "node", nodeBundleName));
  }
  logger17.info("[Config] Searching for bundled Node.js...");
  for (const p of possiblePaths) {
    try {
      if ((0, import_fs3.existsSync)(p)) {
        logger17.info("[Config] Found bundled Node.js:", p);
        return p;
      }
    } catch {
    }
  }
  if (isPkg) {
    logger17.warn("[Config] Bundled Node.js not found, will use system node");
  }
  return null;
}
function detectGitBashPath2() {
  if ((0, import_os3.platform)() !== "win32") return null;
  const possiblePaths = [
    "C:\\Program Files\\Git\\bin\\bash.exe",
    "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
    (0, import_path6.resolve)((0, import_os3.homedir)(), "AppData", "Local", "Programs", "Git", "bin", "bash.exe"),
    (0, import_path6.resolve)((0, import_os3.homedir)(), "scoop", "apps", "git", "current", "bin", "bash.exe")
  ];
  for (const p of possiblePaths) {
    try {
      if ((0, import_fs3.existsSync)(p)) {
        logger17.info("[Config] Found Git Bash:", p);
        return p;
      }
    } catch {
    }
  }
  logger17.error("[Config] Git Bash not found! Please install Git for Windows: https://git-scm.com/downloads/win");
  return null;
}
function ensureDataDir(dataDir) {
  try {
    const imagesDir = (0, import_path6.resolve)(dataDir, "data", "images");
    (0, import_fs3.mkdirSync)(imagesDir, { recursive: true, mode: 448 });
    const probe = (0, import_path6.resolve)(imagesDir, `.__probe_${Date.now()}_${Math.random().toString(16).slice(2)}`);
    (0, import_fs3.writeFileSync)(probe, "ok");
    (0, import_fs3.unlinkSync)(probe);
    return dataDir;
  } catch {
    const fallback = (0, import_path6.resolve)((0, import_os3.homedir)(), ".agentx-desktop");
    logger17.warn("[Config] Data directory not writable, fallback:", fallback);
    const imagesDir = (0, import_path6.resolve)(fallback, "data", "images");
    (0, import_fs3.mkdirSync)(imagesDir, { recursive: true, mode: 448 });
    return fallback;
  }
}
function loadConfig() {
  const backendUrl = process.env.AGENTX_BACKEND_URL || "https://www.shoploopai.top/prod-api";
  const baseUrl = process.env.AGENTX_BASE_URL || "https://www.shoploopai.top/prod-api/llm-proxy";
  const config = {
    apiKey: process.env.AGENTX_API_KEY || "1",
    baseUrl,
    model: process.env.AGENTX_MODEL || "claude-sonnet-4-5-20250929",
    port: Number(process.env.AGENTX_PORT || 7726),
    dataDir: (0, import_path6.resolve)(process.env.AGENTX_DATA_DIR || getAppDataDir()),
    backendUrl,
    authToken: process.env.AGENTX_AUTH_TOKEN || null,
    claudeCodePath: process.env.CLAUDE_CODE_PATH || detectClaudeCodePath2(),
    nodePath: process.env.NODE_PATH_OVERRIDE || detectNodePath(),
    gitBashPath: process.env.CLAUDE_CODE_GIT_BASH_PATH || detectGitBashPath2()
  };
  config.dataDir = ensureDataDir(config.dataDir);
  if (process.env.AGENTX_SKILLS_DIR) {
    process.env.AGENTX_SKILLS_DIR = process.env.AGENTX_SKILLS_DIR.replace(/^\\\\\?\\/, "");
  }
  logger17.info("[Config] AGENTX_SKILLS_DIR from env:", process.env.AGENTX_SKILLS_DIR || "(not set)");
  if (process.env.AGENTX_SKILLS_DIR) {
    try {
      const files = (0, import_fs3.readdirSync)(process.env.AGENTX_SKILLS_DIR);
      logger17.info("[Config] AGENTX_SKILLS_DIR contents:", files.length, "entries");
      if (files.length === 0) {
        logger17.warn("[Config] AGENTX_SKILLS_DIR is empty, will auto-detect");
        process.env.AGENTX_SKILLS_DIR = "";
      }
    } catch (err) {
      logger17.warn("[Config] AGENTX_SKILLS_DIR not accessible, will auto-detect:", String(err));
      process.env.AGENTX_SKILLS_DIR = "";
    }
  }
  if (!process.env.AGENTX_SKILLS_DIR) {
    const scriptFile = require.main?.filename || process.argv[1];
    logger17.info("[Config] scriptFile:", scriptFile);
    if (scriptFile) {
      const cleanedFile = scriptFile.replace(/^\\\\\?\\/, "");
      const scriptDir = (0, import_path6.dirname)(cleanedFile);
      logger17.info("[Config] scriptDir (cleaned):", scriptDir);
      const candidates = [
        (0, import_path6.resolve)(scriptDir, "..", "skills"),
        (0, import_path6.resolve)(scriptDir, "..", "..", "..", "..", "binaries", "skills")
      ];
      logger17.info("[Config] skills candidates:", candidates);
      for (const candidate of candidates) {
        try {
          const exists = (0, import_fs3.existsSync)(candidate);
          const files = exists ? (0, import_fs3.readdirSync)(candidate) : [];
          logger17.info(`[Config] candidate ${candidate}: exists=${exists}, files=${files.length}`);
          if (exists && files.length > 0) {
            process.env.AGENTX_SKILLS_DIR = candidate;
            logger17.info("[Config] Auto-detected AGENTX_SKILLS_DIR:", candidate);
            break;
          }
        } catch (err) {
          logger17.warn("[Config] Error checking candidate:", candidate, String(err));
        }
      }
      if (!process.env.AGENTX_SKILLS_DIR) {
        logger17.warn("[Config] AGENTX_SKILLS_DIR not found, checked:", candidates);
      }
    }
  }
  logger17.info("[Config] Loaded:", {
    ...config,
    apiKey: config.apiKey ? "***" : "",
    authToken: config.authToken ? "***" : ""
  });
  return config;
}

// roleLlm.js
var roleLlmCache = /* @__PURE__ */ new Map();
var llmProxyBaseUrl = "";
function initLlmProxy(config) {
  llmProxyBaseUrl = config.baseUrl?.includes("llm-proxy") ? config.baseUrl : `${config.backendUrl.replace(/\/$/, "")}/llm-proxy`;
}
async function fetchRoleLlmConfigs(backendUrl, authToken) {
  if (!backendUrl) {
    logger17.info("[RoleLlm] No AGENTX_BACKEND_URL configured, skipping");
    return;
  }
  try {
    const url = `${backendUrl.replace(/\/$/, "")}/agent/agentRole/active-roles-internal`;
    const headers = { "Content-Type": "application/json" };
    if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
    logger17.info("[RoleLlm] Fetching configs from:", url);
    const response = await fetch(url, { headers, signal: AbortSignal.timeout(1e4) });
    if (!response.ok) {
      logger17.warn(`[RoleLlm] HTTP ${response.status}`);
      return;
    }
    const result = await response.json();
    const roles = result.data || [];
    roleLlmCache.clear();
    let count = 0;
    for (const role of roles) {
      if (role.llmConfig && (role.llmConfig.hasCustomKey || role.llmConfig.model || role.llmConfig.baseUrl)) {
        roleLlmCache.set(String(role.id), role.llmConfig);
        count++;
        logger17.info(`[RoleLlm] Role "${role.name}" (${role.id}): model=${role.llmConfig.model || "(global)"}`);
      }
    }
    logger17.info(`[RoleLlm] Loaded ${count}/${roles.length} roles with custom config`);
  } catch (error) {
    logger17.warn("[RoleLlm] Failed to fetch:", error.message);
  }
}
function startRoleConfigRefresh(backendUrl, authToken) {
  if (!backendUrl) return;
  setInterval(() => {
    fetchRoleLlmConfigs(backendUrl, authToken).catch(() => {
    });
  }, 5 * 60 * 1e3);
}
function messageInterceptor(event) {
  if (event.type !== "image_create_request") return event;
  const config = event.data?.config;
  if (!config?.name) return event;
  const roleId = String(config.name).split("_")[0];
  const cachedLlmConfig = roleLlmCache.get(roleId);
  if (cachedLlmConfig) {
    const currentUserContext = event.data && typeof event.data.userContext === "object" ? event.data.userContext : {};
    event.data.userContext = { ...currentUserContext, forcedRoleId: roleId };
    config.llmConfig = {
      baseUrl: llmProxyBaseUrl,
      ...cachedLlmConfig.model ? { model: cachedLlmConfig.model } : {}
    };
    logger17.info(`[RoleLlm] Injected forcedRoleId=${roleId} via llm-proxy`);
  } else {
    delete config.llmConfig;
  }
  return event;
}

// httpServer.js
var import_http = require("http");
var CORS_HEADERS = {
  "Access-Control-Allow-Origin": "*",
  "Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS",
  "Access-Control-Allow-Headers": "Content-Type"
};
async function createHttpServer(port, apiHandler) {
  const server = (0, import_http.createServer)((req, res) => {
    if (req.method === "OPTIONS") {
      res.writeHead(204, CORS_HEADERS);
      res.end();
      return;
    }
    if (req.url?.startsWith("/api/")) {
      apiHandler(req, res);
    } else {
      res.writeHead(404, CORS_HEADERS);
      res.end("Not found");
    }
  });
  await new Promise((resolve4, reject) => {
    server.listen(port, "127.0.0.1", () => resolve4());
    server.on("error", reject);
  });
  logger17.info(`[HTTP] Server listening on http://127.0.0.1:${port}`);
  return server;
}
function readBody(req) {
  return new Promise((resolve4, reject) => {
    let data = "";
    req.on("data", (chunk) => data += chunk);
    req.on("end", () => {
      try {
        resolve4(data ? JSON.parse(data) : {});
      } catch {
        reject(new Error("Invalid JSON"));
      }
    });
    req.on("error", reject);
  });
}
function sendJson(res, status, data) {
  const body = JSON.stringify(data);
  res.writeHead(status, { "Content-Type": "application/json", ...CORS_HEADERS });
  res.end(body);
}

// feishu/index.js
var import_fs4 = require("fs");
var import_path7 = require("path");

// feishu/FeishuBot.js
var lark = null;
async function getLark() {
  if (lark) return lark;
  try {
    lark = await Promise.resolve().then(() => __toESM(require_lib2(), 1));
  } catch {
    lark = null;
  }
  return lark;
}
var FeishuBot = class {
  constructor(config) {
    this.config = config;
    this._client = null;
    this._wsClient = null;
    this._running = false;
    this._onMessage = null;
  }
  /**
   * 启动 Bot，建立 WebSocket 长连接
   * @param {(msg: FeishuInboundMessage) => void} onMessage
   */
  async start(onMessage) {
    const lark2 = await getLark();
    if (!lark2) {
      throw new Error("@larksuiteoapi/node-sdk \u672A\u5B89\u88C5\uFF0C\u8BF7\u6267\u884C: npm install @larksuiteoapi/node-sdk");
    }
    if (!this.config.appId || !this.config.appSecret) {
      throw new Error("\u98DE\u4E66 appId \u548C appSecret \u4E0D\u80FD\u4E3A\u7A7A");
    }
    this._onMessage = onMessage;
    this._running = true;
    this._client = new lark2.Client({
      appId: this.config.appId,
      appSecret: this.config.appSecret,
      loggerLevel: lark2.LoggerLevel.error
    });
    const eventDispatcher = new lark2.EventDispatcher({
      encryptKey: this.config.encryptKey || ""
    }).register({
      "im.message.receive_v1": (data) => this._handleIncoming(data)
    });
    this._wsClient = new lark2.WSClient({
      appId: this.config.appId,
      appSecret: this.config.appSecret,
      loggerLevel: lark2.LoggerLevel.error
    });
    this._wsClient.start({ eventDispatcher }).catch((err) => {
      if (this._running) {
        logger17.error("[FeishuBot] WebSocket error:", err.message);
      }
    });
    logger17.info("[FeishuBot] Started, appId:", this.config.appId);
  }
  /**
   * 停止 Bot
   */
  async stop() {
    this._running = false;
    try {
      this._wsClient?.close?.({ force: true });
    } catch {
    }
    this._client = null;
    this._wsClient = null;
    logger17.info("[FeishuBot] Stopped");
  }
  /**
   * 向指定 chat 发送文本消息
   * @param {string} chatId  飞书 chat_id 或 open_id
   * @param {string} text    消息内容（支持 Markdown）
   */
  /**
   * 向指定 chat 发送文本消息，返回消息 ID（用于后续编辑）
   * @returns {Promise<string|null>} messageId
   */
  async sendText(chatId, text) {
    if (!this._client) return null;
    const receiveIdType = chatId.startsWith("oc_") ? "chat_id" : "open_id";
    try {
      const res = await this._client.im.message.create({
        params: { receive_id_type: receiveIdType },
        data: {
          receive_id: chatId,
          msg_type: "text",
          content: JSON.stringify({ text })
        }
      });
      if (res.code !== 0) {
        logger17.warn("[FeishuBot] Send failed:", res.code, res.msg);
        return null;
      }
      return res.data?.message_id ?? null;
    } catch (err) {
      logger17.error("[FeishuBot] sendText error:", err.message);
      return null;
    }
  }
  async sendCard(chatId, cardContent) {
    if (!this._client) return null;
    const receiveIdType = chatId.startsWith("oc_") ? "chat_id" : "open_id";
    try {
      const res = await this._client.im.message.create({
        params: { receive_id_type: receiveIdType },
        data: {
          receive_id: chatId,
          msg_type: "interactive",
          content: JSON.stringify(cardContent)
        }
      });
      if (res.code !== 0) {
        logger17.warn("[FeishuBot] sendCard failed:", res.code, res.msg);
        return null;
      }
      return res.data?.message_id ?? null;
    } catch (err) {
      logger17.error("[FeishuBot] sendCard error:", err.message);
      return null;
    }
  }
  async updateCard(messageId, cardContent) {
    if (!this._client || !messageId) return false;
    const contentStr = JSON.stringify(cardContent);
    const MAX_RETRIES = 3;
    for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
      try {
        logger17.debug(`[FeishuBot] updateCard PATCH msgId=${messageId} attempt=${attempt} size=${contentStr.length}`);
        const res = await this._client.im.message.patch({
          path: { message_id: messageId },
          data: { content: contentStr }
        });
        if (res.code === 0) {
          logger17.debug(`[FeishuBot] updateCard OK msgId=${messageId}`);
          return true;
        }
        logger17.warn(`[FeishuBot] updateCard PATCH failed: code=${res.code} msg=${res.msg}`);
        return false;
      } catch (err) {
        if (attempt < MAX_RETRIES) {
          logger17.warn(`[FeishuBot] updateCard error (attempt ${attempt}/${MAX_RETRIES}): ${err.message}`);
          await new Promise((r3) => setTimeout(r3, 300 * attempt));
        } else {
          logger17.error(`[FeishuBot] updateCard failed after ${MAX_RETRIES} attempts: ${err.message}`);
          return false;
        }
      }
    }
    return false;
  }
  /**
   * 向飞书添加表情回应（可选）
   * @param {string} messageId
   * @param {string} emojiType  e.g. "THUMBSUP"
   */
  async sendImage(chatId, imageBuffer) {
    if (!this._client || !imageBuffer) return false;
    logger17.info(`[FeishuBot] sendImage chatId=${chatId} bufferSize=${imageBuffer.length}`);
    const fs2 = await import("fs");
    const os2 = await import("os");
    const path2 = await import("path");
    const tmpPath = path2.join(os2.tmpdir(), `feishu_upload_${Date.now()}_${Math.random().toString(36).slice(2, 8)}.png`);
    try {
      fs2.writeFileSync(tmpPath, imageBuffer);
      const stream = fs2.createReadStream(tmpPath);
      logger17.debug("[FeishuBot] Uploading image to Feishu...");
      const uploadRes = await this._client.im.image.create({
        data: { image_type: "message", image: stream }
      });
      const imageKey = uploadRes?.data?.image_key ?? uploadRes?.image_key;
      const code = uploadRes?.code;
      if (code !== void 0 && code !== 0) {
        logger17.warn(`[FeishuBot] uploadImage failed: code=${code} msg=${uploadRes?.msg}`);
        return false;
      }
      if (!imageKey) {
        logger17.warn(`[FeishuBot] uploadImage: no image_key in response`);
        return false;
      }
      logger17.info(`[FeishuBot] Image uploaded, key=${imageKey}`);
      const receiveIdType = chatId.startsWith("oc_") ? "chat_id" : "open_id";
      const sendRes = await this._client.im.message.create({
        params: { receive_id_type: receiveIdType },
        data: {
          receive_id: chatId,
          msg_type: "image",
          content: JSON.stringify({ image_key: imageKey })
        }
      });
      if (sendRes.code !== 0) {
        logger17.warn(`[FeishuBot] sendImage message failed: code=${sendRes.code} msg=${sendRes.msg}`);
        return false;
      }
      logger17.info("[FeishuBot] Image sent successfully");
      return true;
    } catch (err) {
      logger17.error("[FeishuBot] sendImage error:", err.message);
      return false;
    } finally {
      try {
        (await import("fs")).unlinkSync(tmpPath);
      } catch {
      }
    }
  }
  async addReaction(messageId, emojiType = "THUMBSUP") {
    if (!this._client) return;
    try {
      await this._client.im.messageReaction.create({
        path: { message_id: messageId },
        data: { reaction_type: { emoji_type: emojiType } }
      });
    } catch {
    }
  }
  // ---------- 内部 ----------
  async _handleIncoming(data) {
    if (!this._running || !this._onMessage) return;
    const msg = data.message;
    const sender = data.sender;
    if (sender?.sender_type === "bot") return;
    const senderId = sender?.sender_id?.open_id ?? "unknown";
    const chatId = msg.chat_id;
    const msgType = msg.message_type;
    let content;
    try {
      const parsed = JSON.parse(msg.content || "{}");
      if (msgType === "text") {
        const text = parsed.text || "";
        if (!text.trim()) return;
        content = text;
      } else if (msgType === "image") {
        const fileKey = parsed.image_key;
        if (!fileKey) return;
        try {
          const res = await this._client.im.messageResource.get({
            params: { type: "image" },
            path: { message_id: msg.message_id, file_key: fileKey }
          });
          const stream = res.getReadableStream();
          const chunks = [];
          await new Promise((resolve4, reject) => {
            stream.on("data", (chunk) => chunks.push(chunk));
            stream.on("end", resolve4);
            stream.on("error", reject);
          });
          const base64 = Buffer.concat(chunks).toString("base64");
          content = { type: "image", data: base64, mediaType: "image/jpeg" };
        } catch (err) {
          logger17.warn(`[FeishuBot] Failed to download image ${fileKey}:`, err.message);
          return;
        }
      } else {
        logger17.info(`[FeishuBot] Unsupported message type: ${msgType}`);
        return;
      }
    } catch {
      return;
    }
    this._onMessage({
      messageId: msg.message_id,
      chatId,
      senderId,
      content,
      chatType: msg.chat_type
      // "p2p" | "group"
    });
  }
};

// feishu/FeishuBridge.js
var import_node_os2 = __toESM(require("node:os"), 1);

// feishu/FeishuCardBuilder.js
var HEADER_TEMPLATES = {
  pending: { title: "\u23F3 \u6536\u5230\u6D88\u606F", template: "turquoise" },
  thinking: { title: "\u{1F4AD} \u601D\u8003\u4E2D", template: "indigo" },
  responding: { title: "\u270D\uFE0F \u56DE\u590D\u4E2D", template: "blue" },
  tool_use: { title: "\u{1F527} \u5DE5\u5177\u6267\u884C", template: "orange" }
};
function buildCard({ status, text, currentTool, toolHistory }) {
  const elements = [];
  if (text) {
    const cursor = status === "complete" ? "" : " \u258C";
    elements.push({ tag: "markdown", content: text + cursor });
  } else if (status === "pending") {
    elements.push({ tag: "markdown", content: "\u6B63\u5728\u51C6\u5907\u56DE\u590D\u2026" });
  } else if (status === "thinking") {
    elements.push({ tag: "markdown", content: "\u6B63\u5728\u6DF1\u5EA6\u601D\u8003\u4F60\u7684\u95EE\u9898\u2026" });
  }
  const hasToolInfo = currentTool || toolHistory && toolHistory.length > 0;
  if (hasToolInfo) {
    if (elements.length > 0) elements.push({ tag: "hr" });
    const lines = [];
    if (toolHistory && toolHistory.length > 0) {
      for (const t of toolHistory) {
        lines.push(`\u2705 ${t}`);
      }
    }
    if (currentTool) {
      lines.push(`\u23F3 \u6B63\u5728\u6267\u884C: **${currentTool}**`);
    }
    elements.push({ tag: "markdown", content: lines.join("\n") });
  }
  const card = {
    config: { wide_screen_mode: true, update_multi: true },
    elements
  };
  const headerCfg = HEADER_TEMPLATES[status];
  if (headerCfg) {
    card.header = {
      title: { tag: "plain_text", content: headerCfg.title },
      template: headerCfg.template
    };
  }
  return card;
}

// feishu/FeishuBridge.js
var FeishuBridge = class {
  constructor(agentx, bot, sessionManager, roleConfig) {
    this._agentx = agentx;
    this._bot = bot;
    this._sessionManager = sessionManager;
    this._roleConfig = roleConfig;
    this._streams = /* @__PURE__ */ new Map();
    this._unsubscribes = [];
    this._setupListeners();
  }
  // =====================================================
  // 入方向：飞书消息 → agentx
  // =====================================================
  async handleFeishuMessage(msg) {
    const preview = typeof msg.content === "string" ? msg.content.slice(0, 50) : "[image]";
    logger17.info(`[FeishuBridge] \u2190 Feishu [${msg.chatId}]: ${preview}`);
    let agentxContent;
    if (typeof msg.content === "object" && msg.content.type === "image") {
      agentxContent = [
        { type: "image", data: msg.content.data, mediaType: msg.content.mediaType }
      ];
    } else {
      agentxContent = msg.content;
    }
    try {
      const imageId = await this._sessionManager.getOrCreate(
        msg.chatId,
        this._agentx,
        this._roleConfig
      );
      const s = this._getOrInitStream(imageId);
      if (s._finalized || s.feishuMsgId) {
        logger17.info(`[FeishuBridge] Reinitializing stream, imageId=${imageId}`);
        s.feishuMsgId = null;
        s.text = "";
        s.status = "pending";
        s.currentTool = null;
        s.toolHistory = [];
        s.lastFlushTime = 0;
        s.dirty = false;
        s._creating = false;
        s._createPromise = null;
        s._finalized = false;
        s._conversationEnding = false;
        s._flushInFlight = false;
        s._flushQueued = false;
        s._streamRev = (s._streamRev || 0) + 1;
        s.sentAssistantImageUrls = /* @__PURE__ */ new Set();
        s.assistantImagesSentCount = 0;
        clearTimeout(s.flushTimer);
        s.flushTimer = null;
        clearTimeout(s._errorTimeout);
        s._errorTimeout = null;
      } else {
        s.status = "pending";
      }
      this._ensureCard(imageId);
      await this._agentx.request("image_run_request", { imageId }).catch(() => {
      });
      await this._agentx.request("message_send_request", {
        imageId,
        content: agentxContent
      });
      await this._bot.addReaction(msg.messageId, "THUMBSUP").catch(() => {
      });
    } catch (err) {
      logger17.error("[FeishuBridge] Failed to forward message:", err.message);
    }
  }
  destroy() {
    for (const state of this._streams.values()) {
      clearTimeout(state.flushTimer);
      clearTimeout(state._errorTimeout);
    }
    this._streams.clear();
    for (const unsub of this._unsubscribes) {
      try {
        unsub();
      } catch {
      }
    }
    this._unsubscribes = [];
  }
  // =====================================================
  // 内部：Stream 状态管理
  // =====================================================
  _sub(eventName, handler) {
    const unsub = this._agentx.on(eventName, handler);
    if (unsub) this._unsubscribes.push(unsub);
  }
  _getOrInitStream(imageId) {
    let s = this._streams.get(imageId);
    if (!s) {
      s = {
        feishuMsgId: null,
        text: "",
        status: "pending",
        currentTool: null,
        toolHistory: [],
        lastFlushTime: 0,
        flushTimer: null,
        dirty: false,
        _creating: false,
        _createPromise: null,
        _finalized: false,
        _conversationEnding: false,
        _flushInFlight: false,
        _flushQueued: false,
        sentAssistantImageUrls: /* @__PURE__ */ new Set(),
        assistantImagesSentCount: 0,
        _streamRev: 0
      };
      this._streams.set(imageId, s);
    }
    return s;
  }
  _bumpDirty(s) {
    s.dirty = true;
    s._streamRev = (s._streamRev || 0) + 1;
  }
  _reopenStreamAfterPrematureEnd(s, imageId, reason) {
    if (!s._finalized) return;
    logger17.info(`[FeishuBridge] Reopen stream (${reason}), imageId=${imageId}`);
    s._finalized = false;
    s._conversationEnding = false;
  }
  _resolve(e3) {
    const imageId = e3.context?.imageId;
    if (!imageId) return null;
    if (!this._sessionManager.getChatId(imageId)) return null;
    const s = this._streams.get(imageId);
    if (!s) {
      logger17.debug(`[FeishuBridge] _resolve: no stream imageId=${imageId}`);
      return null;
    }
    this._reopenStreamAfterPrematureEnd(s, imageId, "incoming event");
    return { imageId, s };
  }
  // =====================================================
  // 事件订阅
  // =====================================================
  _setupListeners() {
    this._sub("conversation_thinking", (e3) => {
      const r3 = this._resolve(e3);
      if (!r3) return;
      r3.s.status = "thinking";
      this._bumpDirty(r3.s);
      this._ensureCard(r3.imageId);
      this._immediateFlush(r3.imageId);
    });
    this._sub("conversation_responding", (e3) => {
      const r3 = this._resolve(e3);
      if (!r3) return;
      r3.s.status = "responding";
      r3.s.currentTool = null;
      this._bumpDirty(r3.s);
      this._ensureCard(r3.imageId);
      this._scheduleFlush(r3.imageId);
    });
    this._sub("text_delta", (e3) => {
      const r3 = this._resolve(e3);
      if (!r3) return;
      const text = e3.data?.text;
      if (!text) return;
      const wasResponding = r3.s.status === "responding";
      r3.s.text += text;
      r3.s.status = "responding";
      this._bumpDirty(r3.s);
      this._ensureCard(r3.imageId);
      if (!wasResponding) {
        logger17.info(`[FeishuBridge] First text_delta \u2192 immediate flush, imageId=${r3.imageId}`);
        this._immediateFlush(r3.imageId);
      } else {
        this._scheduleFlush(r3.imageId);
      }
    });
    this._sub("tool_use_start", (e3) => {
      const r3 = this._resolve(e3);
      if (!r3) return;
      r3.s.status = "tool_use";
      r3.s.currentTool = e3.data?.toolName ?? "unknown";
      this._bumpDirty(r3.s);
      this._ensureCard(r3.imageId);
      this._immediateFlush(r3.imageId);
    });
    this._sub("tool_executing", (e3) => {
      const r3 = this._resolve(e3);
      if (!r3) return;
      r3.s.status = "tool_use";
      if (e3.data?.toolName) r3.s.currentTool = e3.data.toolName;
      this._bumpDirty(r3.s);
      this._immediateFlush(r3.imageId);
    });
    this._sub("tool_result_message", (e3) => {
      const imageId = e3.context?.imageId;
      if (!imageId) return;
      const s = this._streams.get(imageId);
      if (!s || !this._sessionManager.getChatId(imageId)) return;
      this._reopenStreamAfterPrematureEnd(s, imageId, "tool_result");
      if (s.currentTool) {
        s.toolHistory.push(s.currentTool);
        s.currentTool = null;
        this._bumpDirty(s);
        this._immediateFlush(imageId);
      }
    });
    this._sub("error_occurred", async (e3) => {
      const imageId = e3.context?.imageId;
      if (!imageId) return;
      const chatId = this._sessionManager.getChatId(imageId);
      if (!chatId) return;
      const s = this._streams.get(imageId);
      if (!s || s._finalized) return;
      const errMsg = e3.data?.message || "\u672A\u77E5\u9519\u8BEF";
      logger17.error(`[FeishuBridge] error_occurred: ${errMsg}`);
      if (s.feishuMsgId) {
        const card = buildCard({
          status: s.status,
          text: (s.text || "") + `

> \u26A0\uFE0F \u9047\u5230\u9519\u8BEF: ${errMsg}\uFF0C\u6B63\u5728\u5C1D\u8BD5\u6062\u590D\u2026`,
          currentTool: s.currentTool,
          toolHistory: s.toolHistory
        });
        await this._bot.updateCard(s.feishuMsgId, card).catch(() => {
        });
      }
      if (!s._errorTimeout) {
        const capturedRev = s._streamRev;
        s._errorTimeout = setTimeout(async () => {
          const st = this._streams.get(imageId);
          if (!st || st._finalized || st._streamRev !== capturedRev) return;
          st._finalized = true;
          clearTimeout(st.flushTimer);
          if (st._createPromise) await st._createPromise.catch(() => {
          });
          const finalText = st.text || `\u26A0\uFE0F \u5904\u7406\u51FA\u9519: ${errMsg}`;
          const card = buildCard({ status: "complete", text: finalText, toolHistory: st.toolHistory });
          if (st.feishuMsgId) {
            const ok = await this._bot.updateCard(st.feishuMsgId, card);
            if (!ok) await this._bot.sendText(chatId, finalText);
          } else {
            await this._bot.sendText(chatId, finalText);
          }
        }, 1e4);
      }
    });
    this._sub("error_message", async (e3) => {
      const imageId = e3.context?.imageId;
      if (!imageId) return;
      const s = this._streams.get(imageId);
      if (!s || s._finalized) return;
      const errMsg = e3.data?.message || e3.data?.content || "\u53D1\u751F\u9519\u8BEF";
      logger17.error(`[FeishuBridge] error_message: ${errMsg}`);
      s._finalized = true;
      clearTimeout(s.flushTimer);
      clearTimeout(s._errorTimeout);
      if (s._createPromise) await s._createPromise.catch(() => {
      });
      const chatId = this._sessionManager.getChatId(imageId);
      if (!chatId) return;
      const finalText = s.text ? s.text + `

> \u26A0\uFE0F ${errMsg}` : `\u26A0\uFE0F ${errMsg}`;
      const card = buildCard({ status: "complete", text: finalText, toolHistory: s.toolHistory });
      if (s.feishuMsgId) {
        const ok = await this._bot.updateCard(s.feishuMsgId, card);
        if (!ok) await this._bot.sendText(chatId, finalText);
      } else {
        await this._bot.sendText(chatId, finalText);
      }
    });
    this._sub("conversation_end", async (e3) => {
      const imageId = e3.context?.imageId;
      if (!imageId) return;
      const chatId = this._sessionManager.getChatId(imageId);
      if (!chatId) return;
      const s = this._streams.get(imageId);
      if (!s || s._finalized) return;
      if (s._conversationEnding) return;
      s._conversationEnding = true;
      clearTimeout(s._errorTimeout);
      if (s._createPromise) await s._createPromise.catch(() => {
      });
      if (s.dirty && s.feishuMsgId && s.text) {
        await this._flush(imageId);
      }
      clearTimeout(s.flushTimer);
      s.flushTimer = null;
      s._finalized = true;
      const endedRev = s._streamRev;
      logger17.info(`[FeishuBridge] conversation_end: imageId=${imageId} textLen=${s.text.length} msgId=${s.feishuMsgId} tools=${s.toolHistory.length} rev=${endedRev}`);
      const cardFoot = "";
      if (!s.text) {
        if (s.feishuMsgId) {
          const note = "\uFF08\u64CD\u4F5C\u5B8C\u6210\uFF09";
          const card2 = buildCard({ status: "complete", text: note, toolHistory: s.toolHistory });
          await this._bot.updateCard(s.feishuMsgId, card2);
        }
        s._conversationEnding = false;
        return;
      }
      logger17.info(`[FeishuBridge] \u2192 Feishu [${chatId}]: ${s.text.slice(0, 80)}...`);
      const finalBody = s.text;
      const card = buildCard({ status: "complete", text: finalBody, toolHistory: s.toolHistory });
      if (s._streamRev !== endedRev) {
        logger17.warn(`[FeishuBridge] conversation_end: rev changed, skipping`);
        s._conversationEnding = false;
        return;
      }
      if (s.feishuMsgId) {
        const ok = await this._bot.updateCard(s.feishuMsgId, card);
        if (!ok) await this._bot.sendText(chatId, finalBody);
      } else {
        await this._bot.sendText(chatId, finalBody);
      }
      s._conversationEnding = false;
    });
    logger17.info("[FeishuBridge] Listeners registered (streaming card v2)");
  }
  // =====================================================
  // 卡片管理
  // =====================================================
  _ensureCard(imageId) {
    const s = this._streams.get(imageId);
    if (!s || s.feishuMsgId || s._creating) return;
    const chatId = this._sessionManager.getChatId(imageId);
    if (!chatId) return;
    s._creating = true;
    s._createPromise = (async () => {
      try {
        const card = buildCard({ status: s.status, text: s.text, currentTool: s.currentTool, toolHistory: s.toolHistory });
        const msgId = await this._bot.sendCard(chatId, card);
        if (msgId) {
          s.feishuMsgId = msgId;
          s.lastFlushTime = Date.now();
          logger17.info(`[FeishuBridge] Card created, msgId=${msgId}`);
        }
      } catch (err) {
        logger17.error("[FeishuBridge] _ensureCard error:", err.message);
      } finally {
        s._creating = false;
        if (s.dirty && s.feishuMsgId && !s._finalized) {
          this._flush(imageId);
        }
      }
    })();
  }
  /** 节流调度：立即触发（setTimeout 0），由 _flushInFlight 保护不并发 PATCH */
  _scheduleFlush(imageId) {
    const s = this._streams.get(imageId);
    if (!s || !s.dirty || s.flushTimer) return;
    if (!s.feishuMsgId) return;
    s.flushTimer = setTimeout(() => {
      s.flushTimer = null;
      this._flush(imageId);
    }, 0);
  }
  /** 立即 flush（状态变化、首个文本块） */
  _immediateFlush(imageId) {
    const s = this._streams.get(imageId);
    if (!s || !s.dirty) return;
    if (s.flushTimer) {
      clearTimeout(s.flushTimer);
      s.flushTimer = null;
    }
    if (!s.feishuMsgId) return;
    this._flush(imageId);
  }
  async _flush(imageId) {
    const s = this._streams.get(imageId);
    if (!s || !s.dirty || !s.feishuMsgId) return;
    if (s._flushInFlight) {
      s._flushQueued = true;
      return;
    }
    s._flushInFlight = true;
    const revAtFlushStart = s._streamRev;
    try {
      if (s._streamRev === revAtFlushStart) {
        s.dirty = false;
      }
      s.lastFlushTime = Date.now();
      const card = buildCard({ status: s.status, text: s.text, currentTool: s.currentTool, toolHistory: s.toolHistory });
      const patchRev = s._streamRev;
      logger17.debug(`[FeishuBridge] Flushing: status=${s.status} textLen=${s.text.length} rev=${patchRev}`);
      this._bot.updateCard(s.feishuMsgId, card).then((ok) => {
        if (!ok) logger17.warn(`[FeishuBridge] updateCard returned false`);
      }).catch((err) => {
        logger17.error(`[FeishuBridge] updateCard error: ${err.message}`);
      });
    } finally {
      s._flushInFlight = false;
      if ((s._flushQueued || s.dirty) && s.feishuMsgId && !s._finalized) {
        s._flushQueued = false;
        queueMicrotask(() => {
          this._flush(imageId).catch(() => {
          });
        });
      } else {
        s._flushQueued = false;
      }
    }
  }
  // =====================================================
  // 图片发送
  // =====================================================
  _extractAndSendImageParts(chatId, parts) {
    if (!Array.isArray(parts)) return;
    for (const part of parts) {
      if (!part || part.type !== "image" || !part.data) continue;
      let base64 = part.data;
      if (base64.startsWith("data:")) base64 = base64.split(",")[1] || "";
      if (!base64) continue;
      const buf = Buffer.from(base64, "base64");
      logger17.info(`[FeishuBridge] Sending base64 image ${buf.length}B`);
      this._bot.sendImage(chatId, buf).catch((err) => {
        logger17.error("[FeishuBridge] sendImage error:", err.message);
      });
    }
  }
  _collectAssistantImageUrls(text) {
    if (!text) return { urls: [], localPaths: [] };
    const urls = /* @__PURE__ */ new Set();
    const localPaths = /* @__PURE__ */ new Set();
    const md = /!\[[^\]]*\]\((https?:\/\/[^)\s]+)\)/g;
    let m;
    while ((m = md.exec(text)) !== null) urls.add(m[1]);
    const plain = /https?:\/\/[^\s"'<>)}\]]+\.(?:png|jpe?g|gif|webp|bmp|svg)(?:\?[^\s"'<>)}\]]*)*/gi;
    const found = text.match(plain);
    if (found) found.forEach((u) => urls.add(u));
    const localPattern = /(?:^|[\s"'=:~])((?:~|\/?(?:Users|home|tmp|var))[^\s"'<>)}\]]*\.(?:png|jpe?g|gif|webp|bmp|svg))/gi;
    while ((m = localPattern.exec(text)) !== null) {
      let path2 = m[1];
      if (path2.startsWith("~")) path2 = path2.replace(/^~/, import_node_os2.default.homedir());
      if (!path2.startsWith("/")) path2 = "/" + path2;
      localPaths.add(path2);
    }
    return { urls: [...urls], localPaths: [...localPaths] };
  }
  async _sendNewAssistantImagesFromText(chatId, s) {
    const { urls, localPaths } = this._collectAssistantImageUrls(s.text);
    let batch = 0;
    const maxPerTurn = 15;
    for (const url of urls) {
      if (s.sentAssistantImageUrls.has(url)) continue;
      if (s.assistantImagesSentCount >= maxPerTurn) break;
      const ok = await this._downloadAndSendImage(chatId, url);
      if (ok) {
        s.sentAssistantImageUrls.add(url);
        s.assistantImagesSentCount++;
        batch++;
      }
    }
    for (const path2 of localPaths) {
      if (s.sentAssistantImageUrls.has(path2)) continue;
      if (s.assistantImagesSentCount >= maxPerTurn) break;
      const ok = await this._readAndSendLocalImage(chatId, path2);
      if (ok) {
        s.sentAssistantImageUrls.add(path2);
        s.assistantImagesSentCount++;
        batch++;
      }
    }
    if (batch > 0) logger17.info(`[FeishuBridge] Sent ${batch} images (total ${s.assistantImagesSentCount})`);
  }
  async _readAndSendLocalImage(chatId, filePath) {
    try {
      const fs2 = await import("fs");
      if (!fs2.existsSync(filePath)) {
        logger17.debug(`[FeishuBridge] Local image not found: ${filePath}`);
        return false;
      }
      const buf = fs2.readFileSync(filePath);
      if (buf.length < 100) {
        logger17.warn(`[FeishuBridge] Image too small: ${buf.length}B`);
        return false;
      }
      logger17.info(`[FeishuBridge] Sending local image ${buf.length}B: ${filePath.slice(-60)}`);
      return await this._bot.sendImage(chatId, buf);
    } catch (err) {
      logger17.error(`[FeishuBridge] _readAndSendLocalImage error: ${err.message}`);
      return false;
    }
  }
  async _downloadAndSendImage(chatId, url) {
    try {
      logger17.info(`[FeishuBridge] Downloading: ${url.slice(0, 80)}`);
      const res = await fetch(url);
      if (!res.ok) {
        logger17.warn(`[FeishuBridge] Download failed: ${res.status}`);
        return false;
      }
      const arrayBuf = await res.arrayBuffer();
      const buf = Buffer.from(arrayBuf);
      if (buf.length < 100) {
        logger17.warn(`[FeishuBridge] Downloaded image too small: ${buf.length}B`);
        return false;
      }
      return await this._bot.sendImage(chatId, buf);
    } catch (err) {
      logger17.error(`[FeishuBridge] _downloadAndSendImage error: ${err.message}`);
      return false;
    }
  }
};

// feishu/FeishuSessionManager.js
var FeishuSessionManager = class {
  constructor() {
    this._chatToImage = /* @__PURE__ */ new Map();
    this._imageToChat = /* @__PURE__ */ new Map();
  }
  /**
   * 获取已有对话，若不存在则创建新对话
   * @param {string} chatId         飞书 chat_id
   * @param {object} agentx         agentx 实例
   * @param {object} roleConfig     { agentId, name, systemPrompt?, mcpServers?, disallowedTools? }
   * @returns {Promise<string>}     imageId
   */
  async getOrCreate(chatId, agentx, roleConfig) {
    const existing = this._chatToImage.get(chatId);
    if (existing) return existing;
    logger17.info(`[FeishuSession] Creating new conversation for chatId=${chatId}, role=${roleConfig.name}`);
    const imageConfig = {
      name: roleConfig.name + "_feishu_" + Date.now(),
      description: "\u98DE\u4E66\u63A5\u5165 - " + roleConfig.name
    };
    if (roleConfig.systemPrompt) imageConfig.systemPrompt = roleConfig.systemPrompt;
    if (roleConfig.mcpServers) imageConfig.mcpServers = roleConfig.mcpServers;
    if (roleConfig.disallowedTools?.length) imageConfig.disallowedTools = roleConfig.disallowedTools;
    if (roleConfig.tools) imageConfig.tools = roleConfig.tools;
    const containerId = "feishu_" + roleConfig.agentId;
    const createPayload = { containerId, config: imageConfig };
    if (roleConfig.userId) {
      createPayload.userContext = { userId: roleConfig.userId };
    }
    const result = await agentx.request("image_create_request", createPayload);
    const imageId = result?.data?.record?.imageId;
    if (!imageId) {
      logger17.error("[FeishuSession] image_create_request response:", JSON.stringify(result?.data));
      throw new Error("\u521B\u5EFA agentx \u5BF9\u8BDD\u5931\u8D25");
    }
    await agentx.request("image_run_request", { imageId });
    this._chatToImage.set(chatId, imageId);
    this._imageToChat.set(imageId, chatId);
    logger17.info(`[FeishuSession] Mapped chatId=${chatId} \u2192 imageId=${imageId}`);
    return imageId;
  }
  /**
   * 根据 imageId 查飞书 chat_id（用于回复方向）
   * @returns {string|undefined}
   */
  getChatId(imageId) {
    return this._imageToChat.get(imageId);
  }
  /**
   * 清除所有会话映射
   */
  clear() {
    this._chatToImage.clear();
    this._imageToChat.clear();
    logger17.info("[FeishuSession] All sessions cleared");
  }
};

// feishu/index.js
var FeishuManager = class {
  /**
   * @param {object} agentx    agentx 实例
   * @param {string} dataDir   数据目录，用于持久化配置
   */
  constructor(agentx, dataDir) {
    this._agentx = agentx;
    this._configFile = (0, import_path7.resolve)(dataDir, "feishu-configs.json");
    this._instances = /* @__PURE__ */ new Map();
  }
  /**
   * 启动时自动恢复所有已保存的飞书连接
   */
  async restoreAll() {
    const configs = this._loadConfigs();
    for (const [roleId, saved] of Object.entries(configs)) {
      try {
        const feishuConfig = saved.feishu ?? saved;
        const roleConfig = { ...saved.role ?? {} };
        if (!roleConfig.agentId) {
          logger17.warn(`[FeishuManager] Role ${roleId} not found, skip restore`);
          continue;
        }
        if (roleConfig._uid) {
          roleConfig.userId = this._decodeUserId(roleConfig._uid);
          delete roleConfig._uid;
        }
        await this.start(roleId, feishuConfig, roleConfig);
        logger17.info(`[FeishuManager] Restored Feishu bot for role: ${roleId}`);
      } catch (err) {
        logger17.warn(`[FeishuManager] Failed to restore role ${roleId}:`, err.message);
      }
    }
  }
  /**
   * 启动某个角色的飞书 Bot
   * @param {string} roleId
   * @param {{ appId, appSecret, encryptKey? }} feishuConfig
   * @param {{ agentId, name, mcpServers?, disallowedTools? }} roleConfig
   */
  async start(roleId, feishuConfig, roleConfig) {
    for (const [existingRoleId, instance] of this._instances.entries()) {
      if (existingRoleId !== roleId && instance.config.appId === feishuConfig.appId) {
        throw new Error(`App ID ${feishuConfig.appId} \u5DF2\u88AB\u89D2\u8272 "${instance.roleName || existingRoleId}" \u4F7F\u7528\uFF0C\u8BF7\u5148\u65AD\u5F00\u8BE5\u89D2\u8272\u7684\u98DE\u4E66\u8FDE\u63A5`);
      }
    }
    await this.stop(roleId);
    const bot = new FeishuBot(feishuConfig);
    const sessionManager = new FeishuSessionManager();
    const bridge = new FeishuBridge(this._agentx, bot, sessionManager, roleConfig);
    await bot.start((msg) => bridge.handleFeishuMessage(msg));
    this._instances.set(roleId, { bot, bridge, sessionManager, config: feishuConfig, roleName: roleConfig.name });
    this._saveConfig(roleId, feishuConfig, roleConfig);
    logger17.info(`[FeishuManager] Started Feishu bot for role: ${roleId}`);
  }
  /**
   * 停止某个角色的飞书 Bot
   * @param {string} roleId
   */
  async stop(roleId) {
    const instance = this._instances.get(roleId);
    if (!instance) return;
    instance.bridge.destroy();
    instance.sessionManager.clear();
    await instance.bot.stop();
    this._instances.delete(roleId);
    logger17.info(`[FeishuManager] Stopped Feishu bot for role: ${roleId}`);
  }
  /**
   * 停止并删除配置
   * @param {string} roleId
   */
  async remove(roleId) {
    await this.stop(roleId);
    this._deleteConfig(roleId);
    logger17.info(`[FeishuManager] Removed Feishu config for role: ${roleId}`);
  }
  /**
   * 获取所有已接入的角色状态
   */
  getStatus() {
    const result = {};
    for (const [roleId, instance] of this._instances.entries()) {
      result[roleId] = {
        connected: true,
        appId: instance.config.appId,
        appSecret: instance.config.appSecret,
        encryptKey: instance.config.encryptKey
      };
    }
    return result;
  }
  /**
   * 停止所有 Bot
   */
  async stopAll() {
    for (const roleId of [...this._instances.keys()]) {
      await this.stop(roleId);
    }
  }
  /**
   * 用户登录后同步 userId 到所有飞书配置
   * @param {number} userId
   */
  syncUserId(userId) {
    for (const instance of this._instances.values()) {
      instance.bridge._roleConfig.userId = userId;
      instance.sessionManager.clear();
    }
    const all = this._loadConfigs();
    for (const saved of Object.values(all)) {
      if (saved.role) saved.role._uid = this._encodeUserId(userId);
    }
    try {
      (0, import_fs4.writeFileSync)(this._configFile, JSON.stringify(all, null, 2), { mode: 384 });
    } catch (err) {
      logger17.warn("[FeishuManager] Failed to sync userId:", err.message);
    }
    logger17.info(`[FeishuManager] Synced userId to ${this._instances.size} instances`);
  }
  // ---------- 配置持久化 ----------
  _loadConfigs() {
    try {
      if ((0, import_fs4.existsSync)(this._configFile)) {
        return JSON.parse((0, import_fs4.readFileSync)(this._configFile, "utf-8"));
      }
    } catch (err) {
      logger17.warn("[FeishuManager] Failed to load configs:", err.message);
    }
    return {};
  }
  _saveConfig(roleId, feishuConfig, roleConfig) {
    const all = this._loadConfigs();
    const savedRole = { ...roleConfig };
    if (savedRole.userId != null) {
      savedRole._uid = this._encodeUserId(savedRole.userId);
      delete savedRole.userId;
    }
    all[roleId] = { feishu: feishuConfig, role: savedRole };
    try {
      (0, import_fs4.writeFileSync)(this._configFile, JSON.stringify(all, null, 2), { mode: 384 });
    } catch (err) {
      logger17.warn("[FeishuManager] Failed to save config:", err.message);
    }
  }
  _encodeUserId(userId) {
    return Buffer.from(String(userId)).toString("base64");
  }
  _decodeUserId(encoded) {
    try {
      const n3 = parseInt(Buffer.from(encoded, "base64").toString("utf8"), 10);
      return isNaN(n3) ? void 0 : n3;
    } catch {
      return void 0;
    }
  }
  _deleteConfig(roleId) {
    const all = this._loadConfigs();
    delete all[roleId];
    try {
      (0, import_fs4.writeFileSync)(this._configFile, JSON.stringify(all, null, 2), { mode: 384 });
    } catch (err) {
      logger17.warn("[FeishuManager] Failed to delete config:", err.message);
    }
  }
};

// routes/feishu.js
function createFeishuRouter(feishuManager, agentx) {
  return async function feishuRouter(req, res) {
    const url = req.url.replace(/^\/api/, "");
    const method = req.method;
    try {
      if (method === "POST" && url === "/feishu/start") {
        const { roleId, feishuConfig, roleConfig } = await readBody(req);
        if (!roleId || !feishuConfig?.appId || !feishuConfig?.appSecret) {
          return sendJson(res, 400, { error: "roleId, feishuConfig.appId, feishuConfig.appSecret \u5FC5\u586B" });
        }
        if (!roleConfig?.agentId || !roleConfig?.name) {
          return sendJson(res, 400, { error: "roleConfig.agentId, roleConfig.name \u5FC5\u586B" });
        }
        await feishuManager.start(roleId, feishuConfig, roleConfig);
        return sendJson(res, 200, { ok: true, message: "\u98DE\u4E66 Bot \u5DF2\u542F\u52A8" });
      }
      if (method === "POST" && url === "/feishu/stop") {
        const { roleId } = await readBody(req);
        if (!roleId) return sendJson(res, 400, { error: "roleId \u5FC5\u586B" });
        await feishuManager.stop(roleId);
        return sendJson(res, 200, { ok: true, message: "\u98DE\u4E66 Bot \u5DF2\u505C\u6B62" });
      }
      if (method === "DELETE" && url === "/feishu/remove") {
        const { roleId } = await readBody(req);
        if (!roleId) return sendJson(res, 400, { error: "roleId \u5FC5\u586B" });
        await feishuManager.remove(roleId);
        return sendJson(res, 200, { ok: true, message: "\u98DE\u4E66\u914D\u7F6E\u5DF2\u5220\u9664" });
      }
      if (method === "POST" && url === "/feishu/sync-user") {
        const { userId } = await readBody(req);
        if (!userId) return sendJson(res, 400, { error: "userId \u5FC5\u586B" });
        feishuManager.syncUserId(Number(userId));
        return sendJson(res, 200, { ok: true });
      }
      if (method === "GET" && url === "/feishu/status") {
        return sendJson(res, 200, { ok: true, data: feishuManager.getStatus() });
      }
      const statusMatch = url.match(/^\/feishu\/status\/(.+)$/);
      if (method === "GET" && statusMatch) {
        const roleId = statusMatch[1];
        const status = feishuManager.getStatus();
        const roleStatus = status[roleId] ?? { connected: false };
        return sendJson(res, 200, { ok: true, data: roleStatus });
      }
      if (method === "GET" && url === "/feishu/sessions") {
        const result = await agentx.request("image_list_request", {});
        const records = (result?.data?.records ?? []).filter(
          (r3) => r3.containerId?.startsWith("feishu_")
        );
        return sendJson(res, 200, { ok: true, data: records });
      }
      const msgMatch = url.match(/^\/feishu\/sessions\/(.+)\/messages$/);
      if (method === "GET" && msgMatch) {
        const imageId = msgMatch[1];
        const result = await agentx.request("image_messages_request", { imageId });
        return sendJson(res, 200, { ok: true, data: result?.data?.messages ?? [] });
      }
      sendJson(res, 404, { error: "Not found" });
    } catch (err) {
      logger17.error("[FeishuRouter] Error:", err.message);
      sendJson(res, 500, { error: err.message });
    }
  };
}

// index.js
process.on("uncaughtException", (error) => {
  logger17.error("[AgentX] Uncaught Exception:", error.message);
  logger17.error("[AgentX] Stack:", error.stack);
});
process.on("unhandledRejection", (reason) => {
  logger17.error("[AgentX] Unhandled Rejection:", reason);
});
async function main() {
  const config = loadConfig();
  if (!config.apiKey) {
    logger17.error("[AgentX] AGENTX_API_KEY is required");
    process.exit(1);
  }
  initLlmProxy(config);
  logger17.info("[AgentX] Starting local service...");
  await fetchRoleLlmConfigs(config.backendUrl, config.authToken);
  startRoleConfigRefresh(config.backendUrl, config.authToken);
  const HTTP_API_PORT = 7727;
  try {
    const agentx = await createAgentX({
      llm: {
        apiKey: config.apiKey,
        baseUrl: config.baseUrl,
        model: config.model
      },
      agentxDir: config.dataDir,
      environment: {
        claudeCodePath: config.claudeCodePath,
        nodePath: config.nodePath,
        gitBashPath: config.gitBashPath
      },
      logger: buildAgentxLogger(),
      onClientMessage: messageInterceptor
    });
    await agentx.listen(config.port);
    const feishuManager = new FeishuManager(agentx, config.dataDir);
    await feishuManager.restoreAll();
    const feishuRouter = createFeishuRouter(feishuManager, agentx);
    const httpServer = await createHttpServer(HTTP_API_PORT, (req, res) => {
      if (req.url?.startsWith("/api/feishu")) {
        feishuRouter(req, res);
      } else {
        sendJson(res, 404, { error: "Not found" });
      }
    });
    process.stdout.write(`[AgentX] Service started successfully!
`);
    if (process.stdout._handle?.setBlocking) {
      process.stdout._handle.setBlocking(true);
    }
    logger17.info(`[AgentX] WebSocket: ws://127.0.0.1:${config.port}`);
    logger17.info(`[AgentX] HTTP API:  http://127.0.0.1:${HTTP_API_PORT}/api`);
    logger17.info(`[AgentX] Data directory: ${config.dataDir}`);
    const shutdown = async () => {
      logger17.info("[AgentX] Shutting down...");
      await feishuManager.stopAll();
      await agentx.close();
      httpServer.close();
      process.exit(0);
    };
    process.on("SIGINT", shutdown);
    process.on("SIGTERM", shutdown);
  } catch (error) {
    logger17.error("[AgentX] Failed to start:", error);
    process.exit(1);
  }
}
function buildAgentxLogger() {
  return {
    level: "debug",
    factory: {
      getLogger: (name) => ({
        name,
        level: "debug",
        debug: () => {
        },
        info: () => {
        },
        warn: () => {
        },
        error: (message, context) => {
          const msg = message instanceof Error ? message.message : message;
          const ctx = context ? ` ${JSON.stringify(context)}` : "";
          logger17.error(`[${name}] ${msg}${ctx}`);
        },
        isDebugEnabled: () => true,
        isInfoEnabled: () => true,
        isWarnEnabled: () => true,
        isErrorEnabled: () => true
      })
    }
  };
}
main();
/*! Bundled license information:

safe-buffer/index.js:
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)

moment/moment.js:
  (*! moment.js *)
  (*! version : 2.30.1 *)
  (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
  (*! license : MIT *)
  (*! momentjs.com *)

file-stream-rotator/FileStreamRotator.js:
  (*!
   * FileStreamRotator
   * Copyright(c) 2012-2017 Holiday Extras.
   * Copyright(c) 2017 Roger C.
   * MIT Licensed
   *)
*/
/*! Bundled license information:

reconnecting-websocket/dist/reconnecting-websocket-cjs.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation. 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.
  ***************************************************************************** *)
  (*!
   * Reconnecting WebSocket
   * by Pedro Ladaria <pedro.ladaria@gmail.com>
   * https://github.com/pladaria/reconnecting-websocket
   * License MIT
   *)

mime-db/index.js:
  (*!
   * mime-db
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2015-2022 Douglas Christopher Wilson
   * MIT Licensed
   *)

mime-types/index.js:
  (*!
   * mime-types
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2015 Douglas Christopher Wilson
   * MIT Licensed
   *)

axios/dist/node/axios.cjs:
  (*! Axios v1.13.6 Copyright (c) 2026 Matt Zabriskie and contributors *)
*/
